From 0fe10b533514a73915abd534493bffb6c5df016a Mon Sep 17 00:00:00 2001
From: hyingbo <1363390067@qq.com>
Date: 星期四, 24 七月 2025 14:13:24 +0800
Subject: [PATCH] 安灯管理

---
 src/views/system/modules/AndonOrderModal.vue |   69 +--------
 src/views/system/AndonOrderList.vue          |  300 +++++++++++++++++++++++-------------------
 2 files changed, 177 insertions(+), 192 deletions(-)

diff --git a/src/views/system/AndonOrderList.vue b/src/views/system/AndonOrderList.vue
index f07309c..852facb 100644
--- a/src/views/system/AndonOrderList.vue
+++ b/src/views/system/AndonOrderList.vue
@@ -8,19 +8,19 @@
 
           <a-col :xl="6" :lg="7" :md="8" :sm="24">
             <a-form-item label="璁惧缂栧彿">
-              <a-input placeholder="璇疯緭鍏ヨ澶囩紪鍙�" v-model="queryParam.equipmentId"></a-input>
+              <j-input placeholder="璇疯緭鍏ヨ澶囩紪鍙�" v-model="queryParam.equipmentId"></j-input>
             </a-form-item>
           </a-col>
           <a-col :xl="6" :lg="7" :md="8" :sm="24">
             <a-form-item label="瀹夌伅绫诲瀷">
               <j-dict-select-tag placeholder="璇烽�夋嫨瀹夌伅绫诲瀷" dictCode="andon_type" v-model="queryParam.andonType"
-                                 allow-clear/>
+                                 allow-clear />
             </a-form-item>
           </a-col>
           <a-col :xl="6" :lg="7" :md="8" :sm="24">
             <a-form-item label="瀹夌伅鐘舵��">
               <j-dict-select-tag placeholder="璇烽�夋嫨瀹夌伅鐘舵��" dictCode="order_status" v-model="queryParam.orderStatus"
-                                 allow-clear/>
+                                 allow-clear />
             </a-form-item>
           </a-col>
           <a-col :xl="6" :lg="7" :md="8" :sm="24">
@@ -33,43 +33,37 @@
         </a-row>
       </a-form>
     </div>
-
     <!-- table鍖哄煙-begin -->
     <div>
-<!--      <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">-->
-<!--        <i class="anticon anticon-info-circle ant-alert-icon"></i> 宸查�夋嫨 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>椤�-->
-<!--        <a style="margin-left: 24px" @click="onClearSelected">娓呯┖</a>-->
-<!--      </div>-->
+      <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
+        <i class="anticon anticon-info-circle ant-alert-icon"></i> 宸查�夋嫨 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>椤�
+        <a style="margin-left: 24px" @click="onClearSelected">娓呯┖</a>
+      </div>
 
-      <a-table
-        ref="table"
-        size="middle"
-        bordered
-        rowKey="id"
-        :columns="columns"
-        :dataSource="dataSource"
-        :pagination="ipagination"
-        :loading="loading"
-        class="j-table-force-nowrap"
-        :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
-        @change="handleTableChange">
+    <a-table
+      ref="table"
+      size="middle"
+      bordered
+      rowKey="id"
+      :columns="columns"
+      :dataSource="dataSource"
+      :pagination="ipagination"
+      :loading="loading"
+      class="j-table-force-nowrap"
+      :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
+      @change="handleTableChange">
 
+      <template slot='imageFiles' slot-scope='text, record, index'>
+        <span v-if="!text" style="font-size: 12px;font-style: italic;"> </span>
+        <img v-else :src="getImgView(text)" :preview="record.imageFiles" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/>
+      </template>
         <span slot="action" slot-scope="text, record">
-<!--          <a @click="handleEdit(record)">缂栬緫</a>-->
-
-<!--          <a-divider type="vertical" />-->
-<!--          <a-dropdown>-->
-<!--            <a class="ant-dropdown-link">鏇村 <a-icon type="down" /></a>-->
-<!--            <a-menu slot="overlay">-->
-<!--              <a-menu-item>-->
-<!--                <a-popconfirm title="纭畾鍒犻櫎鍚�?" @confirm="() => handleDelete(record.id)">-->
-<!--                  <a>鍒犻櫎</a>-->
-<!--                </a-popconfirm>-->
-<!--            </a-menu>-->
-<!--          </a-dropdown>-->
+          <a-popconfirm title="纭畾鍝嶅簲鍚�?" @confirm="() =>responseData(record.id)">
+            <a v-if="record.orderStatus === '1'" >鍝嶅簲</a>
+          </a-popconfirm>
+          <a v-if="record.orderStatus === '2'" @click.stop="handleSolve(record)">澶勭悊</a>
         </span>
