| | |
| | | > |
| | | <el-option |
| | | v-for="ele in plcBrandList" |
| | | :key="ele.id" |
| | | :key="ele.name" |
| | | :label="ele.name" |
| | | :value="ele.name" |
| | | :value="ele.ID" |
| | | ></el-option> |
| | | </el-select> |
| | | <i |
| | |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="单据来源" prop="number"> |
| | | <el-form-item label="单据来源" prop="orderSource"> |
| | | <el-input |
| | | v-model="editConfig.infomation.number" |
| | | v-model="editConfig.infomation.orderSource" |
| | | disabled |
| | | placeholder="请填写" |
| | | ></el-input> |
| | |
| | | <div class="table-bottom-l"> |
| | | <el-form-item label="整单折扣" prop="member_id"> |
| | | <el-select |
| | | v-model="editConfig.infomation.fieldName" |
| | | v-model="editConfig.infomation.wholeDiscountType" |
| | | placeholder="请选择" |
| | | filterable |
| | | > |
| | |
| | | <div class="table-bottom-r"> |
| | | <el-form-item label="" prop="member_id"> |
| | | <el-input |
| | | v-model="editConfig.infomation.number" |
| | | v-model="editConfig.infomation.wholeDiscount" |
| | | size="mini" |
| | | placeholder="请填写" |
| | | ></el-input> |
| | |
| | | <div class="table-bottom-l"> |
| | | <el-form-item label="调整" prop="member_id"> |
| | | <el-select |
| | | v-model="editConfig.infomation.fieldName" |
| | | v-model="editConfig.infomation.priceAdjustmentType" |
| | | placeholder="请选择" |
| | | filterable |
| | | > |
| | |
| | | <div class="table-bottom-r"> |
| | | <el-form-item label="" prop="member_id"> |
| | | <el-input |
| | | v-model="editConfig.infomation.number" |
| | | v-model="editConfig.infomation.priceAdjustment" |
| | | size="mini" |
| | | placeholder="请填写" |
| | | ></el-input> |
| | |
| | | </div> |
| | | <div class="table-bottom-item"> |
| | | <div class="table-bottom-l">合计</div> |
| | | <div class="table-bottom-r">26000.00</div> |
| | | <div class="table-bottom-r">{{ editConfig.infomation.realTotalPrice }}</div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | ref="editDialog" |
| | | @sucessSet="handleGetBomKindDictList" |
| | | @handleConfirmSave="handleConfirmSave" |
| | | :editRow="editRow" |
| | | :workList="plcBrandList" |
| | | title="采购类型" |
| | | ></BomDialog> |
| | |
| | | import { |
| | | addPurchase, |
| | | updatePurchase, |
| | | savePurchaseType, |
| | | getPurchaseType, |
| | | } from "@/api/purchaseManage/purchase"; |
| | | // import { |
| | | // postGetUnitDictList, |
| | | // postGetSaveSUnitDict, |
| | | // } from "@/api/purchaseManage/purchase"; |
| | | |
| | | import SelectSupplierDialog from "@/views/purchaseManage/purchase/components/SelectSupplierDialog"; |
| | | export default { |
| | | name: "QuotationDialog", |
| | |
| | | return { |
| | | editConfig: this.editCommonConfig, |
| | | rules: { |
| | | purchaseTypeId:[{ required: true, message: "请选择", trigger: "change" }], |
| | | supplierName: [{ required: true, message: "请选择", trigger: "change" }], |
| | | phone: [ |
| | | { |
| | |
| | | trigger: "change", |
| | | }, |
| | | { validator: this.validatorPhone, trigger: "change" }, |
| | | ], |
| | | wholeDiscount: [ |
| | | { |
| | | required: false, |
| | | message: "请填写", |
| | | trigger: "change", |
| | | }, |
| | | { validator: this.validatorNum, trigger: "change" }, |
| | | ], |
| | | priceAdjustment: [ |
| | | { |
| | | required: false, |
| | | message: "请填写", |
| | | trigger: "change", |
| | | }, |
| | | { validator: this.validatorNumThree, trigger: "change" }, |
| | | ], |
| | | }, |
| | | productTableList: {}, |
| | |
| | | isNoProduct: true, |
| | | clientList: [], |
| | | plcBrandList:[], |
| | | editRow:{ |
| | | isDefault:'pin' |
| | | } |
| | | }; |
| | | }, |
| | | created() { |
| | |
| | | 'editCommonConfig.visible':{ |
| | | immediate:true, |
| | | handler:function(){ |
| | | |
| | | this.setTableForm(); |
| | | } |
| | | } |
| | | }, |
| | | methods: { |
| | | validatorNum(rule, value, callback) { |
| | | if (value) { |
| | | if (value == undefined || value == null) { |
| | | callback(new Error("请输入有效数字")); |
| | | } else { |
| | | var reg = /^\+?[0-9]\d*$/; |
| | | if (!reg.test(value)) { |
| | | callback(new Error("请填写不小于0的数字")); |
| | | } else { |
| | | callback(); |
| | | } |
| | | } |
| | | } else { |
| | | callback(); |
| | | } |
| | | }, |
| | | validatorNumThree(rule, value, callback){ |
| | | if(value){ |
| | | if(value==undefined||value==null){ |
| | | callback(new Error("请输入有效数字")); |
| | | }else{ |
| | | let reg2=/(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/ |
| | | if(!reg2.test(value)){ |
| | | callback(new Error('请填写2位小数的数字')) |
| | | }else{ |
| | | callback() |
| | | } |
| | | } |
| | | }else{ |
| | | callback() |
| | | } |
| | | }, |
| | | // PLC配置设置 |
| | | handleShow() { |
| | | // this.handleGetBomKindDictList(); |
| | | this.handleGetBomKindDictList(); |
| | | this.$refs.editDialog.editDialogVisible = true; |
| | | }, |
| | | // PLC配置 |
| | | handleGetBomKindDictList(val) { |
| | | console.log(val,'val') |
| | | // postGetUnitDictList().then((res) => { |
| | | // this.plcBrandList = res.data; |
| | | // if (val) { |
| | | // for (let i in this.plcBrandList) { |
| | | // if (this.plcBrandList[i].isDefault) { |
| | | // this.form.unit = this.form.unit |
| | | // ? this.form.unit |
| | | // : this.plcBrandList[i].name; |
| | | // this.$set(this.form, "unit", this.form.unit); |
| | | // break; |
| | | // } |
| | | // } |
| | | // } |
| | | // }); |
| | | getPurchaseType().then((res) => { |
| | | this.plcBrandList = res.data; |
| | | if (val) { |
| | | for (let i in this.plcBrandList) { |
| | | if (this.plcBrandList[i][this.editRow.isDefault]) { |
| | | this.editConfig.infomation.purchaseTypeId = this.editConfig.infomation.purchaseTypeId |
| | | ? this.editConfig.infomation.purchaseTypeId |
| | | : this.plcBrandList[i].ID; |
| | | this.$set(this.editConfig.infomation, "purchaseTypeId", this.editConfig.infomation.purchaseTypeId); |
| | | |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | }); |
| | | }, |
| | | handleConfirmSave(data) { |
| | | console.log(data,'data') |
| | | // postGetSaveSUnitDict({ data: data }).then((res) => { |
| | | // if (res.code == 200) { |
| | | // this.$message({ |
| | | // message: "操作成功!", |
| | | // type: "success", |
| | | // }); |
| | | // this.$refs.editDialog.editDialogVisible = false; |
| | | // this.handleGetBomKindDictList(); |
| | | // } |
| | | // }); |
| | | savePurchaseType(data).then((res) => { |
| | | if (res.code == 200) { |
| | | this.$message({ |
| | | message: "操作成功!", |
| | | type: "success", |
| | | }); |
| | | this.$refs.editDialog.editDialogVisible = false; |
| | | this.handleGetBomKindDictList(true); |
| | | } |
| | | }); |
| | | }, |
| | | validatorPhone(rule, value, callback) { |
| | | if (value) { |
| | |
| | | }); |
| | | }, |
| | | saveParams() { |
| | | debugger |
| | | let data =JSON.parse(JSON.stringify(this.editConfig.infomation)); |
| | | let params = { |
| | | productList:this.tableData, |
| | |
| | | supplierId:this.supplierId||0, |
| | | signingDate:data.signingDate||'', |
| | | remark:data.remark, |
| | | purchaseTypeId:this.purchaseTypeId||0, |
| | | orderSource:data.orderSource||'', |
| | | purchaseTypeId:data.purchaseTypeId||0, |
| | | phone:data.phone||'', |
| | | name:data.name||'', |
| | | deliveryDate:data.deliveryDate||'', |
| | | contact:data.contact |
| | | contact:data.contact, |
| | | wholeDiscountType:data.wholeDiscountType, |
| | | wholeDiscount:Number(data.wholeDiscount), |
| | | priceAdjustmentType:data.priceAdjustmentType, |
| | | priceAdjustment:Number(data.priceAdjustment), |
| | | realTotalPrice:data.realTotalPrice||'', |
| | | } |
| | | }; |
| | | if(data.ID){ |
| | |
| | | { |
| | | label: "产品名称", |
| | | prop: "name", |
| | | min: 170, |
| | | productName: true, |
| | | isRequird: true, |
| | | }, |
| | |
| | | { label: "描述", prop: "remark", input: true }, |
| | | ], |
| | | }; |
| | | this.handleGetBomKindDictList(true); |
| | | }, |
| | | // 产品列表输入 |
| | | inputContent(val, prop, row) { |