Browse Source

修改供应商页面

dev
caoyizhong 2 years ago
parent
commit
784509796f
  1. 7
      src/views/supplier/ProcessSupplierList.vue
  2. 45
      src/views/supplier/modules/ProcessSupplierForm.vue
  3. 2
      src/views/supplier/modules/ProcessSupplierModal.vue

7
src/views/supplier/ProcessSupplierList.vue

@ -85,12 +85,13 @@
<a @click="handleEdit(record)">编辑</a> <a @click="handleEdit(record)">编辑</a>
<a-divider type="vertical" /> <a-divider type="vertical" />
<!-- <a @click="handleDelete(record.id)">删除</a>-->
<a-dropdown> <a-dropdown>
<a class="ant-dropdown-link">更多 <a-icon type="down" /></a> <a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
<a-menu slot="overlay"> <a-menu slot="overlay">
<a-menu-item> <!-- <a-menu-item>-->
<a @click="handleDetail(record)">详情</a> <!-- <a @click="handleDetail(record)">详情</a>-->
</a-menu-item> <!-- </a-menu-item>-->
<a-menu-item> <a-menu-item>
<a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)"> <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
<a>删除</a> <a>删除</a>

45
src/views/supplier/modules/ProcessSupplierForm.vue

@ -15,19 +15,20 @@
</a-col> </a-col>
<a-col :span="8"> <a-col :span="8">
<a-form-item label="级别" :labelCol="labelCol" :wrapperCol="wrapperCol"> <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-form-item>
</a-col> </a-col>
<a-col :span="8"> <a-col :span="8">
<a-form-item label="状态" :labelCol="labelCol" :wrapperCol="wrapperCol"> <a-form-item label="状态" :labelCol="labelCol" :wrapperCol="wrapperCol">
<j-dict-select-tag type="list" v-decorator="['state']" :trigger-change="true" dictCode="status" placeholder="请选择状态" /> <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-form-item>
</a-col> </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-col v-if="showFlowSubmitButton" :span="24" style="text-align: center">
<a-button @click="submitForm"> </a-button> <a-button @click="submitForm"> </a-button>
</a-col> </a-col>
@ -121,9 +122,26 @@
this.edit({}); this.edit({});
}, },
edit (record) { edit (record) {
console.log(record);
let dis = false;
if(record.state !== undefined ){
dis =true;
}
this.form.resetFields(); this.form.resetFields();
this.model = Object.assign({}, record); this.model = Object.assign({}, record);
this.visible = true; 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.$nextTick(() => {
this.form.setFieldsValue(pick(this.model,'coding','supplierName','rank','state','delFlag')) this.form.setFieldsValue(pick(this.model,'coding','supplierName','rank','state','delFlag'))
}) })
@ -144,7 +162,7 @@
// //
this.form.validateFields((err, values) => { this.form.validateFields((err, values) => {
if (!err) { if (!err) {
that.confirmLoading = true; // that.confirmLoading = true;
let httpurl = ''; let httpurl = '';
let method = ''; let method = '';
if(!this.model.id){ if(!this.model.id){
@ -155,6 +173,17 @@
method = 'put'; method = 'put';
} }
let formData = Object.assign(this.model, values); 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) console.log("表单提交数据",formData)
httpAction(httpurl,formData,method).then((res)=>{ httpAction(httpurl,formData,method).then((res)=>{
if(res.success){ if(res.success){

2
src/views/supplier/modules/ProcessSupplierModal.vue

@ -23,7 +23,7 @@
data () { data () {
return { return {
title:'', title:'',
width:1024, width:1200,
visible: false, visible: false,
disableSubmit: false disableSubmit: false
} }

Loading…
Cancel
Save