|
|
|
@ -15,19 +15,20 @@
|
|
|
|
|
</a-col> |
|
|
|
|
<a-col :span="8"> |
|
|
|
|
<a-form-item label="级别" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
|
|
|
|
<a-input-number v-decorator="['rank']" placeholder="请输入级别" style="width: 100%" /> |
|
|
|
|
<!-- <a-input-number v-decorator="['rank']" placeholder="请输入级别" style="width: 100%" />--> |
|
|
|
|
<j-dict-select-tag type="list" v-decorator="['rank']" :trigger-change="true" placeholder="请输入级别" dictCode="supplier_type" /> |
|
|
|
|
</a-form-item> |
|
|
|
|
</a-col> |
|
|
|
|
<a-col :span="8"> |
|
|
|
|
<a-form-item label="状态" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
|
|
|
|
<j-dict-select-tag type="list" v-decorator="['state']" :trigger-change="true" dictCode="status" placeholder="请选择状态" /> |
|
|
|
|
</a-form-item> |
|
|
|
|
</a-col> |
|
|
|
|
<a-col :span="8"> |
|
|
|
|
<a-form-item label="删除标志" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
|
|
|
|
<a-input-number v-decorator="['delFlag']" placeholder="请输入删除标志" style="width: 100%" /> |
|
|
|
|
<j-dict-select-tag type="list" v-decorator="['state']" :trigger-change="true" dictCode="supplier_state" placeholder="请选择状态" /> |
|
|
|
|
</a-form-item> |
|
|
|
|
</a-col> |
|
|
|
|
<!-- <a-col :span="8">--> |
|
|
|
|
<!-- <a-form-item label="删除标志" :labelCol="labelCol" :wrapperCol="wrapperCol">--> |
|
|
|
|
<!-- <a-input-number v-decorator="['delFlag']" placeholder="请输入删除标志" style="width: 100%" />--> |
|
|
|
|
<!-- </a-form-item>--> |
|
|
|
|
<!-- </a-col>--> |
|
|
|
|
<a-col v-if="showFlowSubmitButton" :span="24" style="text-align: center"> |
|
|
|
|
<a-button @click="submitForm">提 交</a-button> |
|
|
|
|
</a-col> |
|
|
|
@ -121,9 +122,26 @@
|
|
|
|
|
this.edit({}); |
|
|
|
|
}, |
|
|
|
|
edit (record) { |
|
|
|
|
console.log(record); |
|
|
|
|
let dis = false; |
|
|
|
|
if(record.state !== undefined ){ |
|
|
|
|
dis =true; |
|
|
|
|
} |
|
|
|
|
this.form.resetFields(); |
|
|
|
|
this.model = Object.assign({}, record); |
|
|
|
|
this.visible = true; |
|
|
|
|
if(dis){ |
|
|
|
|
if(record.state === 0){ |
|
|
|
|
record.state = "正常"; |
|
|
|
|
}else{ |
|
|
|
|
record.state = "停用" |
|
|
|
|
} |
|
|
|
|
if(record.rank === 0){ |
|
|
|
|
record.rank = "一级物资供应商"; |
|
|
|
|
}else{ |
|
|
|
|
record.rank = "非集中采购物资供应商" |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
this.$nextTick(() => { |
|
|
|
|
this.form.setFieldsValue(pick(this.model,'coding','supplierName','rank','state','delFlag')) |
|
|
|
|
}) |
|
|
|
@ -144,7 +162,7 @@
|
|
|
|
|
// 触发表单验证 |
|
|
|
|
this.form.validateFields((err, values) => { |
|
|
|
|
if (!err) { |
|
|
|
|
that.confirmLoading = true; |
|
|
|
|
// that.confirmLoading = true; |
|
|
|
|
let httpurl = ''; |
|
|
|
|
let method = ''; |
|
|
|
|
if(!this.model.id){ |
|
|
|
@ -155,6 +173,17 @@
|
|
|
|
|
method = 'put'; |
|
|
|
|
} |
|
|
|
|
let formData = Object.assign(this.model, values); |
|
|
|
|
console.log(formData); |
|
|
|
|
if(formData.state === "正常"){ |
|
|
|
|
formData.state = "0"; |
|
|
|
|
}else if(formData.state === "冻结"){ |
|
|
|
|
formData.state = "1" |
|
|
|
|
} |
|
|
|
|
if(formData.rank === "一级物资供应商"){ |
|
|
|
|
formData.rank = "0"; |
|
|
|
|
}else if(formData.rank === "非集中采购物资供应商"){ |
|
|
|
|
formData.rank = "1" |
|
|
|
|
} |
|
|
|
|
console.log("表单提交数据",formData) |
|
|
|
|
httpAction(httpurl,formData,method).then((res)=>{ |
|
|
|
|
if(res.success){ |
|
|
|
|