whj hai 1 ano
pai
achega
2b6720b01e

+ 2 - 1
src/utils/dict.js

@@ -326,7 +326,8 @@ DictCache.TYPE = {
   CHECK_LEVEL: 'CHECK_LEVEL',
   HIDDEN_DANGER_STATUS: 'HIDDEN_DANGER_STATUS',
   SB_CHANGE_LOG_TYPE: 'SB_CHANGE_LOG_TYPE',
-  CHECK_TYPE: 'CHECK_TYPE' // 强检
+  CHECK_TYPE: 'CHECK_TYPE', // 强检,
+  PROJECT_NEW_AND_OLD: 'PROJECT_NEW_AND_OLD' // 厂区
 }
 DictCache.CODE = {
 

+ 9 - 0
src/views/project/Project.vue

@@ -101,6 +101,7 @@ export default {
       treeData: [],
       typeMap: {},
       delFlagMap: {},
+      flagMap: {},
       // 表头
       columns: [
         {
@@ -118,6 +119,13 @@ export default {
           title: '编码',
           dataIndex: 'no'
         },
+        {
+          title: '厂区',
+          dataIndex: 'flag',
+          customRender: (text, record, index) => {
+            return this.BaseTool.Object.getField(this.flagMap, text)
+          }
+        },
         {
           title: '首字母',
           dataIndex: 'szm'
@@ -172,6 +180,7 @@ export default {
   created () {
     this.tableOption()
     this.delFlagMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.DELFLAG)
+    this.flagMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.PROJECT_NEW_AND_OLD)
     this.typeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SBTYPE_TYPE)
   },
   methods: {

+ 18 - 0
src/views/project/modules/BaseForm.vue

@@ -42,6 +42,20 @@
           </a-select-option>
         </a-select>
       </a-form-item>
+      <a-form-item
+        label="厂区"
+        :labelCol="BaseTool.Constant.labelCol"
+        :wrapperCol="BaseTool.Constant.wrapperCol"
+      >
+        <a-select v-decorator="['flag', {rules: [{required: true, message: '厂区不能为空'}]}]" placeholder="请选择">
+          <a-select-option
+            v-for="(label,value) in flagMap"
+            :key="value"
+            :label="label"
+            :value="parseInt(value)">{{ label }}
+          </a-select-option>
+        </a-select>
+      </a-form-item>
       <a-form-item
         label="首字母"
         :labelCol="BaseTool.Constant.labelCol"
@@ -118,6 +132,7 @@ export default {
       visible: false,
       typeMap: {},
       delFlagMap: {},
+      flagMap: {},
       typeName: '',
       treeData: [],
       isShowParent: true
@@ -128,6 +143,8 @@ export default {
   created () {
     this.setTree()
     this.delFlagMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.DELFLAG)
+    this.flagMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.PROJECT_NEW_AND_OLD)
+    console.log(this.flagMap)
     this.typeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SBTYPE_TYPE)
   },
   methods: {
@@ -151,6 +168,7 @@ export default {
           'name',
           'type',
           'sort',
+          'flag',
           'delFlag',
           'parentId',
           'remark'

+ 25 - 24
src/views/store/outstoreform/modules/BaseFormYY.vue

@@ -146,18 +146,18 @@
         <!--        >-->
         <a-col :lg="12" :md="24" :sm="24">
           <a-form-item
-            label="项目:"
+            label="厂区"
             :labelCol="BaseTool.Constant.labelCol"
             :wrapperCol="BaseTool.Constant.wrapperCol"
           >
-            <a-tree-select
-              style="width: 100%"
-              :dropdownStyle="{ maxHeight: '400px', overflow: 'auto' }"
-              :treeData="treeData"
-              v-decorator="['projectId']"
-              placeholder="请选择"
-            >
-            </a-tree-select>
+            <a-select v-model="tokenType" placeholder="请选择" @change="setTree">
+              <a-select-option
+                v-for="(label,value) in flagMap"
+                :key="value"
+                :label="label"
+                :value="parseInt(value)">{{ label }}
+              </a-select-option>
+            </a-select>
           </a-form-item>
         </a-col>
         <a-col :lg="12" :md="24" :sm="24">
@@ -174,23 +174,20 @@
 
         <a-col :lg="12" :md="24" :sm="24">
           <a-form-item
-            label="厂区"
+            label="项目:"
             :labelCol="BaseTool.Constant.labelCol"
             :wrapperCol="BaseTool.Constant.wrapperCol"
           >
-            <a-select v-model="tokenType" placeholder="请选择">
-              <a-select-option
-                :key="1"
-                label="新厂"
-                :value="1">新厂
-              </a-select-option>
-              <a-select-option
-                :key="2"
-                label="老厂"
-                :value="2">老厂
-              </a-select-option>
-            </a-select>
+            <a-tree-select
+              style="width: 100%"
+              :dropdownStyle="{ maxHeight: '400px', overflow: 'auto' }"
+              :treeData="treeData"
+              v-decorator="['projectId']"
+              placeholder="请选择"
+            >
+            </a-tree-select>
           </a-form-item>
+
           <a-form-item
             label="部门"
             :labelCol="BaseTool.Constant.labelCol"
@@ -301,6 +298,7 @@ export default {
       sbPositionList: [],
       feeFromMap: {},
       lyDeptMap: {},
+      flagMap: {},
       sdDeptMap: {},
       storeId: null,
       treeData: [],
@@ -396,6 +394,7 @@ export default {
     this.feeFromMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.FEE_FORM_TYPE)
     this.lyDeptMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.DEPT_TYPE_LY)
     this.sdDeptMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.DEPT_TYPE_SD)
+    this.flagMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.PROJECT_NEW_AND_OLD)
     console.log(this.lyDeptMap)
     console.log(this.sdDeptMap)
     this.deptYYMap = this.DictCache.getChildrenList(this.DictCache.TYPE.OUT_STORE_FORM_DEPT_CODE).map(item => {
@@ -466,8 +465,10 @@ export default {
       })
       this.data = record.detailList
     },
-    setTree (record = {}) {
-      fetchSbTypeTree().then((res) => {
+    setTree () {
+      fetchSbTypeTree({
+        flag: this.tokenType
+      }).then((res) => {
         this.treeData = res.data.map(item => {
           item.selectable = item.children == null
           return item