From 57ec2038f86f47a87db6b73c0c6eb27c1c25b08e Mon Sep 17 00:00:00 2001
From: hyingbo <1363390067@qq.com>
Date: 星期三, 06 八月 2025 14:16:00 +0800
Subject: [PATCH] 我的已办、仓库管理相关调整

---
 src/views/tms/WarehouseList.vue                                   |   15 +
 src/views/flowable/workflow/inboundOrder/InboundOrderHandleXq.vue |  479 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 src/views/flowable/workflow/FlowCompleted.vue                     |   18 +-
 3 files changed, 502 insertions(+), 10 deletions(-)

diff --git a/src/views/flowable/workflow/FlowCompleted.vue b/src/views/flowable/workflow/FlowCompleted.vue
index 1895e10..f80baeb 100644
--- a/src/views/flowable/workflow/FlowCompleted.vue
+++ b/src/views/flowable/workflow/FlowCompleted.vue
@@ -170,11 +170,11 @@
       ref='equipmentReturnApprovalModelRef'
       @searchReset='searchReset'
     />
-    <inbound-order-handle
+    <inbound-order-handle-xq
       ref='inboundOrderApprovalModal'
       :selectInboundOrderData='selectInboundOrderData'
       @searchReset='searchReset'
-    ></inbound-order-handle>
+    ></inbound-order-handle-xq>
     <second-maintenance-approval-modal
       ref='secondMaintenanceApprovalModal'
       :selectShenpiData='selectSecondMaintenanceData'
@@ -216,7 +216,7 @@
 import GuideCardBatchXq from '@views/flowable/workflow/guideCardBatch/GuideCardBatchXq.vue'
 import SecondMaintenanceApprovalModal from '@views/flowable/workflow/secondMaintenance/SecondMaintenanceApprovalModal.vue'
 import ThirdMaintenanceApprovalModal from '@views/flowable/workflow/thirdMaintenance/ThirdMaintenanceApprovalModal.vue'
-import InboundOrderHandle from '@views/flowable/workflow/inboundOrder/InboundOrderHandle.vue'
+import InboundOrderHandleXq from '@views/flowable/workflow/inboundOrder/InboundOrderHandleXq.vue'
 
 export default {
   name: 'NcDeviceCharactersList',
@@ -239,7 +239,7 @@
     EquipmentReturnApprovalModal,
     SecondMaintenanceApprovalModal,
     ThirdMaintenanceApprovalModal,
-    InboundOrderHandle,
+    InboundOrderHandleXq,
     GuideCardBatchXq
 
   },
