whj 1 vuosi sitten
vanhempi
commit
5d887356fc
1 muutettua tiedostoa jossa 62 lisäystä ja 3 poistoa
  1. 62 3
      src/views/store/sparestore/modules/AddSpareForm.vue

+ 62 - 3
src/views/store/sparestore/modules/AddSpareForm.vue

@@ -79,6 +79,54 @@
             </a-select>
           </a-form-item>
         </row-item>
+        <row-item>
+          <a-form-item
+            label="计划方法"
+            :labelCol="BaseTool.Constant.labelCol"
+            :wrapperCol="BaseTool.Constant.wrapperCol"
+          >
+            <a-select v-decorator="['cestPlanMethod', {rules: [{required: true, message: '计划方法不能为空'}]}]">
+              <a-select-option
+                v-for="(label,value) in planMap"
+                :key="value"
+                :label="label"
+                :value="value">{{ label }}
+              </a-select-option>
+            </a-select>
+          </a-form-item>
+        </row-item>
+        <row-item>
+          <a-form-item
+            label="供需政策"
+            :labelCol="BaseTool.Constant.labelCol"
+            :wrapperCol="BaseTool.Constant.wrapperCol"
+          >
+            <a-select v-decorator="['cestSrpolicy', {rules: [{required: true, message: '供需政策不能为空'}]}]">
+              <a-select-option
+                v-for="(label,value) in policyMap"
+                :key="value"
+                :label="label"
+                :value="value">{{ label }}
+              </a-select-option>
+            </a-select>
+          </a-form-item>
+        </row-item>
+        <row-item>
+          <a-form-item
+            label="成本默认计量单位编码"
+            :labelCol="BaseTool.Constant.labelCol"
+            :wrapperCol="BaseTool.Constant.wrapperCol"
+          >
+            <a-select v-decorator="['cestCaComUnitCode']">
+              <a-select-option
+                v-for="(label,value) in unitMap"
+                :key="value"
+                :label="label"
+                :value="value">{{ label }}
+              </a-select-option>
+            </a-select>
+          </a-form-item>
+        </row-item>
         <row-item>
           <a-form-item
             label="备注"
@@ -112,13 +160,17 @@ export default {
       form: this.$form.createForm(this),
       treeData: [],
       flagMap: {},
-      deptMap: {}
-
+      deptMap: {},
+      unitMap: {},
+      policyMap: {},
+      planMap: {}
     }
   },
   created () {
     this.flagMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.PROJECT_NEW_AND_OLD)
     this.unitMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SPARE_ADD_UNIT)
+    this.policyMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.CSR_POLICY)
+    this.planMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.PLAN_METHOD)
     getInventoryTree().then(res => {
       // 循环获取样式
       this.treeData = res.data
@@ -135,9 +187,16 @@ export default {
       this.title = '编辑'
       const { form: { setFieldsValue } } = this
       // 日期处理
+      console.log(record)
       this.$nextTick(() => {
         setFieldsValue(Object.assign(pick(record, [
-          'id'
+          'id',
+          'tokenType',
+          'cestInvName',
+          'cestInvStd',
+          'cestInvCode',
+          'cestComUnitCode',
+          'remark'
         ])))
       })
     },