Merge branch 'dev' of http://122.51.230.86:3000/dianliang/lanan-system-vue into dev
This commit is contained in:
commit
611bc1521e
@ -43,20 +43,36 @@
|
||||
/>
|
||||
|
||||
<el-dialog title="单据处理" :visible.sync="dialogVisible" width="80%" v-dialogDrag append-to-body>
|
||||
<el-table el-table v-loading="dialogLoading" :data="items" :stripe="true" :show-overflow-tooltip="true" :row-class-name="getClass" @selection-change="handleSelect">
|
||||
<el-table
|
||||
@cell-mouse-enter="handleCellEnter"
|
||||
@cell-mouse-leave="handleCellLeave"
|
||||
@cell-click="handleCellClick"
|
||||
el-table v-loading="dialogLoading"
|
||||
:data="items" :stripe="true"
|
||||
:show-overflow-tooltip="true"
|
||||
:row-class-name="getRowClass"
|
||||
@selection-change="handleSelect"
|
||||
:key="tableKey"
|
||||
>
|
||||
<el-table-column type="selection" width="80" align="center" />
|
||||
<el-table-column label="名称" align="center" prop="waresName" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="规格" align="center" prop="wares.model" width="180"/>
|
||||
<el-table-column label="申请数量" align="center" prop="waresCount" width="180"/>
|
||||
<el-table-column label="领料数量" align="center" prop="waresCount" width="180">
|
||||
<div class="item" slot-scope="scope">
|
||||
<el-input @blur="save(scope.row)" class="item__input" v-model="scope.row.waresCount"
|
||||
placeholder="请输入数量"></el-input>
|
||||
<span class="item__txt">{{ scope.row.waresCount }}</span>
|
||||
</div>
|
||||
</el-table-column>
|
||||
<el-table-column label="库存数量" align="center" prop="wares.stock" width="180"/>
|
||||
</el-table>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="handlePass(false)" :disabled="selections.length === 0 || selections.filter(item => !item.isStock).length !== 0">通过选择</el-button>
|
||||
<el-button type="success" @click="handlePass(true)"
|
||||
:disabled="this.items.filter(item => !item.isStock).length !== 0"
|
||||
:title="this.items.filter(item => !item.isStock).length !== 0 ? '有配件库存不足':''">通过全部</el-button>
|
||||
<el-button v-if="type" type="primary" @click="handleCreate(false)" :disabled="selections.length === 0">选择生成采购单</el-button>
|
||||
<el-button v-if="type" type="primary" @click="handleCreate(true)">全部生成采购单</el-button>
|
||||
<el-button type="primary" @click="handlePass" :disabled="selections.length === 0 || selections.filter(item => !item.isStock).length !== 0">
|
||||
通知领取
|
||||
</el-button>
|
||||
<el-button type="primary" @click="handleCreate" :disabled="selections.length === 0">
|
||||
采购
|
||||
</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
@ -180,8 +196,9 @@ export default {
|
||||
// 保存进入编辑的cell
|
||||
clickCellMap: {},
|
||||
// 需要编辑的属性
|
||||
editProp: ['warehouse', 'count', 'newPrice', 'remark', 'code'],
|
||||
editProp: ['warehouse', 'count', 'newPrice', 'remark', 'code', 'waresCount'],
|
||||
remark: null,
|
||||
tableKey: 0,
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
@ -189,7 +206,7 @@ export default {
|
||||
},
|
||||
methods:{
|
||||
// 通过 true是全部、false是选择
|
||||
async handlePass(flag){
|
||||
async handlePass(){
|
||||
// 生成领料单
|
||||
if (this.type){
|
||||
this.formData.repairSo = {
|
||||
@ -201,21 +218,6 @@ export default {
|
||||
soStatus: "04",
|
||||
purchaseType: "01"
|
||||
}
|
||||
if (flag){
|
||||
this.formData.repairSois = [...this.items.map(item => {
|
||||
return {
|
||||
soiType: '02',
|
||||
goodsId: item.waresId,
|
||||
goodsCount: item.waresCount,
|
||||
}
|
||||
})]
|
||||
this.formData.items = [...this.items.map(item => {
|
||||
return {
|
||||
id: item.id,
|
||||
waresStatus: "04"
|
||||
}
|
||||
})]
|
||||
}else {
|
||||
this.formData.repairSois = [...this.selections.map(item => {
|
||||
return {
|
||||
soiType: '02',
|
||||
@ -226,10 +228,8 @@ export default {
|
||||
this.formData.items = [...this.selections.map(item => {
|
||||
return {
|
||||
id: item.id,
|
||||
waresStatus: "04"
|
||||
}
|
||||
})]
|
||||
}
|
||||
try {
|
||||
await pass(this.formData)
|
||||
this.$modal.msgSuccess("处理成功")
|
||||
@ -240,21 +240,12 @@ export default {
|
||||
}else {
|
||||
// 退料方法
|
||||
this.formData = {}
|
||||
if (flag){
|
||||
this.formData.items = [...this.items.map(item => {
|
||||
return {
|
||||
id: item.id,
|
||||
waresStatus: "05"
|
||||
}
|
||||
})]
|
||||
}else {
|
||||
this.formData.items = [...this.selections.map(item => {
|
||||
return {
|
||||
id: item.id,
|
||||
waresStatus: "05"
|
||||
}
|
||||
})]
|
||||
}
|
||||
try {
|
||||
await passBackTicketWares(this.formData)
|
||||
this.$modal.msgSuccess("处理成功")
|
||||
@ -321,7 +312,9 @@ export default {
|
||||
this.items = res.data
|
||||
// 库存判断
|
||||
this.items.forEach(item => {
|
||||
item.isStock = item.waresCount <= item.wares.stock
|
||||
const count = item.waresAlreadyCount ? parseInt(item.waresCount) - parseInt(item.waresAlreadyCount) : item.waresCount
|
||||
item.waresCount = count
|
||||
item.isStock = count <= item.wares.stock
|
||||
})
|
||||
// 只要未领料的
|
||||
if (this.type){
|
||||
@ -334,7 +327,7 @@ export default {
|
||||
this.dialogLoading = false
|
||||
}
|
||||
},
|
||||
getClass(row){
|
||||
getRowClass(row){
|
||||
if (this.type && !row.row.isStock){
|
||||
return 'stock'
|
||||
}
|
||||
@ -411,6 +404,7 @@ export default {
|
||||
/** 保存数据 */
|
||||
save(row) {
|
||||
// 更新表格的数据
|
||||
row.isStock = row.waresCount <= row.wares.stock
|
||||
row.totalPrice = row.count * row.newPrice
|
||||
const id = row.id
|
||||
// 取消本行所有cell的编辑状态
|
||||
@ -418,6 +412,7 @@ export default {
|
||||
this.cancelEditable(cell)
|
||||
})
|
||||
this.clickCellMap[id] = []
|
||||
this.tableKey++
|
||||
},
|
||||
changeWare(row) {
|
||||
if (row.ware) {
|
||||
|
@ -1,10 +1,10 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-tabs v-model="activeTab">
|
||||
<el-tab-pane label="领料申请" name="get">
|
||||
<el-tab-pane label="领配件管理" name="get">
|
||||
<WaresItem :type="true"/>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="退料申请" name="back">
|
||||
<el-tab-pane label="退配件管理" name="back">
|
||||
<WaresItem :type="false"/>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
|
43
src/views/repair/tickets/Components/DiscountInput.vue
Normal file
43
src/views/repair/tickets/Components/DiscountInput.vue
Normal file
@ -0,0 +1,43 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-input v-model="localValue" @blur="handleBlur" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "DiscountInput",
|
||||
props: {
|
||||
value: [Number, String]
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
localValue: this.value
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
// 当父组件传递的值改变时更新 localValue
|
||||
value(newVal) {
|
||||
this.localValue = newVal;
|
||||
},
|
||||
// 当 localValue 改变时进行校验,并通知父组件
|
||||
localValue(val) {
|
||||
if (val < 0 || val > 1) {
|
||||
this.$modal.msgWarning("折扣只能是0-1");
|
||||
this.localValue = Math.max(0, Math.min(1, val)); // 确保值在0到1之间
|
||||
} else {
|
||||
this.$emit("input", this.localValue ? this.localValue : 1); // 通知父组件新值
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
handleBlur(event) {
|
||||
this.$emit("input-blur", event); // 触发 input-blur 事件
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
/* 样式保持不变 */
|
||||
</style>
|
@ -50,8 +50,9 @@
|
||||
</el-table-column>
|
||||
<el-table-column v-if="!exportColumn.includes('discount')" align="center" label="折扣" width="180" prop="discount">
|
||||
<div v-if="scope.row.id" class="item" slot-scope="scope">
|
||||
<el-input @blur="save(scope.row)" class="item__input" v-model="scope.row.discount"/>
|
||||
<span class="item__txt">{{ scope.row.discount }}</span>
|
||||
<!-- <el-input :min="0" :max="1" @blur="save(scope.row)" class="item__input" v-model="scope.row.discount"/>-->
|
||||
<DiscountInput @input-blur="save(scope.row)" class="item__input" v-model="scope.row.discount" />
|
||||
<span class="item__txt">{{ scope.row.discount === 1 ? "无折扣" : scope.row.discount }}</span>
|
||||
</div>
|
||||
</el-table-column>
|
||||
<el-table-column v-if="!exportColumn.includes('totalPrice')" align="center" label="金额" width="180" prop="totalPrice">
|
||||
@ -133,10 +134,12 @@ import {getOtherByName} from "@/api/repair/other";
|
||||
import {getProjectByName} from "@/api/repair/project";
|
||||
import {getWaresByName} from "@/api/repair/wares";
|
||||
import WorkerChoose from "@/views/repair/Components/WorkerChoose.vue";
|
||||
import DiscountInput from "@/views/repair/tickets/Components/DiscountInput.vue";
|
||||
|
||||
export default {
|
||||
name: "TicketItem",
|
||||
components: {
|
||||
DiscountInput,
|
||||
WorkerChoose,
|
||||
OtherForm,
|
||||
OtherChoose, ProjectChoose, RepairProjectForm, WaresForm, ServerChoose, StaffChoose, PartChoose
|
||||
@ -289,7 +292,7 @@ export default {
|
||||
// console.log(row)
|
||||
if (row.id) {
|
||||
row.itemStatus = "01"
|
||||
row.totalPrice = row.count * row.price * (row.discount / 10)
|
||||
row.totalPrice = row.count * row.price * row.discount
|
||||
}
|
||||
const id = row.id
|
||||
// 取消本行所有cell的编辑状态
|
||||
@ -310,7 +313,7 @@ export default {
|
||||
data = {
|
||||
...data,
|
||||
count: 1,
|
||||
discount: 10,
|
||||
discount: 1,
|
||||
remark: null,
|
||||
itemStatus: '01',
|
||||
totalPrice: data.price,
|
||||
|
@ -29,7 +29,11 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="单价" width="180" prop="itemPrice"/>
|
||||
<el-table-column align="center" label="折扣" width="180" prop="itemDiscount"/>
|
||||
<el-table-column align="center" label="折扣" width="180" prop="itemDiscount">
|
||||
<template slot-scope="scope">
|
||||
{{scope.row.itemDiscount === 1 ? "无折扣" : scope.row.itemDiscount}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="金额" width="180" prop="itemMoney"/>
|
||||
<el-table-column align="center" label="施工人员" width="180" prop="repairNames"/>
|
||||
<el-table-column align="center" label="销售人员" width="180" prop="saleName"/>
|
||||
|
@ -50,32 +50,35 @@
|
||||
<el-button v-if="userRole === 'service_advisor' && scope.row.ticketsWorkStatus === '01'" size="mini" type="text" icon="el-icon-check" @click="handleNotify(scope.row)">
|
||||
通知施工
|
||||
</el-button>
|
||||
<el-button size="mini" v-if="userRole === 'repair_staff' && !isFinish" type="text" icon="el-icon-monitor" @click="handleRecord(scope.row, 'sgz')">
|
||||
过程记录
|
||||
</el-button>
|
||||
<el-button size="mini" v-if="userRole === 'repair_staff' && !isFinish" type="text" icon="el-icon-monitor" @click="handleRecord(scope.row, 'kssg')">
|
||||
<el-button size="mini" v-if="scope.row.ticketsWorkStatus !== '01' &&userRole === 'repair_staff' && !isFinish" type="text" icon="el-icon-monitor" @click="handleRecord(scope.row, 'kssg')">
|
||||
开始施工
|
||||
</el-button>
|
||||
<el-button size="mini" v-if="userRole === 'repair_staff' && !isFinish" type="text" icon="el-icon-monitor" @click="handleRecord(scope.row, 'sgwczj')">
|
||||
<el-button size="mini" v-if=" scope.row.ticketsWorkStatus !== '01' && userRole === 'repair_staff' && !isFinish" type="text" icon="el-icon-monitor" @click="handleRecord(scope.row, 'sgz')">
|
||||
过程记录
|
||||
</el-button>
|
||||
<el-button size="mini" v-if="scope.row.ticketsWorkStatus !== '01' && userRole === 'repair_staff' && !isFinish" type="text" icon="el-icon-monitor" @click="handleRecord(scope.row, 'sgwczj')">
|
||||
施工完成
|
||||
</el-button>
|
||||
<el-button @click="handleRecord(scope.row, 'zj')" size="mini" type="text" icon="el-icon-monitor" v-if="userRole === 'general_inspection' && scope.row.ticketsWorkStatus === '05'">
|
||||
终检
|
||||
</el-button>
|
||||
<el-button @click="handleReTake(scope.row)" size="mini" type="text" icon="el-icon-refresh" v-if="(userRole === 'repair_staff' ? leader : false) && !(scope.row.ticketsWorkStatus !== '01' && userRole === 'repair_staff' && !isFinish)">
|
||||
重新指派
|
||||
</el-button>
|
||||
<el-dropdown
|
||||
v-if="userRole !== 'general_inspection'"
|
||||
v-if="scope.row.ticketsWorkStatus !== '01'"
|
||||
@command="(command) => handleCommand(command, scope.$index, scope.row)">
|
||||
<el-button size="mini" type="text" icon="el-icon-d-arrow-right">更多</el-button>
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
<el-dropdown-item v-if="!isFinish && scope.row.ticketsWorkStatus !== '01' && userRole === 'repair_staff'" command="handleGet" size="mini" type="text" icon="el-icon-document-add"
|
||||
>申请领料
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item v-if="scope.row.ticketsWorkStatus !== '01' && userRole === 'repair_staff'" command="handleBack" size="mini" type="text" icon="el-icon-document-delete"
|
||||
>申请退料
|
||||
>申请配件
|
||||
</el-dropdown-item>
|
||||
<!-- <el-dropdown-item v-if="scope.row.ticketsWorkStatus !== '01' && userRole === 'repair_staff'" command="handleBack" size="mini" type="text" icon="el-icon-document-delete"-->
|
||||
<!-- >申请退料-->
|
||||
<!-- </el-dropdown-item>-->
|
||||
<!-- 还要判断是不是员工 -->
|
||||
<el-dropdown-item
|
||||
v-if="(userRole === 'repair_staff' ? leader : true) && !isFinish"
|
||||
v-if="userRole !== 'repair_staff' && !isFinish && scope.row.ticketsWorkStatus !== '01'"
|
||||
command="handleReTake" size="mini" type="text" icon="el-icon-refresh"
|
||||
>重新指派
|
||||
</el-dropdown-item>
|
||||
@ -101,12 +104,12 @@
|
||||
@selection-change="rowSelect"
|
||||
>
|
||||
<el-table-column type="selection" align="center" />
|
||||
<el-table-column label="商品名称" prop="waresName" align="center"/>
|
||||
<el-table-column label="规格" prop="wares.model" align="center"/>
|
||||
<el-table-column label="数量" prop="waresCount" align="center">
|
||||
<el-table-column label="商品名称" prop="itemName" align="center"/>
|
||||
<el-table-column label="规格" prop="ware.model" align="center"/>
|
||||
<el-table-column label="数量" prop="itemCount" align="center">
|
||||
<div v-if="scope.row.id" class="item" slot-scope="scope">
|
||||
<el-input @blur="save(scope.row)" class="item__input" v-model="scope.row.waresCount"/>
|
||||
<span class="item__txt">{{ scope.row.waresCount }}</span>
|
||||
<el-input @blur="save(scope.row)" class="item__input" v-model="scope.row.itemCount"/>
|
||||
<span class="item__txt">{{ scope.row.itemCount }}</span>
|
||||
</div>
|
||||
</el-table-column>
|
||||
<el-table-column label="备注" prop="remark" align="center">
|
||||
@ -130,7 +133,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {getPageType, updateTake} from "@/api/repair/tickets/Tickets";
|
||||
import {getPageType, updateTake, getTicketsById} from "@/api/repair/tickets/Tickets";
|
||||
import TicketsShow from "@/views/repair/tickets/Components/TicketsShow.vue";
|
||||
import UpdateRepair from "@/views/repair/tickets/form/UpdateRepair.vue";
|
||||
import TWOperate from "@/views/repair/tickets/form/TWOperate.vue";
|
||||
@ -160,7 +163,7 @@ export default {
|
||||
pageSize: 10,
|
||||
ticketNo: null,
|
||||
searchTimeArray: [],
|
||||
isFinish: this.isFinish ? "1" : "0"
|
||||
isFinish: this.isFinish ? "1" : "0",
|
||||
},
|
||||
showSearch: true,
|
||||
loading: false,
|
||||
@ -172,7 +175,7 @@ export default {
|
||||
// 保存进入编辑的cell
|
||||
clickCellMap: {},
|
||||
// 需要编辑的属性
|
||||
editProp: ['remark', 'waresCount'],
|
||||
editProp: ['remark', 'itemCount'],
|
||||
selections: [],
|
||||
formData: {},
|
||||
remark: null,
|
||||
@ -242,13 +245,8 @@ export default {
|
||||
this.backVisible = true
|
||||
try {
|
||||
this.backLoading = true
|
||||
const data = {
|
||||
twId: row.twId
|
||||
}
|
||||
const res = await listTwItem(data)
|
||||
this.partList = res.data
|
||||
// 未领料的不要
|
||||
this.partList = this.partList.filter(item => item.waresStatus === '01')
|
||||
const res = await getTicketsById(row.id)
|
||||
this.partList = res.data.wares
|
||||
}finally {
|
||||
this.backLoading = false
|
||||
}
|
||||
@ -326,7 +324,7 @@ export default {
|
||||
/** 保存数据 */
|
||||
save(row) {
|
||||
// 更新表格的数据
|
||||
row.totalPrice = row.count * row.newPrice
|
||||
console.log(row, this.clickCellMap)
|
||||
const id = row.id
|
||||
// 取消本行所有cell的编辑状态
|
||||
this.clickCellMap[id].forEach(cell => {
|
||||
|
@ -42,11 +42,12 @@
|
||||
<el-button v-if="(userRole === 'service_advisor' || userRole === 'general_inspection') && scope.row.status === '01'" @click="handleAudit(scope.row)" type="text" size="mini" icon="el-icon-s-check">
|
||||
审核
|
||||
</el-button>
|
||||
<!-- todo 待完成 -->
|
||||
<el-button @click="handleGet(scope.row)" v-if="userRole === 'repair_staff' && scope.row.status !== '01' && scope.row.type === '01'" type="text" size="mini" icon="el-icon-finished">
|
||||
领料
|
||||
领料确认
|
||||
</el-button>
|
||||
<el-button @click="handleGet(scope.row)" v-if="userRole === 'repair_staff' && scope.row.status !== '01' && scope.row.type === '02'" type="text" size="mini" icon="el-icon-finished">
|
||||
退料
|
||||
退料确认
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
@ -169,11 +169,12 @@
|
||||
<el-table-column label="数量" align="center" prop="waresCount" width="180"/>
|
||||
<el-table-column v-if="userRole === 'service_advisor' && type" label="折扣" align="center" prop="itemDiscount" width="180">
|
||||
<div v-if="formData.status === '01'" class="item" slot-scope="scope">
|
||||
<el-input @blur="save(scope.row)" class="item__input" v-model="scope.row.itemDiscount"/>
|
||||
<span class="item__txt">{{ scope.row.itemDiscount }}</span>
|
||||
<!-- <el-input @blur="save(scope.row)" class="item__input" v-model="scope.row.itemDiscount"/>-->
|
||||
<DiscountInput @input-blur="save(scope.row)" class="item__input" v-model="scope.row.itemDiscount" />
|
||||
<span class="item__txt">{{ scope.row.itemDiscount === 1 ? "无折扣" : scope.row.itemDiscount }}</span>
|
||||
</div>
|
||||
<div v-else class="item" slot-scope="scope">
|
||||
<span>{{ scope.row.itemDiscount }}</span>
|
||||
<div v-else slot-scope="scope">
|
||||
<span>{{ scope.row.itemDiscount === 1 ? "无折扣" : scope.row.itemDiscount }}</span>
|
||||
</div>
|
||||
</el-table-column>
|
||||
<el-table-column label="状态" align="center" prop="waresStatus" width="180">
|
||||
@ -197,9 +198,11 @@
|
||||
import {getTicketsById} from "@/api/repair/tickets/Tickets";
|
||||
import {auditTicketWares} from "@/api/repair/tickets/TicketWares";
|
||||
import {listTwItem, updateIsShow} from "@/api/repair/tickets/TWItem";
|
||||
import DiscountInput from "@/views/repair/tickets/Components/DiscountInput.vue";
|
||||
|
||||
export default {
|
||||
name: "TicketWaresShow",
|
||||
components: {DiscountInput},
|
||||
props:{
|
||||
userRole: String,
|
||||
type: Boolean
|
||||
@ -241,7 +244,7 @@ export default {
|
||||
this.items = [...this.items.map(item => {
|
||||
return {
|
||||
...item,
|
||||
itemDiscount: 10,
|
||||
itemDiscount: 1,
|
||||
}
|
||||
})]
|
||||
}finally {
|
||||
|
@ -7,12 +7,12 @@
|
||||
<el-tab-pane label="已完成工单" name="finish">
|
||||
<TicketManagerItem :is-finish="true" :user-role="userRole"/>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="领料申请单" name="getApply">
|
||||
<el-tab-pane :label="userRole !== 'repair_staff' ? '配件申请单' : '领退料确认'" name="getApply">
|
||||
<TicketWares :type="true" :user-role="userRole"/>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="退料申请单" name="backApply">
|
||||
<TicketWares :type="false" :user-role="userRole"/>
|
||||
</el-tab-pane>
|
||||
<!-- <el-tab-pane label="退料申请单" name="backApply">-->
|
||||
<!-- <TicketWares :type="false" :user-role="userRole"/>-->
|
||||
<!-- </el-tab-pane>-->
|
||||
</el-tabs>
|
||||
</div>
|
||||
</template>
|
||||
|
Loading…
Reference in New Issue
Block a user