@@ -418,11 +418,11 @@
       this.$refs.equipmentReturnApprovalModelRef.disableSubmit = true
     },
     handleToolInStorage(item) {
-      if (item && item.dataId) {
-        this.selectInboundOrderData = Object.assign({}, item)
-        this.$refs.inboundOrderApprovalModal.auditVisible = true
-        this.$refs.inboundOrderApprovalModal.getAllApproveData(item)
-      }
+      console.log('item----->', item)
+      this.selectInboundOrderData = item
+      this.selectGuideCardData.title = item.description
+      this.$refs.inboundOrderApprovalModal.clearTableSource()
+      this.$refs.inboundOrderApprovalModal.getAllApproveData(item)
     },
     handleSecondMaintenance(item) {
       if (item && item.dataId) {
diff --git a/src/views/flowable/workflow/inboundOrder/InboundOrderHandleXq.vue b/src/views/flowable/workflow/inboundOrder/InboundOrderHandleXq.vue
new file mode 100644
index 0000000..3880098
--- /dev/null
+++ b/src/views/flowable/workflow/inboundOrder/InboundOrderHandleXq.vue
@@ -0,0 +1,479 @@
+<template>
+  <a-modal
+    :title="title"
+    :width="width"
+    :visible="visible"
+    :footer="null"
+    @cancel="handCancel"
+  >
+    <a-card :bordered="false">
+      <div>
+        <b>{{ selectInboundOrderData.description }}</b>
+        <br>
+        <br>
+        <a-tag color="blue">
+          澶勭悊浜� {{ selectInboundOrderData.assignee_dictText }}
+        </a-tag>
+        <a-tag color="blue">
+          鍒涘缓鏃堕棿 {{ selectInboundOrderData.createTime }}
+        </a-tag>
+        <br>
+        <br>
+        <button @click="fetchAndShowBmp" class="btn-custom">鎵撳紑娴佺▼鍥�</button>
+        <div v-if="imageSrc">
+          <img :src="imageSrc" alt="Fetched Image" />
+        </div>
+        <hr class="shallow-hr">
+      </div>
+      <div>
+        <b>鐢宠鍗曡鎯�</b>
+        <br>
+        <a-form :form='form'>
+          <a-spin :spinning="spinning">
+            <a-tabs default-active-key='1' @change='callback'>
+              <a-tab-pane key='1' tab='鐢宠鍗曞熀鏈俊鎭�'>
+                <a-form-model ref='form' :model='tableRowRecord'>
+                  <a-row>
+                    <a-col :span='span'>
+                      <a-form-model-item label='鍏ュ簱鍗曠紪鍙�' :labelCol='labelCol' :wrapperCol='wrapperCol' prop='inboundNum'>
+                        <a-input :disabled='coldisabled' v-model='tableRowRecord.inboundNum'></a-input>
+                      </a-form-model-item>
+                    </a-col>
+                    <a-col :span='span'>
+                      <a-form-model-item label='鍏ュ簱绫诲瀷' :labelCol='labelCol' :wrapperCol='wrapperCol' prop='inStorehouseType'>
+                        <j-dict-select-tag :disabled="coldisabled" type="list" v-model="tableRowRecord.inStorehouseType" dictCode="in_storehouse_type" />
+                      </a-form-model-item>
+                    </a-col>
+                  </a-row>
+                  <a-row>
+                    <a-col :span='span'>
+                      <a-form-model-item label='鍏ュ簱鏃堕棿' :labelCol='labelCol' :wrapperCol='wrapperCol' prop='inboundTime'>
+                        <j-date :disabled="coldisabled" v-model="tableRowRecord.inboundTime" :show-time="true" dateFormat="YYYY-MM-DD HH:mm" style="width: 100%"/>
+                      </a-form-model-item>
+                    </a-col>
+                    <a-col :span='span'>
+                      <a-form-model-item label='鐢宠鍘熷洜' :labelCol='labelCol' :wrapperCol='wrapperCol' prop='applicationReason'>
+                        <a-input :disabled='coldisabled' v-model='tableRowRecord.applicationReason'></a-input>
+                      </a-form-model-item>
+                    </a-col>
+                  </a-row>
+                  <a-row>
+                    <a-col :span='span'>
+                      <a-form-model-item label='缁忔墜浜�' :labelCol='labelCol' :wrapperCol='wrapperCol' prop='handler'>
+                        <a-input :disabled='coldisabled' v-model='tableRowRecord.handler_dictText'></a-input>
+                      </a-form-model-item>
+                    </a-col>
+                    <a-col :span='span'>
+                      <a-form-model-item label='澶囨敞' :labelCol='labelCol' :wrapperCol='wrapperCol' prop='remark'>
+                        <a-textarea :disabled="coldisabled" v-model="tableRowRecord.remark" rows="4" />
+                      </a-form-model-item>
+                    </a-col>
+                  </a-row>
+                </a-form-model>
+              </a-tab-pane>
+              <a-tab-pane key='2' tab='鐢宠鍗曟槑缁嗕俊鎭�'>
+                <a-table
+                  ref="table"
+                  size="middle"
+                  bordered
+                  rowKey="id"
+                  :scroll="{x:'max-content'}"
+                  :columns="columns"
+                  :dataSource="dataSource"
+                  :pagination="ipagination"
+                  :loading="loading"
+                  :rowSelection="null">
+                </a-table>
+              </a-tab-pane>
+              <a-tab-pane key='3' tab='娴佺▼鑺傜偣'>
+                <a-timeline>
+                  <a-timeline-item v-for="(item,index) in hitaskDataSource" :key="index">
+                    <div>
+                      <h3 style="font-weight: bold;">{{item.taskName}}</h3>
+                      <div>澶勭悊浜猴細{{item.assignee_dictText}}</div>
+                      <div v-if="index !==0">澶勭悊鏃堕暱锛歿{item.duration}}</div>
+                      <div v-if="item.name !== '鎻愪氦鐢宠'">澶勭悊绫诲瀷锛歿{item.sequenceFlowName}}</div>
+                      <div v-if="item.description">澶勭悊鎰忚锛歿{item.description}}</div>
+                    </div>
+                  </a-timeline-item>
+                </a-timeline>
+              </a-tab-pane>
+            </a-tabs>
+          </a-spin>
+        </a-form>
+      </div>
+    </a-card>
+
+
+  </a-modal>
+</template>
+
+<script>
+
+import '@assets/less/TableExpand.less'
+import { mixinDevice } from '@/utils/mixin'
+import { getAction, deleteAction, postAction, downFile, httpAction } from '@api/manage'
+export default {
+  name: 'FlowShenPi',
+  mixins: [mixinDevice],
+  props: {
+    selectInboundOrderData: {
+      type: Object,
+      required: true
+    }
+  },
+
+  data() {
+    return {
+      form: this.$form.createForm(this),
+      span: 12,
+      span1: 8,
+      coldisabled: true,
+      spinning: false,
+      tableRowRecord: {},
+      assignFileStream:{},
+      tableDataSource: [],
+      usageDataSource: [],
+      hitaskDataSource:[],
+      dataSource: [],
+      bomForm: {},
+      imageSrc: null,
+      drawerVisible: true,
+      auditVisible: true,
+      loading: false,
+      labelCol: {
+        xs: { span: 24 },
+        sm: { span: 5 }
+      },
+      wrapperCol: {
+        xs: { span: 30 },
+        sm: { span: 16 }
+      },
+      /* 鍒嗛〉鍙傛暟 */
+      ipagination:{
+        current: 1,
+        pageSize: 5,
+        pageSizeOptions: ['5', '10', '50'],
+        showTotal: (total, range) => {
+          return range[0] + "-" + range[1] + " 鍏�" + total + "鏉�"
+        },
+        showQuickJumper: true,
+        showSizeChanger: true,
+        total: 0
+      },
+      columns: [
+        {
+          title: '#',
+          dataIndex: '',
+          key:'rowIndex',
+          width:60,
+          align:"center",
+          customRender:function (t,r,index) {
+            return parseInt(index)+1;
+          }
+        },
+        {
+          title:'宸ュ叿缂栫爜',
+          align:"center",
+          dataIndex: 'toolCode'
+        },
+        {
+          title:'宸ュ叿绫诲瀷',
+          align:"center",
+          dataIndex: 'applicationType'
+        },
+        {
+          title:'涓枃鍚嶇О',
+          align:"center",
+          dataIndex: 'chineseName'
+        },
+        {
+          title:'鍨嬪彿/鍥惧彿',
+          align:"center",
+          dataIndex: 'toolModel'
+        },
+        {
+          title:'搴撲綅鍙�',
+          align:"center",
+          dataIndex: 'goodsShelvesId'
+        },
+        {
+          title:'鐢宠鍏ュ簱鏁伴噺',
+          align:"center",
+          dataIndex: 'inStorageQuantity'
+        },
+      ],
+      validatorRules: {
+        status: {
+          rules: [
+            { required: true, message: '璇烽�夋嫨瀹℃壒鐘舵��!'},
+          ]
+        },
+      },
+      approveData: {},
+      flowData: {},
+      title: '瀹℃壒椤甸潰',
+      width: 1200,
+      visible: false,
+      // 琛ㄥご
+      url: {
+        queryInboundOrder: '/tms/inboundOrder/list',
+        queryInboundDetailList: 'tms/inboundDetail/list',
+        diagramView: '/assign/flow/diagramView',
+        queryHisTaskList:'/assign/flow/queryHisTaskList',
+        approve:"/tms/inboundOrder/approval",
+      },
+      dictOptions: {},
+      superFieldList: [],
+      workflowSource: [],
+      isSubmitting: false,
+    }
+  },
+  created() {
+  },
+  computed: {},
+  methods: {
+    callback() {
+    },
+    handCancel() {
+      this.visible = false
+    },
+    clearTableSource() {
+      this.tableDataSource = []
+      this.usageDataSource = []
+    },
+    fetchAndShowBmp() {
+      try {
+        let parm = {
+          processDefinitionId: this.flowData.processDefinitionId,
+          processInstanceId:this.flowData.processInstanceId,
+          TaskDefinitionKey:this.flowData.processDefinitionKey
+        }
+        downFile(this.url.diagramView,parm,'get').then((res=>{
+          const urlObject = window.URL.createObjectURL(new Blob([res]))
+          this.imageSrc = urlObject
+        }))
+      } catch (error) {
+        console.error('Error fetching image blob:', error)
+        alert('鏃犳硶鍔犺浇鍥剧墖锛岃绋嶅悗鍐嶈瘯銆�')
+      }
+    },
+    handleQueXiaoTask() {
+      // 濡傛灉姝e湪鎻愪氦锛岄樆姝㈠彇娑堟搷浣�
+      if (this.isSubmitting) return;
+      this.visible = false;
+      this.routeReload();
+    },
+    submitForm () {
+      // 濡傛灉姝e湪鎻愪氦锛岄樆姝㈤噸澶嶇偣鍑�
+      if (this.isSubmitting) return;
+
+      // 寮�鍚叏灞�绂侀��
+      this.isSubmitting = true;
+      document.body.classList.add('submitting');
+
+      const that = this;
+
+      // 瀹氫箟涓�涓仮澶嶇姸鎬佺殑鍑芥暟
+      const resetState = () => {
+        that.isSubmitting = false;
+        document.body.classList.remove('submitting');
+      };
+
+      if (!that.assignFileStream.status==null || that.assignFileStream.status===undefined){
+        this.$message.warning('璇烽�夋嫨瀹℃壒鐘舵�侊紒')
+        return false;
+      }
+      if (!that.assignFileStream.approvalOpinion==null || that.assignFileStream.approvalOpinion===undefined) {
+        this.$message.warning('璇疯緭鍏ュ鎵规剰瑙侊紒')
+        return false;
+      }
+      // 瑙﹀彂琛ㄥ崟楠岃瘉
+      this.form.validateFields((err, values) => {
+        if (err) {
+          resetState(); // 楠岃瘉澶辫触锛屾仮澶嶇姸鎬�
+          return;
+        }
+        if (!err) {
+          that.confirmLoading = true;
+          let url=this.url.approve
+          let method = 'post';
+          let flowTaskVo = {}
+          flowTaskVo.status=that.assignFileStream.status;
+          flowTaskVo.approvalOpinion =that.assignFileStream.approvalOpinion;
+          flowTaskVo.comment =that.assignFileStream.approvalOpinion;
+          flowTaskVo.dataId = this.selectInboundOrderData.dataId
+          flowTaskVo.taskId = this.selectInboundOrderData.id
+          flowTaskVo.userId = this.selectInboundOrderData.assignee
+          flowTaskVo.instanceId = this.selectInboundOrderData.procInstId
+          flowTaskVo.targetKey = this.selectInboundOrderData.taskDefKey
+          flowTaskVo.values = this.selectInboundOrderData.variables
+          flowTaskVo.assignee = this.selectInboundOrderData.assignee
+          console.log("琛ㄥ崟鎻愪氦鏁版嵁",flowTaskVo)
+          httpAction(url,flowTaskVo,method).then((res)=>{
+            if(res.success){
+              that.$message.success(res.message);
+              that.visible = false
+              //鍒锋柊琛ㄦ牸
+              that.$emit('searchReset')
+            }else{
+              that.$message.warning(res.message);
+            }
+          })
+            .catch((error) => {
+              console.error(error);
+              that.$message.error('鎻愪氦澶辫触');
+            })
+            .finally(() => {
+              that.confirmLoading = false;
+              resetState(); // 璇锋眰缁撴潫锛屾仮澶嶇姸鎬�
+            });
+        }
+
+      })
+    },
+    getAllApproveData(item) {
+      this.visible = true
+      this.loading = true
+      this.flowData = item
+
+      getAction(this.url.queryHisTaskList, {procInstId: item.procInsId}).then(res=>{
+        if(res.success){
+          this.hitaskDataSource = res.result
+        }
+      })
+      getAction(this.url.queryInboundOrder, {id: item.dataId}).then((res => {
+        if (res.success) {
+          this.tableRowRecord = res.result.records[0]
+        }
+      }))
+      getAction(this.url.queryInboundDetailList, {inboundOrderId: item.dataId}).then(res => {
+        if (res.success) {
+          this.dataSource = res.result.records
+          if (res.result.total) {
+            this.ipagination.total = res.result.total
+          } else {
+            this.ipagination.total = 0
+          }
+        } else {
+          this.$message.warning(res.message)
+        }
+      }).finally(() => {
+        this.loading = false
+      })
+    }
+  }
+}
+</script>
+<style scoped>
+/* 鍏ㄥ眬绂侀�夋牱寮� - 浣滅敤浜庢暣涓〉闈� */
+html.submitting,
+html.submitting body {
+  pointer-events: none !important;
+  cursor: wait !important;
+}
+
+/* 钂欏眰鏁堟灉澧炲己 */
+html.submitting::before {
+  content: '';
+  position: fixed;
+  top: 0;
+  left: 0;
+  right: 0;
+  bottom: 0;
+  background: rgba(255, 255, 255, 0.5);
+  z-index: 9998;
+}
+
+/* 鍔犺浇鎸囩ず鍣� - 鏇存槑鏄剧殑瑙嗚鍙嶉 */
+html.submitting::after {
+  content: '鎻愪氦涓�...';
+  position: fixed;
+  top: 50%;
+  left: 50%;
+  transform: translate(-50%, -50%);
+  background: #1890ff;
+  color: white;
+  padding: 10px 20px;
+  border-radius: 4px;
+  z-index: 9999;
+}
+
+/* 绂佺敤鐘舵�佹寜閽牱寮� */
+.disabled-btn {
+  opacity: 0.6;
+  cursor: not-allowed !important;
+}
+.shallow-hr {
+  border: 0;
+  height: 1px; /* 鍒嗙晫绾跨殑楂樺害 */
+  background-color: rgba(0, 0, 0, 0.1); /* 浣跨敤 RGBA 棰滆壊锛屽苟璁剧疆杈冧綆鐨勯�忔槑搴� */
+  margin: 20px 0; /* 鍒嗙晫绾夸笂涓嬬殑澶栬竟璺� */
+}
+.btn-custom {
+  background-color: #4CAF50; /* 缁胯壊鑳屾櫙 */
+  color: white; /* 鐧借壊鏂囧瓧 */
+  border: none; /* 鏃犺竟妗� */
+  padding: 5px 15px; /* 鍐呰竟璺� */
+  text-align: center; /* 鏂囧瓧灞呬腑 */
+  text-decoration: none; /* 鏃犱笅鍒掔嚎 */
+  display: inline-block; /* 琛屽唴鍧楀厓绱� */
+  font-size: 12px; /* 瀛椾綋澶у皬 */
+  margin: 4px 2px; /* 澶栬竟璺� */
+  cursor: pointer; /* 榧犳爣鎮仠鏃舵樉绀烘墜鍨� */
+  border-radius: 4px; /* 鍦嗚杈规 */
+}
+
+.bold-large-label {
+  font-weight: bold;
+  font-size: 20px; /* 鎴栦綘闇�瑕佺殑浠讳綍澶у皬 */
+}
+.left_qiu{
+  position: absolute;
+  left: -74px;
+  top: 0;
+  width:54px;
+  border-radius: 50%;
+  height:54px;
+  font-size: 13px;
+  margin: auto;
+  display: flex;
+  flex-wrap: wrap;
+  align-items: center;
+  justify-content: center;
+  background: #0099ff;
+  transform: translate(0, 0);
+}
+/deep/ .ant-timeline-item-tail{
+  left: -29px !important;
+}
+.left_qiu span{
+  width: 3em;
+  display: block;
+  color: #fff;
+  text-align: center;
+}
+.img{
+  width: 75%;
+}
+
+.wrap{
+  clear: both;
+  width: 100%;
+  display: flex;
+  height: 50px;
+  border: 1px solid #ccc;
+  /* background-color: aqua; */
+}
+.box{
+  width:21%;
+  height:50px;
+  border-right: 1px solid #ccc;
+  line-height: 50px;
+  /* background: red; */
+  text-align:center;
+  margin: auto;
+}
+
+@import '~@assets/less/common.less';
+</style>
\ No newline at end of file
diff --git a/src/views/tms/WarehouseList.vue b/src/views/tms/WarehouseList.vue
index 9be0090..9466732 100644
--- a/src/views/tms/WarehouseList.vue
+++ b/src/views/tms/WarehouseList.vue
@@ -268,7 +268,20 @@
     },
     methods: {
       handleAdd: function () {
-        const nextSeq = Number(this.dataSource[this.dataSource.length - 1].seq) + 1
+        let nextSeq = 0;
+        // 瀹夊叏鐨勫啓娉�
+        if (this.dataSource && this.dataSource.length > 0) {
+          const lastItem = this.dataSource[this.dataSource.length - 1];
+          if (lastItem && lastItem.seq !== undefined) {
+            nextSeq = Number(lastItem.seq) + 1;
+          } else {
+            // 澶勭悊鏈�鍚庝竴涓厓绱犱笉瀛樺湪seq鐨勬儏鍐�
+            nextSeq = 0; // 鎴栧叾浠栭粯璁ゅ��
+          }
+        } else {
+          // 澶勭悊鏁扮粍涓虹┖鐨勬儏鍐�
+          nextSeq = 0; // 鎴栧叾浠栭粯璁ゅ��
+        }
         this.$refs.modalForm.add(nextSeq);
         this.$refs.modalForm.title = "鏂板";
         this.$refs.modalForm.disableSubmit = false;

--
Gitblit v1.9.3