-
+
@@ -272,6 +282,8 @@
+
+
@@ -292,10 +304,11 @@ import {getBaseTypeList} from "@/api/base/type";
import {listByTicketId} from "@/api/repair/repairworker";
import StaffChoose from "@/views/repair/Components/StaffChoose.vue";
import SupplierChoose from "@/views/repair/Components/SupplierChoose.vue";
+import TWIAdd from "@/views/repair/tickets/Components/TWIAdd.vue";
export default {
name: "WaresItem",
- components: {SupplierChoose, StaffChoose, TicketWaresShow, WarehouseChoose, SoTable},
+ components: {TWIAdd, SupplierChoose, StaffChoose, TicketWaresShow, WarehouseChoose, SoTable},
props: {
type: Boolean,
},
@@ -352,6 +365,12 @@ export default {
this.getList()
},
methods: {
+ handleAddWares(){
+ this.$refs.twiAdd.open({id: this.twId})
+ },
+ handleSuccess(data){
+ this.getTwitemList({twId: this.twId})
+ },
getTypeById(id) {
return this.typeMap.get(id)
},
@@ -421,7 +440,7 @@ export default {
this.images = null
this.inPhoto = true
},
- async getTicketStaff(){
+ async getTicketStaff() {
const res = await listByTicketId(this.ticketId)
this.staffs = res.data
this.chooseStaff.push(this.formData.repairId)
@@ -433,7 +452,7 @@ export default {
return item.replace(process.env.VUE_APP_FILE_API, "")
}).join(",")
}
- if ((!this.chooseStaff || this.chooseStaff.length === 0)){
+ if ((!this.chooseStaff || this.chooseStaff.length === 0)) {
this.$modal.msgError(`请选择${this.type ? '领' : '退'}料人!`)
return
}
@@ -455,6 +474,7 @@ export default {
goodsCount: item.waresCount,
}
})]
+ this.formData.ids = this.allSelectRows.map(item => item.id)
if (this.type) {
this.formData.items = [...this.allSelectRows.map(item => {
return {
@@ -717,7 +737,7 @@ export default {
soStatus: "02",
remark: this.remark,
}
- if (this.chooseSupplier){
+ if (this.chooseSupplier) {
this.formData.supplierId = this.chooseSupplier.id
this.formData.supplierName = this.chooseSupplier.name
}
diff --git a/src/views/repair/tickets/Components/TWIAdd.vue b/src/views/repair/tickets/Components/TWIAdd.vue
index 0346aa9..e7dd55b 100644
--- a/src/views/repair/tickets/Components/TWIAdd.vue
+++ b/src/views/repair/tickets/Components/TWIAdd.vue
@@ -129,6 +129,13 @@ import {addTwi} from "@/api/repair/tickets/TWItem";
export default {
name: "TWIAdd",
components: {TreeSelect},
+ props:{
+ ifHouseAdd: {
+ type: Boolean,
+ default: false,
+ required: false
+ }
+ },
data(){
return{
dialogVisible: false,
@@ -199,6 +206,7 @@ export default {
name: item.name
}
})]
+ this.formData.ifHouseAdd = this.ifHouseAdd
},
async open(row){
this.reset()