瀏覽代碼

初始化入库

guarantee-lsq 2 年之前
父節點
當前提交
e841cd2e60
共有 1 個文件被更改,包括 41 次插入17 次删除
  1. 41 17
      src/views/sqarepartmanage/sparepartinfo/modules/BaseForm.vue

+ 41 - 17
src/views/sqarepartmanage/sparepartinfo/modules/BaseForm.vue

@@ -279,7 +279,7 @@
               v-decorator="['minStock']" />
           </a-form-item>
         </row-item>
-        <row-item v-show="isAdd">
+        <row-item>
           <a-form-item
             label="初始库位"
             :labelCol="BaseTool.Constant.labelCol"
@@ -297,19 +297,6 @@
             </a-tree-select>
           </a-form-item>
         </row-item>
-        <row-item v-show="isAdd">
-          <a-form-item
-            label="初始库存"
-            :labelCol="BaseTool.Constant.labelCol"
-            :wrapperCol="BaseTool.Constant.wrapperCol"
-          >
-            <a-input-number
-              style="width: 100%"
-              :min="1"
-              v-decorator="['initStock']" />
-          </a-form-item>
-        </row-item>
-
         <row-item>
           <a-form-item
             label="英文名称"
@@ -400,6 +387,34 @@
               v-decorator="['remark']" />
           </a-form-item>
         </row-item>
+        <row-item>
+          <a-form-item
+            label="是否初始化入库"
+            :labelCol="BaseTool.Constant.labelCol"
+            :wrapperCol="BaseTool.Constant.wrapperCol"
+          >
+            <a-select @change="$event => onInitializedChange($event)" v-decorator="['isInitialized', {rules: [{required: true, message: '是否专用不能为空'}]}]" placeholder="请选择">
+              <a-select-option
+                v-for="(label,value) in initializedType"
+                :key="value"
+                :label="label"
+                :value="parseInt(value)">{{ label }}
+              </a-select-option>
+            </a-select>
+          </a-form-item>
+        </row-item>
+        <row-item v-show="isAdd">
+          <a-form-item
+            label="初始库存"
+            :labelCol="BaseTool.Constant.labelCol"
+            :wrapperCol="BaseTool.Constant.wrapperCol"
+          >
+            <a-input-number
+              style="width: 100%"
+              :min="1"
+              v-decorator="['initStock']" />
+          </a-form-item>
+        </row-item>
       </row-list>
     </a-form>
     <title-divider title="设备信息" width="100px"></title-divider>
@@ -554,7 +569,8 @@ export default {
         rowSelection: {
           selectedRowKeys: this.selectedRowKeys
         }
-      }
+      },
+      initializedType: null
     }
   },
   props: {
@@ -563,6 +579,7 @@ export default {
     // 下拉框map
     this.setTree()
     this.specialMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.YES_NO)
+    this.initializedType = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.YES_NO)
     this.levelMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SPARE_PART_INFO_LEVEL)
     this.unitMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SBINFO_UNIT)
     this.cdMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.PRODUCER_AREA)
@@ -577,7 +594,7 @@ export default {
       // 如果是空标识添加
       if (this.BaseTool.Object.isBlank(record)) {
         this.modalTitle = '添加'
-        this.isAdd = true
+        /*this.isAdd = true*/
         this.$refs.imageUpload.base(1, [])
         return
       }
@@ -654,6 +671,13 @@ export default {
       }
       this.$refs.imageUpload.base(1, fileList)
     },
+    onInitializedChange (e) {
+      if (e === 0) {
+        this.isAdd = false
+      } else {
+        this.isAdd = true
+      }
+    },
     save () {
       const { form: { validateFieldsAndScroll, setFieldsValue } } = this
       this.confirmLoading = true
@@ -720,7 +744,7 @@ export default {
       this.unitName = null
       this.unitNameBz = null
       this.gg = null
-      this.isAdd = true
+      /*this.isAdd = true*/
       this.data = []
       if (this.BaseTool.Object.isNotBlank(values)) {
         this.$emit('ok', values)