-
-      </a-table>
+    </a-table>
     </div>
     <!-- table鍖哄煙-end -->
 
@@ -79,117 +73,151 @@
 </template>
 
 <script>
-  import '@assets/less/TableExpand.less'
-  import AndonOrderModal from './modules/AndonOrderModal.vue'
-  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
+import '@assets/less/TableExpand.less'
+import AndonOrderModal from './modules/AndonOrderModal.vue'
+import { JeecgListMixin } from '@/mixins/JeecgListMixin'
+import { deleteAction, getAction, postAction } from '@api/manage'
 
-  export default {
-    name: "AndonOrderList",
-    mixins:[JeecgListMixin],
-    components: {
-      AndonOrderModal
-    },
-    data () {
-      return {
-        description: '瀹夌伅绠$悊椤甸潰',
-        // 琛ㄥご
-        columns: [
-		   {
-            title: '璁惧缂栧彿',
-            align:"center",
-            dataIndex: 'equipmentId'
-           },
-		   {
-            title: '瀹夌伅绫诲瀷',
-            align:"center",
-            dataIndex: 'andonType_dictText'
-           },
-		   {
-            title: '瀹夌伅浜�',
-            align:"center",
-            dataIndex: 'operator_dictText'
-           },
-		   {
-            title: '瀹夌伅鏃堕棿',
-            align:"center",
-            dataIndex: 'operateTime'
-           },
-       {
-            title: '鍛煎彨鍘熷洜',
-            align:"center",
-            dataIndex: 'callReason'
-           },
-       {
-            title: '瀹夌伅鐘舵��',
-            align:"center",
-            dataIndex: 'orderStatus_dictText'
-           },
-		   {
-            title: '鍝嶅簲浜�',
-            align:"center",
-            dataIndex: 'responder_dictText'
-           },
-		   {
-            title: '鍝嶅簲鏃堕棿',
-            align:"center",
-            dataIndex: 'responseTime'
-           },
-		   {
-            title: '澶勭悊浜�',
-            align:"center",
-            dataIndex: 'processor'
-           },
-		   {
-            title: '澶勭悊瀹屾垚鏃堕棿',
-            align:"center",
-            dataIndex: 'processTime'
-           },
-		   {
-            title: '闂鎻忚堪',
-            align:"center",
-            dataIndex: 'problemDescreption'
-           },
-		   {
-            title: '澶勭悊缁撴灉鎻忚堪',
-            align:"center",
-            dataIndex: 'resolutionDescreption'
-           },
-		   {
-            title: '澶勭悊缁撴灉鍥剧墖',
-            align:"center",
-            dataIndex: 'imageFiles'
-           },
-		   // {
-       //      title: '鎵�灞炲巶鎴�',
-       //      align:"center",
-       //      dataIndex: 'plantName'
-       //     },
-          {
-            title: '鎿嶄綔',
-            dataIndex: 'action',
-            align:"center",
-            scopedSlots: { customRender: 'action' },
+export default {
+  name: 'AndonOrderList',
+  mixins: [JeecgListMixin],
+  components: {
+    AndonOrderModal
+  },
+  data() {
+    return {
+      description: '瀹夌伅绠$悊椤甸潰',
+      // 琛ㄥご
+      columns: [
+        {
+          title: '#',
+          dataIndex: '',
+          key: 'rowIndex',
+          width: 60,
+          align: 'center',
+          customRender: function(t, r, index) {
+            return parseInt(index) + 1
           }
-        ],
-		url: {
-          list: "/mdc/andonOrder/list",
-          delete: "/mdc/andonOrder/delete",
-          deleteBatch: "/mdc/andonOrder/deleteBatch",
-          exportXlsUrl: "mdc/andonOrder/exportXls",
-          importExcelUrl: "mdc/andonOrder/importExcel",
-       },
+        },
+        {
+          title: '璁惧缂栧彿',
+          align: 'center',
+          dataIndex: 'equipmentId'
+        },
+        {
+          title: '瀹夌伅绫诲瀷',
+          align: 'center',
+          dataIndex: 'andonType_dictText'
+        },
+        {
+          title: '瀹夌伅浜�',
+          align: 'center',
+          dataIndex: 'operator_dictText'
+        },
+        {
+          title: '瀹夌伅鏃堕棿',
+          align: 'center',
+          dataIndex: 'operateTime'
+        },
+        {
+          title: '闂鎻忚堪',
+          align: 'center',
+          dataIndex: 'callReason'
+        },
+        {
+          title: '瀹夌伅鐘舵��',
+          align: 'center',
+          dataIndex: 'orderStatus_dictText'
+        },
+        {
+          title: '鍝嶅簲浜�',
+          align: 'center',
+          dataIndex: 'responder_dictText'
+        },
+        {
+          title: '鍝嶅簲鏃堕棿',
+          align: 'center',
+          dataIndex: 'responseTime'
+        },
+        {
+          title: '澶勭悊浜�',
+          align: 'center',
+          dataIndex: 'processor_dictText'
+        },
+        {
+          title: '澶勭悊瀹屾垚鏃堕棿',
+          align: 'center',
+          dataIndex: 'processTime'
+        },
+        {
+          title: '澶勭悊缁撴灉鎻忚堪',
+          align: 'center',
+          dataIndex: 'resolutionDescreption'
+        },
+        {
+          title: '澶勭悊缁撴灉鍥剧墖',
+          align: 'center',
+          dataIndex: 'imageFiles',
+          scopedSlots: { customRender: 'imageFiles' }
+        },
+        // {
+        //      title: '鎵�灞炲巶鎴�',
+        //      align:"center",
+        //      dataIndex: 'plantName'
+        //     },
+        {
+          title: '鎿嶄綔',
+          dataIndex: 'action',
+          align: 'center',
+          width: 150,
+          scopedSlots: { customRender: 'action' }
+        }
+      ],
+      url: {
+        list: '/mdc/andonOrder/list',
+        responseData: '/mdc/andonOrder/responseData',
+        delete: '/mdc/andonOrder/delete',
+        deleteBatch: '/mdc/andonOrder/deleteBatch',
+        exportXlsUrl: 'mdc/andonOrder/exportXls',
+        importExcelUrl: 'mdc/andonOrder/importExcel'
+      }
     }
   },
   computed: {
-    importExcelUrl: function(){
-      return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
+    importExcelUrl: function() {
+      return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`
     }
   },
-    methods: {
-
+  methods: {
+    responseData(id){
+      if(!this.url.responseData){
+        this.$message.error("璇疯缃畊rl.responseData灞炴��!")
+        return
+      }
+      var that = this;
+      getAction(that.url.responseData, {id: id}).then((res) => {
+        if (res.success) {
+          that.$notification.success({
+            message:'娑堟伅',
+            description:res.message
+          });
+          that.loadData();
+        } else {
+          that.$notification.warning({
+            message:'娑堟伅',
+            description:res.message
+          });
+        }
+      });
+    },
+    handleSolve(record) {
+      this.$refs.modalForm.dealWith(record);
+      this.$refs.modalForm.title = '澶勭悊'
+      this.$refs.modalForm.disabledEdit = true
     }
   }
+}
 </script>
 <style scoped>
-  @import '~@assets/less/common.less';
+@import '~@assets/less/common.less';
 </style>
\ No newline at end of file
diff --git a/src/views/system/modules/AndonOrderModal.vue b/src/views/system/modules/AndonOrderModal.vue
index 28e4811..f9b9c71 100644
--- a/src/views/system/modules/AndonOrderModal.vue
+++ b/src/views/system/modules/AndonOrderModal.vue
@@ -11,60 +11,19 @@
 
     <a-spin :spinning="confirmLoading">
       <a-form-model ref="form" :model="model" :rules="validatorRules">
-
-        <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="equipmentId" label="璁惧缂栧彿">
-          <a-input placeholder="璇疯緭鍏ヨ澶囩紪鍙�" v-model="model.equipmentId" />
-        </a-form-model-item>
-        <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="andonType" label="瀹夌伅绫诲瀷">
-          <a-input placeholder="璇疯緭鍏ュ畨鐏被鍨�" v-model="model.andonType" />
-        </a-form-model-item>
-        <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="operator" label="瀹夌伅浜�">
-          <a-input placeholder="璇疯緭鍏ュ畨鐏汉" v-model="model.operator" />
-        </a-form-model-item>
-        <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="operateTime" label="瀹夌伅鏃堕棿">
-          <a-input placeholder="璇疯緭鍏ュ畨鐏椂闂�" v-model="model.operateTime" />
-        </a-form-model-item>
-        <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="responder" label="鍝嶅簲浜�">
-          <a-input placeholder="璇疯緭鍏ュ搷搴斾汉" v-model="model.responder" />
-        </a-form-model-item>
-        <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="responseTime" label="鍝嶅簲鏃堕棿">
-          <a-input placeholder="璇疯緭鍏ュ搷搴旀椂闂�" v-model="model.responseTime" />
-        </a-form-model-item>
-        <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="processor" label="澶勭悊浜�">
-          <a-input placeholder="璇疯緭鍏ュ鐞嗕汉" v-model="model.processor" />
-        </a-form-model-item>
-        <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="processTime" label="澶勭悊瀹屾垚鏃堕棿">
-          <a-input placeholder="璇疯緭鍏ュ鐞嗗畬鎴愭椂闂�" v-model="model.processTime" />
-        </a-form-model-item>
-        <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="orderStatus" label="瀹夌伅鐘舵��;寰呭搷搴斻�佸緟澶勭悊銆佸凡瀹屾垚">
-          <a-input placeholder="璇疯緭鍏ュ畨鐏姸鎬�;寰呭搷搴斻�佸緟澶勭悊銆佸凡瀹屾垚" v-model="model.orderStatus" />
-        </a-form-model-item>
-        <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="problemDescreption" label="闂鎻忚堪">
-          <a-input placeholder="璇疯緭鍏ラ棶棰樻弿杩�" v-model="model.problemDescreption" />
-        </a-form-model-item>
         <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="resolutionDescreption" label="澶勭悊缁撴灉鎻忚堪">
           <a-input placeholder="璇疯緭鍏ュ鐞嗙粨鏋滄弿杩�" v-model="model.resolutionDescreption" />
         </a-form-model-item>
         <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="imageFiles" label="澶勭悊缁撴灉鍥剧墖">
-          <a-input placeholder="璇疯緭鍏ュ鐞嗙粨鏋滃浘鐗�" v-model="model.imageFiles" />
+          <j-image-upload text="澶勭悊缁撴灉鍥剧墖" bizPath="andon_handle_page" v-model="model.imageFiles"></j-image-upload>
         </a-form-model-item>
-        <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="delFlag" label="鍒犻櫎鏍囪">
-          <a-input-number v-model="model.delFlag"/>
-        </a-form-model-item>
-        <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="callReason" label="鍛煎彨鍘熷洜">
-          <a-input placeholder="璇疯緭鍏ュ懠鍙師鍥�" v-model="model.callReason" />
-        </a-form-model-item>
-        <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="plantName" label="鎵�灞炲巶鎴�">
-          <a-input placeholder="璇疯緭鍏ユ墍灞炲巶鎴�" v-model="model.plantName" />
-        </a-form-model-item>
-
       </a-form-model>
     </a-spin>
   </j-modal>
 </template>
 
 <script>
-  import { httpAction } from '@api/manage'
+import { httpAction, postAction } from '@api/manage'
 
   export default {
     name: "AndonOrderModal",
@@ -84,10 +43,12 @@
 
         confirmLoading: false,
         validatorRules:{
+          resolutionDescreption: [
+            { required: true, message: '璇疯緭鍏ュ鐞嗙粨鏋滄弿杩�' }
+          ],
         },
         url: {
-          add: "/mdc/andonOrder/add",
-          edit: "/mdc/andonOrder/edit",
+          dealWith: "/mdc/andonOrder/dealWith",
         },
       }
     },
@@ -102,6 +63,10 @@
         this.model = Object.assign({}, record);
         this.visible = true;
       },
+      dealWith (record) {
+        this.model = Object.assign({}, record);
+        this.visible = true;
+      },
       close () {
         this.$emit('close');
         this.visible = false;
@@ -113,25 +78,17 @@
          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';
-            }
-            httpAction(httpurl,this.model,method).then((res)=>{
+
+            postAction(this.url.dealWith,this.model).then((res)=>{
               if(res.success){
                 that.$message.success(res.message);
                 that.$emit('ok');
+                that.close();
               }else{
                 that.$message.warning(res.message);
               }
             }).finally(() => {
               that.confirmLoading = false;
-              that.close();
             })
           }else{
              return false;

--
Gitblit v1.9.3