|
|
|
@ -5,14 +5,14 @@
|
|
|
|
|
<a-row> |
|
|
|
|
<a-col :span="8"> |
|
|
|
|
<a-form-item label="商品名称" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
|
|
|
|
<a-input v-decorator="['merchandiseName']" placeholder="请输入商品名称" ></a-input> |
|
|
|
|
<a-input v-decorator="['merchandiseName',validatorRules.merchandiseName]" placeholder="请输入商品名称" ></a-input> |
|
|
|
|
</a-form-item> |
|
|
|
|
</a-col> |
|
|
|
|
<a-col :span="8"> |
|
|
|
|
<a-form-item label="供应商" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
|
|
|
|
<!-- <a-input v-decorator="['supplierId']" placeholder="请输入供应商" ></a-input>--> |
|
|
|
|
<a-auto-complete |
|
|
|
|
v-decorator="['supplierId']" |
|
|
|
|
v-decorator="['supplierId',validatorRules.supplierId]" |
|
|
|
|
:data-source="bigId" |
|
|
|
|
placeholder="请选择" |
|
|
|
|
@select="onSelectSupplier" |
|
|
|
@ -22,14 +22,14 @@
|
|
|
|
|
</a-col> |
|
|
|
|
<a-col :span="8"> |
|
|
|
|
<a-form-item label="第三方商品编号" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
|
|
|
|
<a-input v-decorator="['partyNumber']" placeholder="请输入第三方商品编号" ></a-input> |
|
|
|
|
<a-input v-decorator="['partyNumber',validatorRules.partyNumber]" placeholder="请输入第三方商品编号" ></a-input> |
|
|
|
|
</a-form-item> |
|
|
|
|
</a-col> |
|
|
|
|
<a-col :span="8"> |
|
|
|
|
<a-form-item label="品名分类" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
|
|
|
|
<!-- <a-input v-decorator="['descriptionId']" placeholder="请输入品名编号ID" ></a-input>--> |
|
|
|
|
<a-auto-complete |
|
|
|
|
v-decorator="['descriptionId']" |
|
|
|
|
v-decorator="['descriptionId',validatorRules.descriptionId]" |
|
|
|
|
:data-source="bigIdRake" |
|
|
|
|
placeholder="请选择" |
|
|
|
|
@select="onSelectRake" |
|
|
|
@ -39,12 +39,12 @@
|
|
|
|
|
</a-col> |
|
|
|
|
<a-col :span="8"> |
|
|
|
|
<a-form-item label="物资编号" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
|
|
|
|
<a-input v-decorator="['materialsNumber']" placeholder="请输入物资编号" ></a-input> |
|
|
|
|
<a-input v-decorator="['materialsNumber',validatorRules.materialsNumber]" placeholder="请输入物资编号" ></a-input> |
|
|
|
|
</a-form-item> |
|
|
|
|
</a-col> |
|
|
|
|
<a-col :span="8"> |
|
|
|
|
<a-form-item label="物资单位" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
|
|
|
|
<a-input v-decorator="['materialsUnit']" placeholder="请输入物资单位" ></a-input> |
|
|
|
|
<a-input v-decorator="['materialsUnit',validatorRules.materialsUnit]" placeholder="请输入物资单位" ></a-input> |
|
|
|
|
</a-form-item> |
|
|
|
|
</a-col> |
|
|
|
|
<a-col :span="8"> |
|
|
|
@ -62,6 +62,24 @@
|
|
|
|
|
<a-input v-decorator="['synopsis']" placeholder="请输入简介概要" ></a-input> |
|
|
|
|
</a-form-item> |
|
|
|
|
</a-col> |
|
|
|
|
<a-col :span="8"> |
|
|
|
|
<a-form-item label="归口部门" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
|
|
|
|
<!-- <a-input placeholder="供应商" v-model="queryParam.materialsUnit"></a-input>--> |
|
|
|
|
<a-select v-decorator="['materialDepart',validatorRules.materialDepart]" placeholder="请选择"> |
|
|
|
|
<a-select-option v-for="(item,index) in bigIds" :key="index" :value="item.materialDepart">{{item.materialDepart}}</a-select-option> |
|
|
|
|
</a-select> |
|
|
|
|
|
|
|
|
|
</a-form-item> |
|
|
|
|
</a-col> |
|
|
|
|
<a-col :span="8"> |
|
|
|
|
<a-form-item label="物资类型" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
|
|
|
|
<!-- <a-input placeholder="供应商" v-model="queryParam.materialsUnit"></a-input>--> |
|
|
|
|
<j-dict-select-tag type="list" v-decorator="['materialType',validatorRules.materialType]" |
|
|
|
|
:trigger-change="true" dictCode="material_type" |
|
|
|
|
placeholder="请选择物资类型" /> |
|
|
|
|
</a-form-item> |
|
|
|
|
</a-col> |
|
|
|
|
|
|
|
|
|
<!-- <a-col :span="8">--> |
|
|
|
|
<!-- <a-form-item label="分类" :labelCol="labelCol" :wrapperCol="wrapperCol">--> |
|
|
|
|
<!-- <a-input-number v-decorator="['classify']" placeholder="请输入分类" style="width: 100%" />--> |
|
|
|
@ -111,12 +129,16 @@
|
|
|
|
|
data () { |
|
|
|
|
return { |
|
|
|
|
bigId:[], |
|
|
|
|
bigIder:[], |
|
|
|
|
bigIds:[], |
|
|
|
|
bigIdser:[], |
|
|
|
|
bigIdRake:[], |
|
|
|
|
bigIdRaker:[], |
|
|
|
|
form: this.$form.createForm(this), |
|
|
|
|
model: {}, |
|
|
|
|
labelCol: { |
|
|
|
|
xs: { span: 24 }, |
|
|
|
|
sm: { span: 5 }, |
|
|
|
|
sm: { span: 6 }, |
|
|
|
|
}, |
|
|
|
|
wrapperCol: { |
|
|
|
|
xs: { span: 24 }, |
|
|
|
@ -124,6 +146,15 @@
|
|
|
|
|
}, |
|
|
|
|
confirmLoading: false, |
|
|
|
|
validatorRules: { |
|
|
|
|
materialType: { rules: [{ required: true, message: '请选择物资类型!' }] }, |
|
|
|
|
merchandiseName: { rules: [{ required: true, message: '请输入物资名称!' }] }, |
|
|
|
|
supplierId: { rules: [{ required: true, message: '请输入供应商!' }] }, |
|
|
|
|
partyNumber: { rules: [{ required: true, message: '请输入第三方编号!' }] }, |
|
|
|
|
descriptionId: { rules: [{ required: true, message: '请选择品类类型!' }] }, |
|
|
|
|
materialsNumber: { rules: [{ required: true, message: '请输入物资编码!' }] }, |
|
|
|
|
materialsUnit: { rules: [{ required: true, message: '请输入物资单位!' }] }, |
|
|
|
|
materialDepart: { rules: [{ required: true, message: '请选择归口部门!' }] }, |
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
url: { |
|
|
|
|
add: "/merchandisenews/processMerchandiseNews/add", |
|
|
|
@ -131,6 +162,7 @@
|
|
|
|
|
queryById: "/merchandisenews/processMerchandiseNews/queryById", |
|
|
|
|
supplierId: "/supplier/processSupplier/list", |
|
|
|
|
descriptionRake: "/description/processDescription/list", |
|
|
|
|
getMaterialDepart: "/merchandisenews/processMerchandiseNews/getMaterialDepart" |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
@ -177,6 +209,9 @@
|
|
|
|
|
pageSize: 100 |
|
|
|
|
} |
|
|
|
|
this.bigId = []; |
|
|
|
|
this.bigIdr = []; |
|
|
|
|
this.bigIds = []; |
|
|
|
|
this.bigIdser = []; |
|
|
|
|
getAction(this.url.supplierId,par).then((res)=>{ |
|
|
|
|
if(res.success){ |
|
|
|
|
// console.log(res.result.records); |
|
|
|
@ -184,8 +219,20 @@
|
|
|
|
|
res.result.records.forEach( item => { |
|
|
|
|
this.bigId.push(item.supplierName); |
|
|
|
|
}) |
|
|
|
|
this.bigIder = res.result.records; |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
getAction(this.url.getMaterialDepart,par).then((res)=>{ |
|
|
|
|
if(res.success){ |
|
|
|
|
// console.log(res.result,"==================="); |
|
|
|
|
// this.bigId = res.result.records; |
|
|
|
|
res.result.forEach( item => { |
|
|
|
|
this.bigIds.push(item); |
|
|
|
|
}) |
|
|
|
|
this.bigIdser = res.result; |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
onSearchRake(searchText) { |
|
|
|
|
console.log(searchText) |
|
|
|
@ -199,10 +246,11 @@
|
|
|
|
|
//查询大品类数据 |
|
|
|
|
let par = { |
|
|
|
|
delFlag: 0, |
|
|
|
|
descriptionName: value, |
|
|
|
|
materialClassify: value, |
|
|
|
|
pageSize: 100 |
|
|
|
|
} |
|
|
|
|
this.bigIdRake = []; |
|
|
|
|
this.bigIdRaker = []; |
|
|
|
|
getAction(this.url.descriptionRake,par).then((res)=>{ |
|
|
|
|
if(res.success){ |
|
|
|
|
console.log(res.result); |
|
|
|
@ -210,6 +258,7 @@
|
|
|
|
|
res.result.records.forEach( item => { |
|
|
|
|
this.bigIdRake.push(item.materialClassify); |
|
|
|
|
}) |
|
|
|
|
this.bigIdRaker = res.result.records; |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
@ -222,7 +271,7 @@
|
|
|
|
|
this.model = Object.assign({}, record); |
|
|
|
|
this.visible = true; |
|
|
|
|
this.$nextTick(() => { |
|
|
|
|
this.form.setFieldsValue(pick(this.model,'merchandiseName','supplierId','partyNumber','descriptionId','materialsNumber','materialsUnit','type','specification','synopsis','classify')) |
|
|
|
|
this.form.setFieldsValue(pick(this.model,'merchandiseName','supplierId','partyNumber','descriptionId','materialsNumber','materialsUnit','type','specification','synopsis','classify','materialDepart','materialType')) |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
//渲染流程表单数据 |
|
|
|
@ -241,7 +290,7 @@
|
|
|
|
|
// 触发表单验证 |
|
|
|
|
this.form.validateFields((err, values) => { |
|
|
|
|
if (!err) { |
|
|
|
|
that.confirmLoading = true; |
|
|
|
|
// that.confirmLoading = true; |
|
|
|
|
let httpurl = ''; |
|
|
|
|
let method = ''; |
|
|
|
|
if(!this.model.id){ |
|
|
|
@ -251,6 +300,29 @@
|
|
|
|
|
httpurl+=this.url.edit; |
|
|
|
|
method = 'put'; |
|
|
|
|
} |
|
|
|
|
// console.log("values",values); |
|
|
|
|
// console.log("this.model",this.model); |
|
|
|
|
this.bigIder.forEach(it =>{ |
|
|
|
|
// console.log(it,"this.dig"); |
|
|
|
|
if(values.supplierId === it.supplierName){ |
|
|
|
|
values.supplierId = it.id; |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
let big = false; |
|
|
|
|
this.bigIdRaker.forEach(it =>{ |
|
|
|
|
// console.log(it,"this.bigIdRake"); |
|
|
|
|
if(values.descriptionId === it.materialClassify){ |
|
|
|
|
values.descriptionId = it.id; |
|
|
|
|
big = true; |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
if(!big){ |
|
|
|
|
values.descriptionId = null; |
|
|
|
|
} |
|
|
|
|
let pattern = new RegExp("[\u4E00-\u9FA5]+"); |
|
|
|
|
if(pattern.test(values.materialType)){ |
|
|
|
|
values.materialType = null; |
|
|
|
|
} |
|
|
|
|
let formData = Object.assign(this.model, values); |
|
|
|
|
console.log("表单提交数据",formData) |
|
|
|
|
httpAction(httpurl,formData,method).then((res)=>{ |
|
|
|
@ -268,7 +340,7 @@
|
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
popupCallback(row){ |
|
|
|
|
this.form.setFieldsValue(pick(row,'merchandiseName','supplierId','partyNumber','descriptionId','materialsNumber','materialsUnit','type','specification','synopsis','classify')) |
|
|
|
|
this.form.setFieldsValue(pick(row,'merchandiseName','supplierId','partyNumber','descriptionId','materialsNumber','materialsUnit','type','specification','synopsis','classify','materialDepart','materialType')) |
|
|
|
|
}, |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|