From 135b5b2e497514dc4456e33b0db0fe5e7fa4e62f Mon Sep 17 00:00:00 2001
From: cuijian <cuijian@xalxzn.com>
Date: 星期一, 11 八月 2025 09:11:19 +0800
Subject: [PATCH] 现场问题处理

---
 src/views/tms/modules/verification/ToolVerificationRecordModal.vue |  236 ++++++++++++++++++++++++++++++++++++++++++++++++----------
 1 files changed, 194 insertions(+), 42 deletions(-)

diff --git a/src/views/tms/modules/verification/ToolVerificationRecordModal.vue b/src/views/tms/modules/verification/ToolVerificationRecordModal.vue
index 7fe1c74..b5f1f26 100644
--- a/src/views/tms/modules/verification/ToolVerificationRecordModal.vue
+++ b/src/views/tms/modules/verification/ToolVerificationRecordModal.vue
@@ -1,60 +1,212 @@
 <template>
   <j-modal
     :title="title"
-    :width="width"
-    :visible="visible"
+    :width="1200"
+    :confirmLoading="confirmLoading"
     switchFullscreen
+    centered
+    :visible="visible"
+    :mask-closable="false"
     @ok="handleOk"
-    :okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
     @cancel="handleCancel"
     cancelText="鍏抽棴">
-    <tool-verification-record-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></tool-verification-record-form>
+
+
+
+    <a-spin :spinning="spinning">
+      <a-form-model ref="form" :model="model" :rules="validatorRules" :labelCol="labelCol" :wrapperCol="wrapperCol">
+        <a-row :gutter="24">
+          <a-col :span="12">
+            <a-form-model-item prop="onlyCode" :labelCol="labelCol" :wrapperCol="wrapperCol" label="鍞竴缂栫爜">
+              <a-input-search v-model="model.onlyCode" placeholder="璇烽�夋嫨鍞竴缂栫爜" :disabled="disableSubmit"
+                              @search="selectTools" enter-button
+              />
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="12">
+            <a-form-model-item prop="toolCode" :labelCol="labelCol" :wrapperCol="wrapperCol" label="閲忓叿缂栧彿">
+              <a-input placeholder="閫夋嫨鍞竴缂栫爜鍚庤嚜鍔ㄥ甫鍑�" v-model="model.toolCode" :disabled="true" />
+            </a-form-model-item>
+          </a-col>
+
+        </a-row>
+        <a-row :gutter="24">
+          <a-col :span="12">
+            <a-form-model-item prop="paramaTableName" :labelCol="labelCol" :wrapperCol="wrapperCol" label="閲忓叿鍚嶇О">
+              <a-input placeholder="閫夋嫨鍞竴缂栫爜鍚庤嚜鍔ㄥ甫鍑�" v-model="model.toolName"
+                       :disabled="true" />
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="12">
+            <a-form-model-item label="瑙勬牸" :labelCol="labelCol" :wrapperCol="wrapperCol">
+              <a-input placeholder="閫夋嫨鍞竴缂栫爜鍚庤嚜鍔ㄥ甫鍑�" v-model="model.toolModel"
+                       :disabled="true" />
+            </a-form-model-item>
+          </a-col>
+        </a-row>
+
+        <a-row :gutter="24">
+          <a-col :span="12">
+            <a-form-model-item prop="personResponsible" :labelCol="labelCol" :wrapperCol="wrapperCol" label="璐d换浜�">
+              <j-dict-select-tag type="list" v-model="model.personResponsible" dictCode="sys_user,realname,id"
+                                 placeholder="璇烽�夋嫨璐d换浜�" :disabled="disableSubmit" />
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="12">
+            <a-form-model-item label="妫�瀹氭姤鍛婃棩鏈�" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="verificationReportDate">
+              <j-date placeholder="璇烽�夋嫨妫�瀹氭姤鍛婃棩鏈�" date-format="YYYY-MM-DD" v-model="model.verificationReportDate"
+                      style="width: 100%" :disabled="disableSubmit" />
+            </a-form-model-item>
+          </a-col>
+        </a-row>
+        <a-row :gutter="24">
+          <a-col :span="24">
+            <a-form-model-item label="璁¢噺鍙�" :labelCol="{span:3}" :wrapperCol="{span:19}">
+              <a-input placeholder="璇峰~鍐欒閲忓彿" v-model="model.measureNumber" :disabled="disableSubmit" />
+            </a-form-model-item>
+          </a-col>
+        </a-row>
+        <a-row :gutter="24">
+          <a-col :span="24">
+            <a-form-model-item label="妫�瀹氱粨鏋滃強寤鸿" :labelCol="{span:3}" :wrapperCol="{span:19}" prop="result">
+              <a-textarea placeholder="璇峰~鍐欐瀹氱粨鏋滃強寤鸿" v-model="model.result"
+                          :disabled="disableSubmit" />
+            </a-form-model-item>
+          </a-col>
+        </a-row>
+      </a-form-model>
+    </a-spin>
+    <template slot="footer">
+      <a-button :style="{ marginRight: '8px' }" @click="handleCancel()">
+        鍏抽棴
+      </a-button>
+
+      <a-button @click="handleOk()" :disabled="disableSubmit" type="primary" :loading="confirmLoading">纭畾</a-button>
+    </template>
+    <j-select-tools ref="toolListModel"  @sendSelectionRows="getRows"></j-select-tools>
+
+
   </j-modal>
 </template>
 
 <script>
 
