| | |
| | | // 采购状态 |
| | | const purchaseStatus=[ |
| | | {id:1,name:"待确认"}, |
| | | {id:2,name:"待入库"}, |
| | | {id:3,name:"已入库"}, |
| | | {id:4,name:"已完成"}, |
| | | {id:5,name:"已取消"} |
| | | const purchaseStatus = [ |
| | | { id: 1, name: "待确认" }, |
| | | { id: 2, name: "待入库" }, |
| | | { id: 3, name: "就绪" }, |
| | | { id: 4, name: "已完成" }, |
| | | { id: 5, name: "已取消" } |
| | | ] |
| | | // 质检单状态 |
| | | const qualityStatus=[ |
| | | const qualityStatus = [ |
| | | { |
| | | name:'待质检', |
| | | id:1, |
| | | name: "待质检", |
| | | id: 1 |
| | | }, |
| | | { |
| | | name:'已完成', |
| | | id:2, |
| | | name: "已完成", |
| | | id: 2 |
| | | } |
| | | ] |
| | | // 退货单状态 |
| | | const returnedStatus=[ |
| | | const returnedStatus = [ |
| | | { |
| | | name:'待发货', |
| | | id:1, |
| | | name: "待发货", |
| | | id: 1 |
| | | }, |
| | | { |
| | | name:'待签收', |
| | | id:2, |
| | | name: "待签收", |
| | | id: 2 |
| | | }, |
| | | { |
| | | name:'待发货', |
| | | id:3, |
| | | name: "待发货", |
| | | id: 3 |
| | | }, |
| | | { |
| | | name:'已完成', |
| | | id:4, |
| | | }, |
| | | name: "已完成", |
| | | id: 4 |
| | | } |
| | | ] |
| | | |
| | | export const getDataByType = type => { |
| | | if(type =='purchaseStatus'){ |
| | | return purchaseStatus; |
| | | }else if(type=='qualityStatus'){ |
| | | return qualityStatus; |
| | | }else if(type=='returnedStatus'){ |
| | | return returnedStatus; |
| | | export const getDataByType = (type) => { |
| | | if (type == "purchaseStatus") { |
| | | return purchaseStatus |
| | | } else if (type == "qualityStatus") { |
| | | return qualityStatus |
| | | } else if (type == "returnedStatus") { |
| | | return returnedStatus |
| | | } |
| | | } |
| | |
| | | v-model="editConfig.infomation.purchaseTypeId" |
| | | clearable |
| | | style="width: calc(100% - 30px)" |
| | | @visible-change="selPurchaseChange" |
| | | > |
| | | <el-option |
| | | v-for="ele in plcBrandList" |
| | |
| | | editConfig: this.editCommonConfig, |
| | | rules: { |
| | | purchaseTypeId: [{ required: true, message: "请选择", trigger: "change" }], |
| | | supplierName: [{ required: true, message: "请选择", trigger: "change" }], |
| | | supplierName: [{ required: true, message: "请选择供应商名称", trigger: "change" }], |
| | | phone: [ |
| | | { |
| | | required: false, |
| | |
| | | { validator: this.validatorNumThree, trigger: "change" } |
| | | ], |
| | | number: [{ required: true, validator: this.validateCheckCode, trigger: ["change", "blur"] }], |
| | | warehouse: [{ required: true, message: "请选择", trigger: "change" }] |
| | | warehouse: [{ required: true, message: "请选择收货仓库", trigger: "change" }], |
| | | signingDate: [{ required: true, message: "请选择签约日期", trigger: "change" }], |
| | | deliveryDate: [{ required: true, message: "请选择交付日期", trigger: "change" }] |
| | | }, |
| | | productTableList: {}, |
| | | showSummary: { |
| | |
| | | total: false, |
| | | sumProp: ["price", "total"], |
| | | multiply: ["amount", "price"], |
| | | titleProp: ["编号", "产品名称", "产品编号", "计量单位", "规格型号", "采购单价", "描述"], |
| | | titleProp: ["编号", "产品名称", "产品编号", "计量单位", "规格", "型号", "采购单价", "描述"], |
| | | mergeNumber: 4, |
| | | totalName: "小计" |
| | | }, |
| | |
| | | }, |
| | | created() { |
| | | console.log(this.editConfig, "参数") |
| | | this.handleGetBomKindDictList() |
| | | if (this.editConfig.title == "新建") { |
| | | this.handleGetBomKindDictList() |
| | | } |
| | | this.getWarehouseInfo() |
| | | this.$store.dispatch("getSupplier") |
| | | this.formInfo() |
| | |
| | | "editCommonConfig.visible": { |
| | | immediate: true, |
| | | handler: function () { |
| | | this.handleGetBomKindDictList(true) |
| | | if (this.editConfig.title == "新建") { |
| | | this.handleGetBomKindDictList(true) |
| | | } |
| | | } |
| | | } |
| | | }, |
| | |
| | | } |
| | | } |
| | | }) |
| | | }, |
| | | // 选择采购类型下拉方法 |
| | | selPurchaseChange(val) { |
| | | if (val) { |
| | | this.handleGetBomKindDictList() |
| | | } |
| | | }, |
| | | handleConfirmSave(data) { |
| | | console.log(data, "data") |
| | |
| | | }, |
| | | { label: "产品编号", prop: "number", min: 150 }, |
| | | { label: "计量单位", prop: "unit" }, |
| | | { label: "规格型号", prop: "specifications" }, |
| | | { label: "规格", prop: "specifications" }, |
| | | { label: "型号", prop: "modelNumber" }, |
| | | { label: "数量", prop: "amount", inputNumber: true, disabled: this.editConfig.isDisabled }, |
| | | { |
| | | label: "采购单价", |
| | |
| | | number: "", |
| | | contact: "", |
| | | phone: "", |
| | | signingDate: "", |
| | | signingDate: this.getCurrentDate(), |
| | | deliveryDate: "", |
| | | remark: "", |
| | | wholeDiscountType: null, |
| | |
| | | realTotalPrice: 0 |
| | | } |
| | | }, |
| | | |
| | | // 获取当前日期 |
| | | getCurrentDate() { |
| | | let now = new Date() |
| | | let year = now.getFullYear() |
| | | let month = now.getMonth() + 1 |
| | | let day = now.getDate() |
| | | return year + "-" + month + "-" + day |
| | | }, |
| | | // 编辑 |
| | | btnEdit(row) { |
| | | this.editConfig.detailEnter = false |
| | |
| | | this.editConfig.infomation = { |
| | | productList: res.data.productList, |
| | | supplierName: res.data.purchase.supplier.name, |
| | | ...res.data.purchase |
| | | ...res.data.purchase, |
| | | purchaseTypeId: res.data.purchase.purchaseTypeId == "0" ? "" : res.data.purchase.purchaseTypeId |
| | | } |
| | | } else { |
| | | this.$message.error(res.msg ? res.msg + "," : "" + "获取信息失败!") |
| | |
| | | this.editConfig.infomation = { |
| | | productList: res.data.productList, |
| | | supplierName: res.data.purchase.supplier.name, |
| | | ...res.data.purchase |
| | | ...res.data.purchase, |
| | | purchaseTypeId: res.data.purchase.purchaseTypeId == "0" ? "" : res.data.purchase.purchaseTypeId |
| | | } |
| | | } else { |
| | | this.$message.error(res.msg ? res.msg + "," : "" + "获取信息失败!") |