diff --git a/src/views/repair/stockOperate/Components/WaresItem.vue b/src/views/repair/stockOperate/Components/WaresItem.vue
index 7dfab95..0079e3c 100644
--- a/src/views/repair/stockOperate/Components/WaresItem.vue
+++ b/src/views/repair/stockOperate/Components/WaresItem.vue
@@ -21,17 +21,24 @@
-
-
-
-
+
+
+
+
+
+
+
-
+
-
-
+
+
+
+
+ 查看
+
处理
@@ -39,7 +46,7 @@
-
@@ -57,7 +64,7 @@
>
-
+
-
-
-
+
+
+
+
+
+
+
+
@@ -174,6 +186,8 @@
确定
+
+
@@ -186,10 +200,11 @@ import SoTable from "@/views/repair/stockOperate/Components/SoTable.vue";
import WarehouseChoose from "@/views/repair/Components/WarehouseChoose.vue";
import {createRepairSo} from "@/api/repair/stockOperate/stockOperate";
import {getUserProfile} from "@/api/system/user";
+import TicketWaresShow from "@/views/repair/tickets/Components/TicketWaresShow.vue";
export default {
name: "WaresItem",
- components: {WarehouseChoose, SoTable},
+ components: {TicketWaresShow, WarehouseChoose, SoTable},
props: {
type: Boolean,
},
@@ -199,8 +214,7 @@ export default {
pageNo: 1,
pageSize: 10,
query: null,
- type: "01",
- isBack: this.type ? null : true
+ isBack: !this.type,
},
showSearch: true,
loading: false,
@@ -217,7 +231,7 @@ export default {
// 保存进入编辑的cell
clickCellMap: {},
// 需要编辑的属性
- editProp: ['warehouse', 'count', 'newPrice', 'remark', 'code', 'waresCount', 'model'],
+ editProp: ['warehouse', 'count', 'newPrice', 'remark', 'code', 'waresCount', 'model', 'unit'],
remark: null,
tableKey: 0,
}
@@ -226,6 +240,9 @@ export default {
this.getList()
},
methods: {
+ getDictDatasToType(type){
+ return this.getDictDatas(type)
+ },
// 通过 true是全部、false是选择
async handlePass() {
// 生成领料单、退料单
@@ -304,15 +321,13 @@ export default {
const data = {twId: row.id}
const res = await listTwItem(data)
this.items = res.data
+ this.items = this.items.filter(item => item.waresStatus === '1')
this.items.forEach(item => {
const count = item.waresAlreadyCount ? parseInt(item.waresCount) - parseInt(item.waresAlreadyCount) : item.waresCount
item.waresCount = this.type ? count : item.waresAlreadyCount
item.isStock = this.type ? count <= item.wares.stock : true
})
- this.items = this.items.filter(item => this.type ? item.waresStatus === '02' : item.waresAlreadyCount)
- if (!this.type) {
- this.items = this.items.filter(item => item.waresAlreadyCount !== item.waresBackCount)
- }
+ this.items = this.items.filter(item => this.type ? (item.waresCount > item.waresAlreadyCount) : (item.waresAlreadyCount > 0))
} finally {
this.dialogLoading = false
}
@@ -497,6 +512,9 @@ export default {
}
})
return flag.filter(item => item !== "").join(",")
+ },
+ handleView(row){
+ this.$refs.ticketWaresShow.open(row)
}
}
}
diff --git a/src/views/repair/tickets/Components/TicketWaresShow.vue b/src/views/repair/tickets/Components/TicketWaresShow.vue
index 8cbc52e..6007a9b 100644
--- a/src/views/repair/tickets/Components/TicketWaresShow.vue
+++ b/src/views/repair/tickets/Components/TicketWaresShow.vue
@@ -95,12 +95,12 @@
-
+
°
-
+
°
@@ -113,13 +113,13 @@
-
-
+
+
°
-
+
°
@@ -201,6 +201,9 @@ export default {
itemDiscount: 1,
}
})]
+ if (this.type){
+ this.items = [...this.items.filter(item => item.waresStatus === "")]
+ }
} finally {
this.loading = false
}
@@ -221,40 +224,21 @@ export default {
// if (names) {
// await this.$modal.confirm("确认配件:" + names + "的销售价格为0吗?")
// }
- this.formData['status'] = flag ? "02" : '03'
+ this.dialogLoading = this.$loading({
+ target: this.$refs.dialogRef.$el
+ })
+ this.formData['status'] = flag ? "01" : '02'
// 处理配件信息
if (this.selectRow && this.selectRow.length > 0){
- this.formData.wares = [...this.selectRow.map(item => {
+ this.formData.items = [...this.selectRow.map(item => {
return {
- itemName: item.waresName,
- itemCount: item.waresCount,
- itemUnit: item.wares.unit,
- itemPrice: item.wares.price,
- repairIds: this.formData.repairId,
- repairNames: this.formData.repairName,
- saleId: this.formData.adviserId,
- saleName: this.formData.adviserName,
- itemDiscount: item.itemDiscount,
- itemMoney: item.wares.price * item.waresCount * (item.itemDiscount / 10),
- partId: item.waresId,
- remark: item.remark
+ id: item.id
}
})]
}else {
- this.formData.wares = [...this.items.map(item => {
+ this.formData.items = [...this.items.map(item => {
return {
- itemName: item.waresName,
- itemCount: item.waresCount,
- itemUnit: item.wares.unit,
- itemPrice: item.wares.price,
- repairIds: this.formData.repairId,
- repairNames: this.formData.repairName,
- saleId: this.formData.adviserId,
- saleName: this.formData.adviserName,
- itemDiscount: item.itemDiscount,
- itemMoney: item.wares.price * item.waresCount * (item.itemDiscount / 10),
- partId: item.waresId,
- remark: item.remark
+ id: item.id
}
})]
}
@@ -262,10 +246,9 @@ export default {
this.dialogVisible = false
this.$modal.msgSuccess("审核成功")
this.$emit('success')
- } catch {
-
+ } finally {
+ this.dialogLoading.close()
}
-
},
/** 鼠标移入cell */
handleCellEnter(row, column, cell, event) {
diff --git a/src/views/repair/tickets/form/GetAndBackWares.vue b/src/views/repair/tickets/form/GetAndBackWares.vue
index f28d3ab..e9bc7e6 100644
--- a/src/views/repair/tickets/form/GetAndBackWares.vue
+++ b/src/views/repair/tickets/form/GetAndBackWares.vue
@@ -45,8 +45,8 @@
-
-
+
+
@@ -132,6 +132,7 @@ export default {
this.formData['id'] = row.id
try{
this.items = []
+ this.image = null
this.dialogVisible = true
this.dialogLoading = true
const res = await getRepairSoiBySoId(row.id)