-  import ToolVerificationRecordForm from './ToolVerificationRecordForm'
-  export default {
-    name: 'ToolVerificationRecordModal',
-    components: {
-      ToolVerificationRecordForm
-    },
-    data () {
-      return {
-        title:'',
-        width:800,
-        visible: false,
-        disableSubmit: false
-      }
-    },
-    methods: {
-      add () {
-        this.visible=true
-        this.$nextTick(()=>{
-          this.$refs.realForm.add();
-        })
+import { JVxeTableModelMixin } from '@/mixins/JVxeTableModelMixin.js'
+import JSelectTools from './JSelectTools'
+import { requestPut, postAction, httpAction } from '@/api/manage'
+export default {
+  name: 'ToolVerificationRecordModal',
+  mixins: [JVxeTableModelMixin],
+  components: {
+    JSelectTools
+  },
+  data() {
+    return {
+      title: '鎿嶄綔',
+      visible: false,
+      model: {},
+      labelCol: {
+        xs: { span: 24 },
+        sm: { span: 6 }
       },
-      edit (record) {
-        this.visible=true
-        this.$nextTick(()=>{
-          this.$refs.realForm.edit(record);
-        })
+      wrapperCol: {
+        xs: { span: 24 },
+        sm: { span: 15 }
       },
-      close () {
-        this.$emit('close');
-        this.visible = false;
+      confirmLoading: false,
+      spinning: false,
+      disabled: false,
+      disableSubmit: false,
+      validatorRules: {
+        onlyCode: [
+          { required: true, message: '璇烽�夋嫨鍞竴缂栫爜!' }
+        ]
       },
-      handleOk () {
-        this.$refs.realForm.submitForm();
-      },
-      submitCallback(){
-        this.$emit('ok');
-        this.visible = false;
-      },
-      handleCancel () {
-        this.close()
+      lastSelectionData: null,
+      url: {
+        add: '/tms/toolVerificationRecord/add',
+        edit: '/tms/toolVerificationRecord/edit'
       }
     }
+  },
+  created() {
+  },
+
+  methods: {
+    getRows(item) {
+      console.log(item)
+      if (item.id) {
+        this.$set(this.model, 'onlyCode', item.onlyCode)
+        this.$set(this.model, 'toolCode', item.toolCode)
+        this.$set(this.model, 'toolName', item.toolName)
+        this.$set(this.model, 'toolModel', item.toolModel)
+      }
+    },
+
+    selectTools: function() {
+      this.$refs.toolListModel.showModals()
+      this.$refs.toolListModel.title = '閫夋嫨閲忓叿淇℃伅'
+      this.$refs.toolListModel.disableSubmit = false
+    },
+
+    add() {
+      this.edit({})
+    },
+    edit(record) {
+      let that = this
+      that.visible = true
+      that.model = Object.assign({}, record)
+    },
+
+    close() {
+      this.$emit('close')
+      this.visible = false
+    },
+    handleOk() {
+      const that = this
+      // 瑙﹀彂琛ㄥ崟楠岃瘉
+      this.$refs.form.validate(valid => {
+        if (valid) {
+          let formData = Object.assign(this.model)
+          that.confirmLoading = true
+          let httpurl = ''
+          let method = ''
+          if (!this.model.id) {
+            httpurl += this.url.add
+            method = 'post'
+          } else {
+            httpurl += this.url.edit
+            method = 'put'
+          }
+          httpAction(httpurl, this.model, method,formData).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()
+    },
+
+
   }
-</script>
\ No newline at end of file
+}
+</script>
+
+<style lang="less" scoped>
+
+</style>
+
+
+

--
Gitblit v1.9.3