guarantee-lsq 1 year ago
parent
commit
88a045148b

+ 28 - 8
src/views/purchase/purchase-order-page/PurchaseOrderPage.vue

@@ -20,8 +20,8 @@
       </div>
 
       <div class="table-operator" style="margin-bottom: 8px;">
-        <a-button v-if="$auth('purchase-purchase-orders-add')" type="primary" icon="plus" @click="$refs.baseForm.base()">新增计划</a-button>
-        <a-button v-if="$auth('purchase-purchase-orders-add')" style="margin-left: 8px" type="primary" icon="plus" @click="$refs.addSpareForm.base()">新增物料</a-button>
+        <a-button v-if="$auth('purchase-purchase-orders-add')" type="primary" icon="plus" @click="$refs.baseForm.base()">采购计划</a-button>
+<!--        <a-button v-if="$auth('purchase-purchase-orders-add')" style="margin-left: 8px" type="primary" icon="plus" @click="$refs.addSpareForm.base()">新增物料</a-button>-->
         <!-- <a-dropdown v-action:edit v-if="selectedRowKeys.length > 0 && $auth('purchase-purchase-orders-del')">
           <a-menu slot="overlay">
             <a-popconfirm title="是否要删除所选数据?" @confirm="batchDelete()">
@@ -95,6 +95,8 @@ export default {
       visible: true,
       user: this.$store.getters.userInfo,
       dollarExchangeRate: this.$store.getters.rmbRate,
+      cptcodeMap: {},
+      cbustypeMap: {},
       // 表头
       columns: [
         {
@@ -108,13 +110,13 @@ export default {
         },
 
         {
-          title: '采购名称',
+          title: '计划名称',
           dataIndex: 'orderName',
           checked: true,
           width: 150
         },
         {
-          title: '采购计划类型',
+          title: '计划类型',
           dataIndex: 'type',
           checked: true,
           width: 100,
@@ -122,9 +124,26 @@ export default {
             return this.BaseTool.Table.getMapText(this.typeMap, text)
           }
         },
-
         {
-          title: '采购关联设备',
+          title: '采购类型',
+          dataIndex: 'cptcode',
+          checked: true,
+          width: 100,
+          customRender: (text, record, index) => {
+            return this.BaseTool.Table.getMapText(this.cptcodeMap, text)
+          }
+        },
+        {
+          title: '业务类型',
+          dataIndex: 'cbustype',
+          checked: true,
+          width: 100,
+          customRender: (text, record, index) => {
+            return this.BaseTool.Table.getMapText(this.cbustypeMap, text)
+          }
+        },
+        {
+          title: '关联设备',
           dataIndex: 'positionNo',
           checked: true,
           width: 150
@@ -148,7 +167,7 @@ export default {
           width: 150
         },
         {
-          title: '备注',
+          title: '计划备注',
           checked: true,
           width: 100,
           dataIndex: 'remark'
@@ -205,7 +224,8 @@ export default {
     // 下拉框map
     this.typeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.LONG_YAN_PURCHASE_TYPE)
     this.statusMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.LONG_YAN_PURCHASE_ORDER_STATUS)
-    console.log(this.statusMap)
+    this.cptcodeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.LONG_YAN_PURCHASE_ORDER_PLAN_TYPE)
+    this.cbustypeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.LONG_YAN_PURCHASE_BUSINESS_TYPE)
     this.tableOption()
   },
   methods: {

+ 29 - 29
src/views/purchase/purchase-order-page/modules/BaseForm.vue

@@ -23,7 +23,7 @@
         <a-row type="flex">
           <a-col :sm="20" >
             <a-form-item
-              label="采购计划名称"
+              label="计划名称"
               :labelCol="BaseTool.Constant.labelCol"
               :wrapperCol="BaseTool.Constant.wrapperCol"
             >
@@ -32,7 +32,7 @@
           </a-col>
           <a-col :sm="20" >
             <a-form-item
-              label="采购计划类型"
+              label="计划类型"
               :labelCol="BaseTool.Constant.labelCol"
               :wrapperCol="BaseTool.Constant.wrapperCol"
             >
@@ -48,29 +48,23 @@
           </a-col>
           <a-col :sm="20" >
             <a-form-item
-              label="采购类型"
+              label="计划备注"
               :labelCol="BaseTool.Constant.labelCol"
               :wrapperCol="BaseTool.Constant.wrapperCol"
             >
-              <a-select v-decorator="['cptcode', { rules: [{required: true, message: '采购类型不能为空'}]}]" placeholder="请选择">
-                <a-select-option
-                  v-for="(label,value) in cptcodeMap"
-                  :key="value"
-                  :label="label"
-                  :value="parseInt(value)">{{ label }}
-                </a-select-option>
-              </a-select>
+              <a-input
+                v-decorator="['remark']"/>
             </a-form-item>
           </a-col>
           <a-col :sm="20" >
             <a-form-item
-              label="厂区"
+              label="采购类型"
               :labelCol="BaseTool.Constant.labelCol"
               :wrapperCol="BaseTool.Constant.wrapperCol"
             >
-              <a-select :disabled="title==='编辑'" v-decorator="['oldOrNew', {rules: [{required: true, message: '厂区不能为空'}]}]" @change="setTree">
+              <a-select v-decorator="['cptcode', { rules: [{required: true, message: '采购类型不能为空'}]}]" placeholder="请选择">
                 <a-select-option
-                  v-for="(label,value) in flagMap"
+                  v-for="(label,value) in cptcodeMap"
                   :key="value"
                   :label="label"
                   :value="parseInt(value)">{{ label }}
@@ -80,13 +74,13 @@
           </a-col>
           <a-col :sm="20" >
             <a-form-item
-              label="生产部门"
+              label="业务类型"
               :labelCol="BaseTool.Constant.labelCol"
               :wrapperCol="BaseTool.Constant.wrapperCol"
             >
-              <a-select v-decorator="['cdepcode', {rules: [{required: true, message: '厂区不能为空'}]}]" placeholder="请选择">
+              <a-select v-decorator="['cbustype', {rules: [{required: true, message: '业务类型不能为空'}]}]" placeholder="请选择">
                 <a-select-option
-                  v-for="(label,value) in deptMap"
+                  v-for="(label,value) in cbustypeMap"
                   :key="value"
                   :label="label"
                   :value="parseInt(value)">{{ label }}
@@ -96,13 +90,13 @@
           </a-col>
           <a-col :sm="20" >
             <a-form-item
-              label="业务类型"
+              label="采购厂区"
               :labelCol="BaseTool.Constant.labelCol"
               :wrapperCol="BaseTool.Constant.wrapperCol"
             >
-              <a-select v-decorator="['cbustype', {rules: [{required: true, message: '业务类型不能为空'}]}]" placeholder="请选择">
+              <a-select :disabled="title==='编辑'" v-decorator="['oldOrNew', {rules: [{required: true, message: '厂区不能为空'}]}]" @change="setTree">
                 <a-select-option
-                  v-for="(label,value) in cbustypeMap"
+                  v-for="(label,value) in flagMap"
                   :key="value"
                   :label="label"
                   :value="parseInt(value)">{{ label }}
@@ -112,16 +106,16 @@
           </a-col>
           <a-col :sm="20" >
             <a-form-item
-              label="项目"
+              label="申请部门"
               :labelCol="BaseTool.Constant.labelCol"
               :wrapperCol="BaseTool.Constant.wrapperCol"
             >
-              <a-select v-decorator="['projectId']" placeholder="请选择">
+              <a-select v-decorator="['cdepcode', {rules: [{required: true, message: '厂区不能为空'}]}]" placeholder="请选择">
                 <a-select-option
-                  v-for="{name,id} in treeData"
-                  :key="id"
-                  :label="name"
-                  :value="id">{{ name }}
+                  v-for="(label,value) in deptMap"
+                  :key="value"
+                  :label="label"
+                  :value="parseInt(value)">{{ label }}
                 </a-select-option>
               </a-select>
             </a-form-item>
@@ -141,12 +135,18 @@
           </a-col>
           <a-col :sm="20" >
             <a-form-item
-              label="备注"
+              label="关联项目"
               :labelCol="BaseTool.Constant.labelCol"
               :wrapperCol="BaseTool.Constant.wrapperCol"
             >
-              <a-input
-                v-decorator="['remark']"/>
+              <a-select v-decorator="['projectId']" placeholder="请选择">
+                <a-select-option
+                  v-for="{name,id} in treeData"
+                  :key="id"
+                  :label="name"
+                  :value="id">{{ name }}
+                </a-select-option>
+              </a-select>
             </a-form-item>
           </a-col>
         </a-row>