From 92ff846fb659c62037a32b1d8c15eae9df9d9b54 Mon Sep 17 00:00:00 2001
From: zenglf <18502938215@163.com>
Date: 星期一, 18 九月 2023 13:24:30 +0800
Subject: [PATCH] Merge branch 'develop' of http://117.34.109.166:18448/r/vue_mdc_430

---
 src/views/spare/modules/sparePartScrapRequirement/SpareRequirementSelectModal.vue |  194 ++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 194 insertions(+), 0 deletions(-)

diff --git a/src/views/spare/modules/sparePartScrapRequirement/SpareRequirementSelectModal.vue b/src/views/spare/modules/sparePartScrapRequirement/SpareRequirementSelectModal.vue
new file mode 100644
index 0000000..f94b14a
--- /dev/null
+++ b/src/views/spare/modules/sparePartScrapRequirement/SpareRequirementSelectModal.vue
@@ -0,0 +1,194 @@
+<template>
+  <j-modal
+    :title='title'
+    :width='width'
+    :visible='visible'
+    :confirmLoading='confirmLoading'
+    switchFullscreen
+    @ok='handleOk'
+    @cancel='handleCancel'
+    cancelText='鍏抽棴'>
+    <a-spin :spinning='confirmLoading'>
+      <a-form-model ref='form' :model='model' :rules='validatorRules'>
+
+        <a-row style='width: 100%'>
+          <a-col :span='12'>
+            <a-form-model-item label='澶囦欢缂栫爜' :labelCol='labelCol' :wrapperCol='wrapperCol' prop='spareNum'>
+              <a-input v-model='model.spareNum' placeholder='璇疯緭鍏ュ浠剁紪鐮�'></a-input>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span='12'>
+            <a-form-model-item label='澶囦欢鍚嶇О' :labelCol='labelCol' :wrapperCol='wrapperCol' prop='spareNum'>
+              <a-input v-model='model.spareName' placeholder='璇疯緭澶囦欢鍚嶇О'></a-input>
+            </a-form-model-item>
+          </a-col>
+
+        </a-row>
+        <a-row style='width: 100%'>
+          <a-col :span='12'>
+            <a-form-model-item label='瑙勬牸' :labelCol='labelCol' :wrapperCol='wrapperCol' prop='model'>
+              <a-input v-model='model.specification' placeholder='璇疯緭鍏ヨ鏍�'></a-input>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span='12'>
+            <a-form-model-item label='鍨嬪彿' :labelCol='labelCol' :wrapperCol='wrapperCol' prop='model'>
+              <a-input v-model='model.model' placeholder='璇疯緭鍏ヨ鏍煎瀷鍙�' />
+            </a-form-model-item>
+          </a-col>
+        </a-row>
+        <a-row style='width: 100%'>
+          <a-col :span='12'>
+            <a-form-model-item label='鍗曚綅' :labelCol='labelCol' :wrapperCol='wrapperCol' prop='mainUnitId'>
+              <!--              <a-input v-model='model.mainUnitId' placeholder='璇疯緭鍏ヤ富鍗曚綅' />-->
+              <j-dict-select-tag
+                allow-clear
+                :placeholder="'璇烽�夋嫨鍗曚綅'"
+                v-model='model.departId'
+                dictCode="mom_base_unit,name,id,del_flag!='1'"
+              />
+            </a-form-model-item>
+          </a-col>
+<!--          <a-col :span='12'>
+            <a-form-model-item label='杈呭崟浣�' :labelCol='labelCol' :wrapperCol='wrapperCol' prop='auxiliaryUnitId'>
+              &lt;!&ndash;              <a-input v-model='model.auxiliaryUnitId' placeholder='璇疯緭鍏ヨ緟鍗曚綅' />&ndash;&gt;
+              <j-dict-select-tag
+                allow-clear
+                :placeholder="'璇烽�夋嫨杈呭崟浣�'"
+                v-model='model.departId'
+                dictCode="mom_base_unit,name,id,del_flag!='1'"
+              />
+            </a-form-model-item>
+          </a-col>-->
+        </a-row>
+        <a-row style='width: 100%'>
+          <a-col :span='12'>
+            <a-form-model-item label='涓绘暟閲�' :labelCol='labelCol' :wrapperCol='wrapperCol' prop='mainQuantity'>
+              <a-input-number v-model='model.mainQuantity' placeholder='璇疯緭鍏ヤ富鏁伴噺' />
+            </a-form-model-item>
+          </a-col>
+          <a-col :span='12'>
+            <a-form-model-item label='杈呮暟閲�' :labelCol='labelCol' :wrapperCol='wrapperCol' prop='auxiliaryQuantity'>
+              <a-input-number v-model='model.auxiliaryQuantity' placeholder='璇疯緭鍏ヨ緟鏁伴噺' style='width: 100%' />
+            </a-form-model-item>
+          </a-col>
+        </a-row>
+
+      </a-form-model>
+    </a-spin>
+  </j-modal>
+</template>
+
+<script>
+
+import { httpAction } from '@api/manage'
+
+export default {
+  name: 'SpareRequirementSelectModal',
+  components: {},
+  props: {
+    mainId: {
+      type: String,
+      required: false,
+      default: ''
+    }
+  },
+  data() {
+    return {
+      title: '鎿嶄綔',
+      width: 800,
+      visible: false,
+      model: {},
+      labelCol: {
+        xs: { span: 24 },
+        sm: { span: 6 }
+      },
+      wrapperCol: {
+        xs: { span: 24 },
+        sm: { span: 18 }
+      },
+
+      confirmLoading: false,
+      validatorRules: {
+        physicalCountQuantity: [
+          { required: false },
+          { pattern: /^-?\d+\.?\d*$/, message: '璇疯緭鍏ユ暟瀛�!' }
+        ],
+        quantityVariance: [
+          { required: false },
+          { pattern: /^-?\d+\.?\d*$/, message: '璇疯緭鍏ユ暟瀛�!' }
+        ]
+      },
+      url: {
+        add: '/spare/sparePartScrap/add',
+        edit: '/spare/sparePartScrap/edit'
+      }
+
+    }
+  },
+  created() {
+    //澶囦唤model鍘熷鍊�
+    /* this.modelDefault = JSON.parse(JSON.stringify(this.model))*/
+  },
+  methods: {
+    add() {
+      this.edit(this.model)
+    },
+    edit(record) {
+      this.model = Object.assign({}, record)
+      this.visible = true
+    },
+    close() {
+      this.$emit('close')
+      this.visible = false
+      this.$refs.form.clearValidate()
+    },
+
+    handleOk() {
+      this.$bus.$emit('dataSource', this.model)
+      this.searchReset(0)
+      this.close()
+    },
+
+    /*    handleOk() {
+          const that = this
+          // 瑙﹀彂琛ㄥ崟楠岃瘉
+          this.$refs.form.validate(valid => {
+            if (valid) {
+              that.confirmLoading = true
+              let httpurl = ''
+              let method = ''
+              if (!this.model.id) {
+                httpurl += this.url.add
+                method = 'post'
+              } else {
+                httpurl += this.url.edit
+                method = 'put'
+              }
+              this.model['sparePartScrapId'] = this.mainId
+              httpAction(httpurl, this.model, method).then((res) => {
+                if (res.success) {
+                  that.$message.success(res.message)
+                  that.$emit('ok')
+                } else {
+                  that.$message.warning(res.message)
+                }
+              }).finally(() => {
+                that.confirmLoading = false
+                that.close()
+              })
+            } else {
+              return false
+            }
+          })
+        },*/
+    handleCancel() {
+      this.close()
+    },
+    popupCallback(value, row) {
+      this.model = Object.assign(this.model, row)
+    }
+
+
+  }
+}
+</script>

--
Gitblit v1.9.3