|
|
@ -107,6 +107,33 @@ export default { |
|
|
|
filterSelectMixins, |
|
|
|
newAndEdiDialogMixins |
|
|
|
], |
|
|
|
watch: { |
|
|
|
'CreateFormData.isUsePercent': { |
|
|
|
handler (val) { |
|
|
|
if(val) { |
|
|
|
this.CreateForm.find(item => item.prop == 'samplePercent').min = 1 |
|
|
|
this.CreateFormData.samplePercent = 1 |
|
|
|
} else { |
|
|
|
this.CreateForm.find(item => item.prop == 'samplePercent').min = 0 |
|
|
|
this.CreateFormData.samplePercent = 0 |
|
|
|
} |
|
|
|
}, |
|
|
|
immediate: true |
|
|
|
}, |
|
|
|
'editFormData.isUsePercent': { |
|
|
|
handler (val) { |
|
|
|
if(val) { |
|
|
|
this.editForm.find(item => item.prop == 'samplePercent').min = 1 |
|
|
|
this.editFormData.samplePercent = 1 |
|
|
|
} else { |
|
|
|
this.editForm.find(item => item.prop == 'samplePercent').min = 0 |
|
|
|
this.editFormData.samplePercent = 0 |
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
immediate: false |
|
|
|
}, |
|
|
|
}, |
|
|
|
computed: { |
|
|
|
editDialog: { |
|
|
|
get: function () { |
|
|
@ -167,11 +194,11 @@ export default { |
|
|
|
searchButton: (val) => { this.showSerarchPage(val, 'basedata/Supplier', 'Supplier', '供应商选择', this.CreateFormData) }, colSpan: 12 }, |
|
|
|
{ type: "input", label: "数量下限", prop: "floorQty", validType:'number', colSpan: 12 }, |
|
|
|
{ type: "input", label: "数量上限", prop: "ceilingQty", validType:'number', colSpan: 12 }, |
|
|
|
{ type: "input", label: "抽检百分比%", prop: "samplePercent", validType:'number', colSpan: 12 }, |
|
|
|
{ type: "select", label: "ABC类", prop: "abcClass", options: "abcClass", clearable: true, filterable: true, allowCreate: true, colSpan: 12 }, |
|
|
|
{ type: "input", label: "抽检数量", prop: "sampleQty", validType:'number', colSpan: 12 }, |
|
|
|
{ type: "select", label: "使用百分比", prop: "isUsePercent", options: "whetherOrNot", colSpan: 12 }, |
|
|
|
{ type: "select", label: "ABC类", prop: "abcClass", options: "abcClass", clearable: true, filterable: true, allowCreate: true, colSpan: 12 }, |
|
|
|
{ type: "input", label: "备注", prop: "remark", colSpan: 24 }, |
|
|
|
{ type: "number", label: "抽检百分比%", prop: "samplePercent", validType:'number', colSpan: 12, precision:0, min: 0 ,max:100 }, |
|
|
|
{ type: "input", label: "备注", prop: "remark", colSpan: 12 }, |
|
|
|
], |
|
|
|
editForm: [ |
|
|
|
{ type: "filterSelect", label: "物料代码", prop: "itemCode", optionsLabel: "name", optionsValue: "code", |
|
|
@ -182,35 +209,35 @@ export default { |
|
|
|
searchButton: (val) => { this.showSerarchPage(val, 'basedata/Supplier', 'SupplierBasic', '供应商选择', this.editFormData) }, colSpan: 12 }, |
|
|
|
{ type: "input", label: "数量下限", prop: "floorQty", validType:'number', colSpan: 12 }, |
|
|
|
{ type: "input", label: "数量上限", prop: "ceilingQty", validType:'number', colSpan: 12 }, |
|
|
|
{ type: "input", label: "抽检百分比%", prop: "samplePercent", validType:'number', colSpan: 12 }, |
|
|
|
{ type: "select", label: "ABC类", prop: "abcClass", options: "abcClass", clearable: true, filterable: true, allowCreate: true, colSpan: 12 }, |
|
|
|
{ type: "input", label: "抽检数量", prop: "sampleQty", validType:'number', colSpan: 12 }, |
|
|
|
{ type: "select", label: "使用百分比", prop: "isUsePercent", options: "whetherOrNot", colSpan: 12 }, |
|
|
|
{ type: "select", label: "ABC类", prop: "abcClass", options: "abcClass", clearable: true, filterable: true, allowCreate: true, colSpan: 12 }, |
|
|
|
{ type: "number", label: "抽检百分比%", prop: "samplePercent", validType:'number', colSpan: 12, precision:0, min: 0 ,max:100 }, |
|
|
|
{ type: "input", label: "备注", prop: "remark", colSpan: 12 }, |
|
|
|
], |
|
|
|
editRules: { |
|
|
|
cerateRule: { |
|
|
|
itemCode: [{ required: true, trigger: "change", message: "不可为空" },], |
|
|
|
supplierCode: [{ required: true, trigger: "change", message: "不可为空" }], |
|
|
|
ceilingQty: [{ required: true, trigger: "blur", type: "number", message: "不可为空" }], |
|
|
|
floorQty: [{ required: true, trigger: "blur", type: "number", message: "不可为空" }], |
|
|
|
ceilingQty: [{ required: true, trigger: "blur", message: "不可为空" }], |
|
|
|
floorQty: [{ required: true, trigger: "blur", message: "不可为空" }], |
|
|
|
samplePercent: [ |
|
|
|
{ validator:numberValidate, trigger: "blur"}, |
|
|
|
{ required: true, trigger: "blur",type: "number",message: "不可为空"}, |
|
|
|
// { validator:numberValidate, trigger: "blur"}, |
|
|
|
{ required: true, trigger: "blur",message: "不可为空"}, |
|
|
|
], |
|
|
|
sampleQty: [{ required: true, trigger: "blur", type: "number", message: "不可为空" }], |
|
|
|
sampleQty: [{ required: true, trigger: "blur", message: "不可为空" }], |
|
|
|
isUsePercent: [{ required: true, trigger: "blur", message: "不可为空" }], |
|
|
|
}, |
|
|
|
editRule: { |
|
|
|
itemCode: [{ required: true, trigger: "change", message: "不可为空" },], |
|
|
|
supplierCode: [{ required: true, trigger: "change", message: "不可为空" }], |
|
|
|
ceilingQty: [{ required: true, trigger: "blur", type: "number", message: "不可为空" }], |
|
|
|
floorQty: [{ required: true, trigger: "blur", type: "number", message: "不可为空" }], |
|
|
|
ceilingQty: [{ required: true, trigger: "blur", message: "不可为空" }], |
|
|
|
floorQty: [{ required: true, trigger: "blur", message: "不可为空" }], |
|
|
|
samplePercent: [ |
|
|
|
{ validator:numberValidate, trigger: "blur"}, |
|
|
|
{ required: true, trigger: "blur",type: "number",message: "不可为空"}, |
|
|
|
// { validator:numberValidate, trigger: "blur"}, |
|
|
|
{ required: true, trigger: "blur",message: "不可为空"}, |
|
|
|
], |
|
|
|
sampleQty: [{ required: true, trigger: "blur", type: "number", message: "不可为空" }], |
|
|
|
sampleQty: [{ required: true, trigger: "blur", message: "不可为空" }], |
|
|
|
isUsePercent: [{ required: true, trigger: "blur", message: "不可为空" }], |
|
|
|
} |
|
|
|
}, |
|
|
@ -219,19 +246,6 @@ export default { |
|
|
|
mounted () { |
|
|
|
this.paging(); |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
// changeSelect(prop, val) { |
|
|
|
// if (prop == 'isUsePercent') { |
|
|
|
// if (val) { |
|
|
|
// this.editRules.cerateRule.samplePercent[1].required = true |
|
|
|
// this.editRules.editRule.samplePercent[1].required = true |
|
|
|
// } else { |
|
|
|
// this.editRules.cerateRule.samplePercent[1].required = false |
|
|
|
// this.editRules.editRule.samplePercent[1].required = false |
|
|
|
// } |
|
|
|
// } |
|
|
|
// } |
|
|
|
} |
|
|
|
}; |
|
|
|
</script> |
|
|
|
<style lang="scss" scoped> |
|
|
|