莫海杰 3 months ago
parent
commit
55dd5d1f1f

+ 35 - 4
SCADA_DAQ.EicpApp/src/api/oldData.js

@@ -176,19 +176,19 @@ export function delItemLowTableRowAPI(operateNo) {
   })
 }
 
-export function getItemUpTaskTableAPI(page, filter, showMerged) {
+export function getItemUpTaskTableAPI(page, filter, showMerged, taskState) {
   return request({
     url: process.env.VUE_APP_HOST + '/api/RpcInvoke',
     method: 'post',
-    data: getRpcPara('GetItemUpTaskTable', [page, filter, showMerged])
+    data: getRpcPara('GetItemUpTaskTable', [page, filter, showMerged, taskState])
   })
 }
 
-export function getItemLowTaskTableAPI(page, filter, showMerged) {
+export function getItemLowTaskTableAPI(page, filter, showMerged, taskState) {
   return request({
     url: process.env.VUE_APP_HOST + '/api/RpcInvoke',
     method: 'post',
-    data: getRpcPara('GetItemLowTaskTable', [page, filter, showMerged])
+    data: getRpcPara('GetItemLowTaskTable', [page, filter, showMerged, taskState])
   })
 }
 
@@ -328,3 +328,34 @@ export function delItemUpItemWorkNoAPI(itemWorkNo, tag) {
   })
 }
 
+export function upLoadLowShelfTaskAPI(taskNoList) {
+  return request({
+    url: process.env.VUE_APP_HOST + '/api/RpcInvoke',
+    method: 'post',
+    data: getRpcPara('UpLoadLowShelfTask', [taskNoList])
+  })
+}
+
+export function updateItemTaskSourceLocationAPI() {
+  return request({
+    url: process.env.VUE_APP_HOST + '/api/RpcInvoke',
+    method: 'post',
+    data: getRpcPara('UpdateItemTaskSourceLocation', [])
+  })
+}
+
+export function upLoadUpShelfTaskAPI(taskNoList) {
+  return request({
+    url: process.env.VUE_APP_HOST + '/api/RpcInvoke',
+    method: 'post',
+    data: getRpcPara('UpLoadUpShelfTask', [taskNoList])
+  })
+}
+
+export function operateMachineTaskListAPI(taskNoList) {
+  return request({
+    url: process.env.VUE_APP_HOST + '/api/RpcInvoke',
+    method: 'post',
+    data: getRpcPara('OperateMachineTaskList', [taskNoList])
+  })
+}

+ 26 - 26
SCADA_DAQ.EicpApp/src/router/index.js

@@ -73,18 +73,18 @@ export const constantRoutes = [
       //     icon: 'example'
       //   }
       // },
-      {
-        name: 'ItemLow',
-        path: 'item-low',
-        // path: 'test-beach',
-        hidden: false,
-        alwaysShow: false,
-        component: () => import('@/views/customer/item-low/index.vue'),
-        meta: {
-          title: '物料下架',
-          icon: 'example'
-        }
-      },
+      // {
+      //   name: 'ItemLow',
+      //   path: 'item-low',
+      //   // path: 'test-beach',
+      //   hidden: false,
+      //   alwaysShow: false,
+      //   component: () => import('@/views/customer/item-low/index.vue'),
+      //   meta: {
+      //     title: '物料下架',
+      //     icon: 'example'
+      //   }
+      // },
       {
         name: 'ItemLowTask',
         path: 'item-low-task',
@@ -93,22 +93,22 @@ export const constantRoutes = [
         alwaysShow: false,
         component: () => import('@/views/customer/item-low-task/index.vue'),
         meta: {
-          title: '下架合并',
-          icon: 'example'
-        }
-      },
-      {
-        name: 'ItemUp',
-        path: 'item-up',
-        // path: 'test-beach',
-        hidden: false,
-        alwaysShow: false,
-        component: () => import('@/views/customer/item-up/index.vue'),
-        meta: {
-          title: '物料上架',
+          title: '下架物料',
           icon: 'example'
         }
       },
+      // {
+      //   name: 'ItemUp',
+      //   path: 'item-up',
+      //   // path: 'test-beach',
+      //   hidden: false,
+      //   alwaysShow: false,
+      //   component: () => import('@/views/customer/item-up/index.vue'),
+      //   meta: {
+      //     title: '物料上架',
+      //     icon: 'example'
+      //   }
+      // },
       {
         name: 'ItemUpTask',
         path: 'item-up-task',
@@ -117,7 +117,7 @@ export const constantRoutes = [
         alwaysShow: false,
         component: () => import('@/views/customer/item-up-task/index.vue'),
         meta: {
-          title: '上架合并',
+          title: '上架物料',
           icon: 'example'
         }
       },

+ 95 - 27
SCADA_DAQ.EicpApp/src/views/customer/inventory/index.vue

@@ -2,10 +2,10 @@
   <div class="app-container-min">
     <div class="search-container">
       <!--      <el-select v-model.trim="searchInfo.SourceLocation" filterable placeholder="库位号" clearable style="width: 130px;margin-right: 2px">-->
-      <!--        <el-option v-for="item in sourceLocations" :key="item" :label="item" :value="item" />-->
+      <!--        <el-option v-for="item in showSourceLocations" :key="item" :label="item" :value="item" />-->
       <!--      </el-select>-->
-      <el-input size="small" v-model="searchInfo.SourceLocation" placeholder="库位号" clearable style="width: 130px;margin-right: 2px" autocomplete="off" />
-      <el-input size="small" v-model.trim="searchInfo.ItemCode" placeholder="物料号" clearable style="width: 130px;margin-right: 2px" />
+      <el-input v-model="searchInfo.SourceLocation" size="small" placeholder="库位号" clearable style="width: 130px;margin-right: 2px" autocomplete="off" />
+      <el-input v-model.trim="searchInfo.ItemCode" size="small" placeholder="物料号" clearable style="width: 130px;margin-right: 2px" />
       <el-input v-model.trim="searchInfo.ItemName" size="small" placeholder="物料名" clearable style="width: 130px;margin-right: 2px" />
       <el-button size="small" style="vertical-align: top" type="primary" icon="el-icon-search" @click="handleSearch(1,pageInfo.PageSize)" />
       <el-button size="small" :disabled="username !== 'admin'" style="vertical-align: top; margin-left: 20px" type="primary" @click="showAddEditForm(1)">新 增</el-button>
@@ -20,10 +20,24 @@
       </el-upload>
     </div>
 
-    <el-dialog width="26%" :title="formConfig.title" :visible.sync="formConfig.isShowForm">
+    <el-dialog width="26%" :title="formConfig.title" :visible.sync="formConfig.isShowForm" :close-on-click-modal="false">
       <el-form ref="form" :model="form" :rules="rules" label-width="80px">
         <el-form-item label="库位号" prop="SourceLocation">
-          <el-input v-model="form.SourceLocation" autocomplete="off" />
+          <vxe-pulldown ref="pulldownRef" destroy-on-close>
+            <template #default style="width: 100%">
+              <vxe-input v-model="form.SourceLocation" placeholder="" @focus="focusEvent" @keyup="keyupEvent" @blur="blurEvent" style="width: 100%"/>
+            </template>
+            <template #dropdown style="width: 100%">
+              <vxe-list height="200" class="my-dropdown2" :data="showSourceLocations" auto-resize style="width: 100%">
+                <template #default="{ items }">
+                  <div v-for="item in items" :key="item" class="list-item2" @click="selectEvent(item)">
+                    <span>{{ item }}</span>
+                  </div>
+                </template>
+              </vxe-list>
+            </template>
+          </vxe-pulldown>
+          <!--          <el-input v-model="form.SourceLocation" autocomplete="off" />-->
         </el-form-item>
         <el-form-item label="仓库" prop="WarehouseCode">
           <el-input v-model="form.WarehouseCode" autocomplete="off" />
@@ -46,6 +60,7 @@
       </el-form>
       <div slot="footer" class="dialog-footer">
         <el-button @click="formConfig.isShowForm = false">取 消</el-button>
+        <el-button v-if="formConfig.isShowAdd" type="primary" @click="handleGetPaste()">粘 贴</el-button>
         <el-button v-if="formConfig.isShowAdd" type="primary" @click="handleAddEditRow(1)">新 增</el-button>
         <el-button v-if="formConfig.isShowEdit" type="primary" @click="handleAddEditRow(0)">编 辑</el-button>
       </div>
@@ -108,26 +123,29 @@ import {
 } from '@/api/oldData'
 
 export default {
+  name: 'Inventory',
   data() {
-    return {
-      sourceLocations: (function() {
-        const vie = (r, c, l) => {
-          const list = []
-          for (let layer = 1; layer <= l; layer++) {
-            for (let col = 1; col <= c; col++) {
-              const layerStr = layer < 10 ? '0' + layer : layer
-              const colStr = col < 10 ? '00' + col : col < 100 ? '0' + col : col
-              list.push(`0${r}-${colStr}-${layerStr}`)
-            }
+    const sourceLocationList = (function() {
+      const vie = (r, c, l) => {
+        const list = []
+        for (let layer = 1; layer <= l; layer++) {
+          for (let col = 1; col <= c; col++) {
+            const layerStr = layer < 10 ? '0' + layer : layer
+            const colStr = col < 10 ? '00' + col : col < 100 ? '0' + col : col
+            list.push(`L-0${r}-${colStr}-${layerStr}`)
           }
-          return list
         }
-        const r1 = vie(1, 46, 10)
-        const r2 = vie(2, 46, 10)
-        const r3 = vie(3, 64, 16)
-        const r4 = vie(4, 64, 16)
-        return [...r1, ...r2, ...r3, ...r4]
-      }()),
+        return list
+      }
+      const r1 = vie(1, 46, 10)
+      const r2 = vie(2, 46, 10)
+      const r3 = vie(3, 64, 16)
+      const r4 = vie(4, 64, 16)
+      return [...r1, ...r2, ...r3, ...r4]
+    }())
+    return {
+      baseSourceLocations: sourceLocationList,
+      showSourceLocations: [...sourceLocationList],
       onHandStateEnum: {
         1: '未质检',
         10: '合格',
@@ -181,6 +199,7 @@ export default {
         { label: '序号', prop: 'RowNum', width: 80 },
         { label: '仓库', prop: 'WarehouseCode', width: 100 },
         { label: '托盘号', prop: 'SourceLocation', width: 160 },
+        { label: '货架号', prop: 'LocationName', width: 260 },
         { label: '物料号', prop: 'ItemCode', width: 110 },
         { label: '物料名', prop: 'ItemName' },
         { label: '数量', prop: 'Qty', width: 80 },
@@ -202,6 +221,54 @@ export default {
     this.getInventoryTable()
   },
   methods: {
+    focusEvent() {
+      const $pulldown = this.$refs.pulldownRef
+      if ($pulldown) {
+        $pulldown.showPanel()
+      }
+    },
+    keyupEvent() {
+      this.showSourceLocations = this.form.SourceLocation ? this.baseSourceLocations.filter((item) => item.indexOf(this.form.SourceLocation) > -1) : this.baseSourceLocations
+    },
+    blurEvent() {
+      if (this.baseSourceLocations.filter(item => item === this.form.SourceLocation).length === 0) {
+        this.form.SourceLocation = ''
+      }
+    },
+    selectEvent(item) {
+      const $pulldown = this.$refs.pulldownRef
+      if ($pulldown) {
+        this.form.SourceLocation = item
+        $pulldown.hidePanel().then(() => {
+          this.list = this.baseSourceLocations
+        })
+      }
+    },
+    async handleGetPaste() {
+      const clipboardItems = await window.navigator.clipboard.read()
+      let textHtml, textPlain
+      for (const clipboardItem of clipboardItems) {
+        for (const type of clipboardItem.types) {
+          const item = await clipboardItem.getType(type)
+          if (item && item.type === 'text/html') {
+            textHtml = await item.text()
+          }
+          if (item && item.type === 'text/plain') {
+            textPlain = await item.text()
+          }
+        }
+      }
+      if (textPlain.indexOf('仓库') != -1 && textPlain.indexOf('物料号') != -1 && textPlain.indexOf('物料名') != -1 && textPlain.indexOf('单位') != -1) {
+        const pa = JSON.parse(textPlain)
+        this.form.WarehouseCode = pa['仓库']
+        this.form.ItemCode = pa['物料号']
+        this.form.ItemName = pa['物料名']
+        this.form.UnitCode = pa['单位']
+        this.form.Qty = 0
+      } else {
+        this.$message.error('复制内容有误')
+      }
+    },
     async getInventoryTable() {
       this.tableLoading = true
       let { Data: res } = await getInventoryTableAPI(this.pageInfo, this.searchInfo)
@@ -336,12 +403,13 @@ export default {
             })
             const outData = XLSX.utils.sheet_to_json(wb.Sheets[wb.SheetNames[0]])
             const importSheet = outData.map(item => ({
-              WarehouseCode: item['库存地点'],
-              SourceLocation: item['库存仓位'],
-              ItemCode: item['物料编码'],
-              ItemName: item['物料描述'],
+              WarehouseCode: item['库'],
+              SourceLocation: item['托盘号'],
+              ItemCode: item['物料'],
+              ItemName: item['物料'],
               UnitCode: item['单位'],
-              Qty: item['SAP库存'] == '' ? 0 : item['SAP库存'] == null ? 0 : item['SAP库存'],
+              LocationName: item['货架号'],
+              Qty: item['数量'] == '' ? 0 : item['数量'] == null ? 0 : item['数量'],
               Remark: item['序号']
             }))
             const res = await importInventoryAPI(importSheet)

+ 375 - 134
SCADA_DAQ.EicpApp/src/views/customer/item-low-task/index.vue

@@ -2,79 +2,100 @@
   <div class="app-container-min">
     <div class="search-container">
       <el-input v-model.trim="searchInfo.BillNo" size="small" placeholder="发运号" clearable style="width: 150px;margin-right: 2px" />
-      <el-input v-model.trim="searchInfo.TaskNo" size="small" placeholder="任务号" clearable style="width: 150px;margin-right: 2px" />
-      <el-input v-model.trim="searchInfo.WoNo" size="small" placeholder="工单号" clearable style="width: 150px;margin-right: 2px" />
+      <el-input v-model.trim="searchInfo.TaskNo" size="small" placeholder="任务号" clearable style="width: 150px;margin-right: 2px" @input="handleTaskNoPasteQuery" />
+      <el-input v-model.trim="searchInfo.WoNo" size="small" placeholder="工单号" clearable style="width: 150px;margin-right: 2px" @input="handleWoNoPasteQuery" />
       <el-input v-model.trim="searchInfo.ItemCode" size="small" placeholder="物料号" clearable style="width: 150px;margin-right: 2px" />
-      <el-select v-model="showMerged" size="small" placeholder="操作类型" style="width: 8%">
-        <el-option v-for="(value, key) in showMergedState" :key="key" :label="value" :value="key" />
+      <el-select v-model="searchInfo.WorkCenter" size="small" placeholder="工作中心" filterable clearable style="width: 8%;margin-right: 2px">
+        <el-option
+          v-for="item in [
+            'DZNX 电装内线组', 'CJ 出机组', 'PART 部件维护用', 'XJ 下架组', 'SM 锁模组', 'BJ 钣金组',
+            'SZ 试制组', 'DZWX 电装外线组', 'SJ 试机组', 'LJHXZ LJ划线组', 'GW04 工位04', 'YZ 油制组',
+            'GW02 工位02', 'ST 射台组', 'GW01 工位01', 'BUST BU射台组', 'BUXJ BU下架组', 'JYZ 检验组', 'JCZ 锯床组', 'LJZCZ LJ锯床组' ]"
+          :key="item"
+          clearable
+          :label="item"
+          :value="item"
+        />
+      </el-select>
+      <el-select v-model="searchInfo.SourceLocationGroup" size="small" clearable placeholder="货架组" style="width: 6%;margin-right: 2px">
+        <el-option v-for="item in ['L', 'DQA', 'DQ']" :key="item" :label="item" :value="item" />
+      </el-select>
+      <el-select v-model="taskState" size="small" placeholder="操作类型" style="width: 6%;margin-right: 2px">
+        <el-option v-for="(value, key) in taskStateOp" :key="key" :label="value" :value="key" />
       </el-select>
       <el-button v-preventReClick size="small" style="vertical-align: top" type="primary" icon="el-icon-search" @click="handleSearch(1,pageInfo.PageSize)" />
-      <!--      <el-button v-preventReClick style="vertical-align: top" type="primary" :disabled="formList.length === 0" @click="mergeItemUpList">合并</el-button>-->
-      <el-button size="small" style="vertical-align: top; margin-left: 20px" type="primary" @click="showAddEditForm(1)">工单合并</el-button>
-      <!--      <el-button style="vertical-align: top; margin-left: 20px" type="primary" @click="showAddEditForm(0)">非工单合并</el-button>-->
+      <el-button size="small" style="vertical-align: top; margin-left: 20px" type="primary" @click="updateItemTaskSourceLocation(0)">任务库位</el-button>
+      <el-button :class="isMerged === true?'el-icon-document-remove':'el-icon-document'" size="small" style="vertical-align: top; margin-left: 20px" type="primary" @click="showMergeTable" />
+      <el-button size="small" style="vertical-align: top; margin-left: 20px" type="primary" :disabled="isOperateBtn" @click="operateList()">下发</el-button>
+      <el-button size="small" style="vertical-align: top; margin-left: 20px" type="primary" :disabled="isShowUpLoadBtn" @click="upLoadLowShelf()">上传</el-button>
     </div>
 
-    <el-dialog width="40%" :title="formConfig.title" :visible.sync="formConfig.isShowForm">
+    <el-dialog width="20%" :title="formConfig.title" :visible.sync="formConfig.isShowForm" :close-on-click-modal="false">
       <el-form ref="form" :model="form" :rules="rules" label-width="80px">
-        <el-form-item label="货架组" prop="SourceLocationTag">
-          <el-select v-model="form.SourceLocationTag" size="small" placeholder="">
-            <el-option v-for="item in ['DQA', 'L']" :key="item" :label="item" :value="item" />
-          </el-select>
+        <el-form-item label="任务号" prop="TaskNo">
+          <el-input v-model.trim="form.TaskNo" size="small" autocomplete="off" :disabled="true" />
         </el-form-item>
-        <el-form-item v-if="formConfig.isShowAdd" label="工单号" prop="WoNos">
-          <el-input v-model="form.WoNos" size="small" spellcheck="false" autocomplete="off" @input="handleWoNoPaste" />
+        <el-form-item label="实际数" prop="ActualQty">
+          <el-input v-model.trim="form.ActualQty" size="small" autocomplete="off" />
         </el-form-item>
       </el-form>
       <div slot="footer" class="dialog-footer">
         <el-button size="small" @click="formConfig.isShowForm = false">取 消</el-button>
-        <el-button v-if="formConfig.isShowAdd" v-preventReClick size="small" type="primary" @click="handleAddEditRow(1)">确认合并</el-button>
-        <el-button v-if="formConfig.isShowEdit" v-preventReClick size="small" type="primary" @click="handleAddEditRow(0)">确认合并</el-button>
+        <el-button v-if="formConfig.isShowAdd" v-preventReClick size="small" type="primary" @click="handleAddEditRow(1)">新增</el-button>
+        <el-button v-if="formConfig.isShowEdit" v-preventReClick size="small" type="primary" @click="handleAddEditRow(0)">编辑</el-button>
       </div>
     </el-dialog>
-
-    <el-table
-      v-if="table.length!==0"
-      v-loading="tableLoading"
-      element-loading-text="加载中"
-      element-loading-spinner="el-icon-loading"
-      :row-key="row=>row['ID']"
-      :data="table"
-      :cell-class-name="cellStyleF"
-      :row-class-name="rowClassNameF"
-      :row-style="rowStyleF"
-      border
-      fit
-      highlight-current-row
-      @select="selectRowF"
-      @select-all="selectAllRowF"
-      @header-click="copyText"
-    >
-      <el-table-column type="selection" width="55" align="center" />
-      <el-table-column
-        v-for="item in tableConfig"
-        :key="item.prop"
-        :label="item.label"
-        :prop="item.prop"
-        :width="item.width"
-        :show-overflow-tooltip="true"
-        align="center"
-      />
-      <el-table-column label="合并" align="center" width="50">
-        <template v-slot="scope">
-          {{ scope.row["IsMerged"] === false?'否':'是' }}
-        </template>
-      </el-table-column>
-      <el-table-column label="状态" align="center" width="50">
-        <template v-slot="scope">
-          {{ taskStateEnum[scope.row["State"]] }}
-        </template>
-      </el-table-column>
-    </el-table>
+    <div style="height: calc(92vh - 60px - 40px)">
+      <vxe-table
+        ref="xTable"
+        :loading="tableLoading"
+        border
+        :resizable="true"
+        show-overflow
+        show-header-overflow
+        show-footer-overflow
+        :footer-method="()=>[]"
+        height="auto"
+        :sort-config="{trigger: 'cell'}"
+        :scroll-x="{enabled: true, gt: 10}"
+        :scroll-y="{enabled: true, gt: 100}"
+        :header-cell-style="{
+          'text-align': 'center',
+          'height': '32px',
+          'background-color': '#fff'
+        }"
+        :row-style="rowStyle"
+        @checkbox-change="selectRow"
+        @checkbox-all="selectAllRow"
+        @cell-dblclick="copyItem"
+      >
+        <vxe-column
+          v-for="item in tableConfig"
+          :key="item.prop"
+          :field="item.prop"
+          :type="item.type"
+          :filter-method="item.filterMethod"
+          :filters="item.filter"
+          :sortable="item.sortable"
+          :title="item.label"
+          :width="item.width"
+          :fixed="item.fixed"
+          :formatter="item.formatter"
+          :show-overflow-tooltip="true"
+          align="center"
+        />
+        <vxe-column title="" width="40">
+          <template #default="{ row }">
+            <i class="vxe-icon-edit" style="color: #424242; cursor: pointer" @click="showAddEditForm(0, row)" />
+          </template>
+        </vxe-column>
+      </vxe-table>
+    </div>
     <div class="page">
       <el-pagination
         :current-page.sync="pageInfo.PageNum"
         :page-size="pageInfo.PageSize"
-        :page-sizes="[25, 40, 60, 100, 500, 1000]"
+        :page-sizes="[500, 1000, 1500, 2000]"
         layout="total, sizes, prev, pager, next, jumper"
         :total="totalPage"
         @size-change="handleSizeChange"
@@ -83,45 +104,87 @@
         @next-click="handleNextPage"
       />
     </div>
+
+    <!--    <vxe-table-->
+    <!--      ref="xTable"-->
+    <!--      v-loading="tableLoading"-->
+    <!--      element-loading-text="加载中"-->
+    <!--      border-->
+    <!--      show-overflow-->
+    <!--      height="770"-->
+    <!--      :scroll-x="{enabled: true, gt: 10}"-->
+    <!--      :scroll-y="{enabled: true, gt: 100}"-->
+    <!--      :header-cell-style="{-->
+    <!--        'text-align': 'center',-->
+    <!--        'height': '32px',-->
+    <!--      }"-->
+    <!--      :tree-config="{transform: true, rowField: 'id', parentField: 'parentId'}"-->
+    <!--      resizable-->
+    <!--      :data="table"-->
+    <!--      :row-style="rowStyle"-->
+    <!--    >-->
+    <!--      <vxe-column type="seq" width="100" tree-node  fixed="left"></vxe-column>-->
+    <!--      <vxe-column-->
+    <!--        v-for="item in tableConfig"-->
+    <!--        :key="item.prop"-->
+    <!--        :field="item.prop"-->
+    <!--        :type="item.type"-->
+    <!--        sortable-->
+    <!--        :title="item.label"-->
+    <!--        :width="item.width"-->
+    <!--        :fixed="item.fixed"-->
+    <!--        :show-overflow-tooltip="true"-->
+    <!--        align="center"-->
+    <!--      />-->
+    <!--    </vxe-table>-->
   </div>
 </template>
 
 <script>
 import {
-  mergeItemLowListAPI,
-  getItemLowTaskTableAPI
+  getItemLowTaskTableAPI,
+  upLoadLowShelfTaskAPI, updateItemTaskSourceLocationAPI, operateMachineTaskListAPI, addEditItemTaskTableRowAPI
 } from '@/api/oldData'
 export default {
+  name: 'ItemLowTask',
   data() {
     return {
       searchInfo: {
         BillNo: '',
         TaskNo: '',
         ItemCode: '',
-        WoNo: ''
+        WoNo: '',
+        SourceLocationGroup: '',
+        WorkCenter: ''
       },
-      showMerged: '0',
+      showMerged: '2',
+      isMerged: false,
       showMergedState: {
         '0': '未合并',
         '1': '已合并',
         '2': '不筛选'
       },
-      taskStateEnum: {
-        0: '创建',
-        1: '释放',
-        2: '指派',
-        3: '冻结',
-        4: '挂起',
-        5: '完工',
-        6: '关闭',
-        7: '执行中',
-        8: '异常',
-        9: '自动完工'
+      taskState: '0',
+      taskStateOp: {
+        '0': '创建',
+        '1': '释放',
+        '2': '指派',
+        '3': '冻结',
+        '4': '挂起',
+        '5': '完工',
+        '6': '关闭',
+        '7': '执行中',
+        '8': '异常',
+        '9': '自动完工',
+        '10': '不筛选'
       },
       formList: [],
       form: {
-        WoNos: '',
-        SourceLocationTag: ''
+        ID: 0,
+        ActualQty: 0,
+        ItemCode: '',
+        WoNo: '',
+        TaskNo: ''
       },
       formConfig: {
         isShowForm: false,
@@ -130,60 +193,135 @@ export default {
         title: ''
       },
       rules: {
-        SourceLocationTag: [
+        TaskNo: [
           { required: true, message: '不为空', trigger: 'blur' }
         ],
-        WoNos: [
-          { required: true, message: '不为空', trigger: 'blur' }
+        ActualQty: [
+          { required: true, pattern: /^(0|([1-9][0-9]*))(\.[\d]+)?$/, message: '非负数', trigger: 'blur' }
         ]
       },
       tableLoading: true,
       table: [],
-      tableConfig: [
-        { label: '批号', prop: 'ItemWorkNo', width: 125 },
-        { label: '发运号', prop: 'BillNo', width: 145 },
-        { label: '任务号', prop: 'TaskNo', width: 160 },
-        { label: '物料号', prop: 'ItemCode', width: 100 },
-        { label: '物料名', prop: 'ItemName' },
-        { label: '计划数', prop: 'PlannedQty', width: 80 },
-        { label: '实际数', prop: 'ActualQty', width: 80 },
-        { label: '仓库', prop: 'WarehouseCode', width: 60 },
-        // { label: '货架号', prop: 'SourceLocationTag', width: 160 },
-        { label: '货架', prop: 'SourceLocationGroup', width: 60 },
-        { label: '工单号', prop: 'WoNo', width: 125 },
-        { label: '工作中心', prop: 'WorkCenter', width: 140 },
-        { label: '单位', prop: 'UnitCode', width: 60 },
-        { label: '创建时间', prop: 'CreateTime', width: 160 }
-      ],
+      mergedTable: [],
+      noMergedTable: [],
+      tableConfig: (() => {
+        const taskState = { 0: '创建', 1: '释放', 2: '指派', 3: '冻结', 4: '挂起', 5: '完工', 6: '关闭', 7: '执行中', 8: '异常', 9: '自动完工' }
+        const workCenters = [
+          { value: 'DZNX 电装内线组', label: 'DZNX 电装内线组' },
+          { value: 'CJ 出机组', label: 'CJ 出机组' },
+          { value: 'PART 部件维护用', label: 'PART 部件维护用' },
+          { value: 'XJ 下架组', label: 'XJ 下架组' },
+          { value: 'SM 锁模组', label: 'SM 锁模组' },
+          { value: 'BJ 钣金组', label: 'BJ 钣金组' },
+          { value: 'DZWX 电装外线组', label: 'DZWX 电装外线组' },
+          { value: 'SZ 试制组', label: 'SZ 试制组' },
+          { value: 'SJ 试机组', label: 'SJ 试机组' },
+          { value: 'LJHXZ LJ划线组', label: 'LJHXZ LJ划线组' },
+          { value: 'GW04 工位04', label: 'GW04 工位04' },
+          { value: 'YZ 油制组', label: 'YZ 油制组' },
+          { value: 'GW02 工位02', label: 'GW02 工位02' },
+          { value: 'ST 射台组', label: 'ST 射台组' },
+          { value: 'GW01 工位01', label: 'GW01 工位01' },
+          { value: 'BUST BU射台组', label: 'BUST BU射台组' },
+          { value: 'BUXJ BU下架组', label: 'BUXJ BU下架组' },
+          { value: 'JYZ 检验组', label: 'JYZ 检验组' },
+          { value: 'JCZ 锯床组', label: 'JCZ 锯床组' },
+          { value: 'LJZCZ LJ锯床组', label: 'LJZCZ LJ锯床组' }]
+        return [
+          { label: '', prop: 'checkbox', type: 'checkbox', width: 45, fixed: 'left' },
+          // { label: '批号', prop: 'ItemWorkNo', width: 125, fixed: 'left' },
+          { label: '工单号', prop: 'WoNo', width: 125, fixed: 'left', sortable: true },
+          { label: '工作中心', prop: 'WorkCenter', width: 140, fixed: 'left', sortable: true, filterMethod: ({ value, row }) => value == row.WorkCenter, filter: workCenters },
+          { label: '物料号', prop: 'ItemCode', width: 100, fixed: 'left', sortable: true },
+          { label: '物料名', prop: 'ItemName', width: 420, fixed: 'left' },
+          { label: '计划数', prop: 'PlannedQty', width: 70, fixed: 'left' },
+          { label: '实际数', prop: 'ActualQty', width: 70, fixed: 'left' },
+          { label: '仓库', prop: 'WarehouseCode', width: 60, fixed: 'left' },
+          { label: '任务库位', prop: 'SourceLocation', width: 130, fixed: 'left', sortable: true, filterMethod: ({ value, row }) => (value.length < row.SourceLocation?.length && row.SourceLocation != null && row.SourceLocation != ''), filter: [{ value: '', label: '有库位' }] },
+          { label: '货架号', prop: 'SourceLocationTag', width: 150, sortable: true },
+          // { label: '货架', prop: 'SourceLocationGroup', width: 60 },
+          { label: '状态', prop: 'State', width: 72, sortable: true, formatter: ({ row }) => taskState[row.State] },
+          { label: '备注', prop: 'ErrorMsg', width: 260, sortable: true },
+          { label: '单位', prop: 'UnitCode', width: 60 },
+          { label: '创建时间', prop: 'CreateTime', width: 160, sortable: true },
+          { label: '结束时间', prop: 'EndDate', width: 160, sortable: true },
+          { label: '发运号', prop: 'BillNo', width: 145, sortable: true },
+          { label: '任务号', prop: 'TaskNo', width: 160, sortable: true }
+        ]
+      })(),
       pageInfo: {
         PageNum: 1,
-        PageSize: 25
+        PageSize: 500
       },
       totalPage: 0,
       currentRowF: null,
-      currentRowBillNoColorF: {}
+      currentRowBillNoColorF: {},
+      isShowUpLoadBtn: true,
+      isOperateBtn: true
+    }
+  },
+  watch: {
+    formList: {
+      immediate: true,
+      deep: true,
+      handler(newVal, oldVal) {
+        this.isOperateBtn = newVal.length == 0
+        if (this.isMerged == true || newVal.length == 0) {
+          this.isShowUpLoadBtn = true
+        } else {
+          this.isShowUpLoadBtn = newVal.filter(e => e.SourceLocation == '' || e.SourceLocation == null).length > 0
+        }
+      }
     }
   },
   created() {
-    this.getInventoryTable()
+    this.getTable()
   },
   methods: {
-    cellStyleF({ row, column, rowIndex, columnIndex }) {
-      return row['State'] === 6 ? 'closed' : 'no-closed'
-    },
-    rowClassNameF({ row }) {
-      // eslint-disable-next-line no-prototype-builtins
-      if (!this.currentRowBillNoColorF.hasOwnProperty(row['BillNo'])) {
-        const keys = Object.keys(this.currentRowBillNoColorF)
-        const lastKey = keys[keys.length - 1]
-        this.currentRowBillNoColorF[row['BillNo']] = this.currentRowBillNoColorF[lastKey] === 'white-row' ? 'black-row' : 'white-row'
-      } else {
-        return this.currentRowBillNoColorF[row['BillNo']]
+    rowStyle({ row }) {
+      if (row['SourceLocation'] == '' || row['SourceLocation'] == null) {
+        return { 'color': '#e35f68' }
       }
     },
-
+    mergeTable(data) {
+      const merged = {}
+      data.forEach(item => {
+        const key = `${item.WarehouseCode}_${item.ItemCode}`
+        if (!merged[key]) {
+          merged[key] = {
+            TaskNo: item.TaskNo,
+            WoNo: item.WoNo,
+            ActualQty: item.ActualQty,
+            PlannedQty: item.PlannedQty,
+            BillNo: item.BillNo,
+            ItemCode: item.ItemCode,
+            ItemName: item.ItemName,
+            WorkCenter: item.WorkCenter,
+            WarehouseCode: item.WarehouseCode,
+            SourceLocationGroup: item.SourceLocationGroup,
+            SourceLocationTag: item.SourceLocationTag,
+            SourceLocation: item.SourceLocation,
+            UnitCode: item.UnitCode
+          }
+        } else {
+          merged[key].ActualQty += item.ActualQty
+          merged[key].PlannedQty += item.PlannedQty
+          merged[key].TaskNo += '/' + item.TaskNo
+          merged[key].WoNo += '/' + item.WoNo
+          merged[key].BillNo += '/' + item.BillNo
+        }
+      })
+      return Object.values(merged)
+    },
+    handleTaskNoPasteQuery() {
+      const items = this.searchInfo.TaskNo.split(/\s+/).filter(item => item.trim() != '').sort((a, b) => a.localeCompare(b))
+      this.searchInfo.TaskNo = items.map(item => `${item.trim()}`).join(',')
+    },
+    handleWoNoPasteQuery() {
+      const items = this.searchInfo.WoNo.split(/\s+/).filter(item => item.trim() != '').sort((a, b) => a.localeCompare(b))
+      this.searchInfo.WoNo = items.map(item => `${item.trim()}`).join(',')
+    },
     copyText(column) {
-      // console.log(event)
       // 双击复制
       if (column.property === 'WoNo') {
         // 获取姓名列的所有数据
@@ -210,26 +348,52 @@ export default {
         this.$message.success('工单号已复制到剪贴板')
       }
     },
-    // 父表当前行颜色
-    rowStyleF({ row }) {
-      if (this.currentRowF !== null && this.currentRowF['ID'] === row['ID']) {
-        // 此处返回选中行的样式对象,按需设置
-        return {
-          'background-color': 'rgba(64,158,255,0.39)',
-          'color': '#ffffff'
-        }
-      }
-    },
     handleWoNoPaste() {
-      const items = this.form.WoNos.split(/\s+/).filter(item => item.trim() != '')
+      const items = this.form.WoNos.split(/\s+/).filter(item => item.trim() != '').sort((a, b) => a.localeCompare(b))
       this.form.WoNos = items.map(item => `${item.trim()}`).join(',')
     },
-    async getInventoryTable() {
+    copyItem({ row }) {
+      // 创建一个虚拟的textarea元素,并设置其值
+      const textarea = document.createElement('textarea')
+      textarea.value = `{"物料号":"${row.ItemCode}", "物料名":"${row.ItemName}", "仓库":"${row.WarehouseCode}", "单位": "${row.UnitCode}"}`
+      textarea.setAttribute('readonly', '')
+      textarea.style.position = 'absolute'
+      textarea.style.left = '-9999px'
+
+      // 将textarea添加到DOM中并选中文本
+      document.body.appendChild(textarea)
+      textarea.select()
+      document.execCommand('copy')
+
+      // 清理掉虚拟元素
+      document.body.removeChild(textarea)
+
+      // 提示复制成功
+      this.$message.success('物料已复制到剪贴板')
+    },
+    showMergeTable() {
+      this.isMerged = !this.isMerged
+      this.formList = []
+      this.$nextTick(async() => {
+        if (this.isMerged === true) {
+          this.table = this.mergedTable
+        } else {
+          this.table = this.noMergedTable
+        }
+        await this.$refs.xTable.loadData(this.table)
+      })
+    },
+    async getTable() {
       this.tableLoading = true
-      let { Data: res } = await getItemLowTaskTableAPI(this.pageInfo, this.searchInfo, this.showMerged)
+      let { Data: res } = await getItemLowTaskTableAPI(this.pageInfo, this.searchInfo, this.showMerged, this.taskState)
       res = res == null ? [] : res
+      this.noMergedTable = res
+      this.mergedTable = this.mergeTable(res)
       this.table = res
+      this.isMerged = false
+      this.formList = []
       this.totalPage = res.length === 0 ? 0 : res[0]['Total']
+      await this.$refs.xTable.loadData(this.table)
       this.tableLoading = false
     },
     // 查询
@@ -237,10 +401,15 @@ export default {
       this.tableLoading = true
       this.pageInfo.PageNum = pageNumVal
       this.pageInfo.PageSize = pageSizeVal
-      const { Data: res } = await getItemLowTaskTableAPI(this.pageInfo, this.searchInfo, this.showMerged)
+      const { Data: res } = await getItemLowTaskTableAPI(this.pageInfo, this.searchInfo, this.showMerged, this.taskState)
       this.totalPage = res?.length === 0 ? 0 : res[0]['Total']
       this.$nextTick(() => {
+        this.noMergedTable = res
+        this.mergedTable = this.mergeTable(res)
         this.table = res
+        this.isMerged = false
+        this.formList = []
+        this.$refs.xTable.loadData(this.table)
       })
       this.tableLoading = false
     },
@@ -268,13 +437,19 @@ export default {
       this.formConfig.isShowAdd = action === 1
       if (action === 1) {
         this.form = {
-          WoNos: '',
-          SourceLocationTag: ''
+          ID: 0,
+          TaskNo: '',
+          ItemCode: '',
+          WoNo: '',
+          ActualQty: ''
         }
       } else {
         this.form = {
-          WoNos: null,
-          SourceLocationTag: ''
+          ID: row['ID'],
+          TaskNo: row['TaskNo'],
+          ItemCode: row['TaskNo'],
+          WoNo: row['WoNo,.'],
+          ActualQty: row['ActualQty']
         }
       }
     },
@@ -284,8 +459,8 @@ export default {
         if (valid) {
           this.tableLoading = true
           this.formConfig.isShowForm = false
-          const res = await mergeItemLowListAPI(this.form.WoNos, this.form.SourceLocationTag)
-          await this.getInventoryTable()
+          const res = await addEditItemTaskTableRowAPI(action, this.form)
+          await this.getTable()
           this.$message({
             type: res['IsSucceed'] === false ? 'error' : 'success',
             message: res['Message']
@@ -297,17 +472,76 @@ export default {
     // 删除 此处调接口
     // async mergeItemUpList() {
     //   const res = await mergeItemLowListAPI(this.formList)
-    //   await this.getInventoryTable()
+    //   await this.getTable()
     //   this.$message({
     //     type: res['IsSucceed'] === false ? 'error' : 'success',
     //     message: res['Message']
     //   })
     // },
-    selectRowF(rows) {
-      this.formList = rows
+    selectRow({ checked }) {
+      this.formList = this.$refs.xTable.getCheckboxRecords()
+    },
+    selectAllRow({ checked }) {
+      this.formList = this.$refs.xTable.getCheckboxRecords()
+    },
+    async upLoadLowShelf() {
+      this.tableLoading = true
+      const taskNos = []
+      if (this.formList.length !== 0) {
+        this.formList.forEach(item => {
+          taskNos.push(item.TaskNo)
+        })
+      }
+      const res = await upLoadLowShelfTaskAPI(taskNos)
+      await this.getTable()
+      this.$message({
+        showClose: true,
+        duration: 60000,
+        type: res['IsSucceed'] === false ? 'error' : 'success',
+        message: res['Message']
+      })
+      this.tableLoading = false
     },
-    selectAllRowF(rows) {
-      this.formList = rows
+    async updateItemTaskSourceLocation() {
+      this.tableLoading = true
+      const res = await updateItemTaskSourceLocationAPI()
+      this.$message({
+        type: res['IsSucceed'] === false ? 'error' : 'success',
+        message: res['Message']
+      })
+      await this.getTable()
+      this.tableLoading = false
+    },
+    async operateList() {
+      const sourceLocationItem = []
+      let list = this.formList.filter(t => t.SourceLocation != '' && t.SourceLocation != null)
+      if (list.length == 0) {
+        this.$message({
+          showClose: true,
+          type: 'error',
+          message: '暂无可下发的库位'
+        })
+        return null
+      }
+      list = Array.from(list.reduce((map, obj) => map.set(obj.ItemCode, obj), new Map()).values())
+      const dic = {}
+      list.forEach((item, index) => {
+        if (dic[item.SourceLocation]) {
+          dic[item.SourceLocation].ItemCode += `  ${item.ItemCode} `
+          dic[item.SourceLocation].ItemName += `  ${item.ItemName} `
+        } else {
+          dic[item.SourceLocation] = { SourceLocation: item.SourceLocation, ItemCode: `  ${item.ItemCode} `, ItemName: `  ${item.ItemName} ` }
+        }
+      })
+      for (const dicKey in dic) {
+        sourceLocationItem.push(dic[dicKey])
+      }
+      const res = await operateMachineTaskListAPI(sourceLocationItem)
+      this.$message({
+        showClose: true,
+        type: res['IsSucceed'] === false ? 'error' : 'success',
+        message: res['Message']
+      })
     }
   }
 
@@ -329,7 +563,7 @@ export default {
 ::v-deep .no-upload{
 }
 ::v-deep .closed{
-  color: #e70f10;
+  color: #c52a2a;
   cursor: default;
 }
 ::v-deep .no-closed{
@@ -360,4 +594,11 @@ export default {
     margin-bottom: 18px;
   }
 }
+::v-deep .vxe-table--render-default .vxe-body--column.col--ellipsis, .vxe-table--render-default .vxe-footer--column.col--ellipsis, .vxe-table--render-default .vxe-header--column.col--ellipsis, .vxe-table--render-default.vxe-editable .vxe-body--column {
+  height: 32px;
+}
+::v-deep .vxe-table--header th{
+  height: 32px;
+}
+
 </style>

+ 40 - 12
SCADA_DAQ.EicpApp/src/views/customer/item-low/index.vue

@@ -16,8 +16,10 @@
         />
       </el-select>
       <!--      <el-input v-model.trim="searchInfo.WorkCenter" placeholder="工作中心" clearable style="width: 150px;margin-right: 2px" />-->
-      <el-input v-model.trim="searchInfo.ItemNo" size="small" placeholder="任务号/" clearable style="width: 150px;margin-right: 2px" />
+<!--      <el-input v-model.trim="searchInfo.ItemNo" size="small" placeholder="任务号/" clearable style="width: 150px;margin-right: 2px" />-->
       <el-input v-model.trim="searchInfo.ItemCode" size="small" placeholder="物料号" clearable style="width: 150px;margin-right: 2px" />
+      <el-input v-model.trim="searchInfo.ItemName" size="small" placeholder="物料名" clearable style="width: 150px;margin-right: 2px" />
+      <el-input v-model.trim="searchInfo.WoNos" size="small" placeholder="工单号/" clearable style="width: 150px;margin-right: 2px" />
       <el-select v-model="showSynced" size="small" placeholder="操作类型" style="width: 8%">
         <el-option v-for="(value, key) in showSyncedState" :key="key" :label="value" :value="key" />
       </el-select>
@@ -27,7 +29,7 @@
       <el-button v-preventReClick size="small" style="vertical-align: top" type="primary" icon="el-icon-search" @click="handleSearchF(1,pageInfoF.PageSize)" />
       <el-button v-preventReClick size="small" style="vertical-align: top" type="primary" :disabled="Object.keys(selectedItemNoSourceLocations).length === 0" @click="addMachineTask">下发堆垛机</el-button>
       <el-button v-preventReClick size="small" style="vertical-align: top" type="primary" @click="showDelItemWorkFrom">删除批号</el-button>
-      <el-button v-preventReClick size="small" style="vertical-align: top; position:absolute; right: 0" type="primary" :disabled="Object.keys(selectedItemNos).length === 0" @click="wmsUploadList">上传WMS</el-button>
+<!--      <el-button v-preventReClick size="small" style="vertical-align: top; position:absolute; right: 0" type="primary" :disabled="Object.keys(selectedItemNos).length === 0" @click="wmsUploadList">上传WMS</el-button>-->
     </div>
 
     <el-dialog width="26%" :title="formConfigDel.title" :visible.sync="formConfigDel.isShowForm" :close-on-click-modal="false">
@@ -130,11 +132,6 @@
         :width="item.width"
         align="center"
       />
-      <!--      <el-table-column label="上传" align="center" width="50">-->
-      <!--        <template v-slot="scope">-->
-      <!--          {{ IsSyncedEnum[scope.row["IsSynced"]] }}-->
-      <!--        </template>-->
-      <!--      </el-table-column>-->
       <el-table-column align="center" label="操作" width="60" fixed="right">
         <template v-slot="scope">
           <el-button type="primary" icon="el-icon-edit" size="mini" @click="showAddEditFormF(0,scope.row)" />
@@ -207,6 +204,7 @@
       border
       fit
       highlight-current-row
+      @header-click="copyTaskNo"
     >
       <el-table-column
         v-for="item in tableConfigS"
@@ -263,7 +261,6 @@ import {
   updateItemLowInventoryAPI,
   closeItemTaskAPI, delItemLowItemWorkNoAPI
 } from '@/api/oldData'
-import Enumerable from 'linq'
 export default {
   data() {
     return {
@@ -272,14 +269,17 @@ export default {
         BillNo: '',
         ItemNo: '',
         ItemCode: '',
-        WorkCenter: ''
+        ItemName: '',
+        WorkCenter: '',
+        WoNos: ''
       },
       sourceLocationTag: '不筛选',
       showSynced: '0',
       showSyncedState: {
         '0': '未上传',
         '1': '已上传',
-        '2': '不筛选'
+        '2': '上传失败',
+        '3': '不筛选'
       },
       onHandStateEnum: {
         1: '未质检',
@@ -352,7 +352,7 @@ export default {
         { label: '物料名', prop: 'ItemName', width: 500 },
         { label: '计划', prop: 'PlannedTotalQty', width: 80 },
         { label: '实际', prop: 'ActualTotalQty', width: 80 },
-        { label: '工单', prop: 'WoNos', width: 120 },
+        { label: '工单', prop: 'WoNos', width: 120 },
         { label: '库位', prop: 'SourceLocations', width: 180 },
         { label: '库存', prop: 'LocationItemsNum', width: 80 },
         { label: '仓库', prop: 'WarehouseCode', width: 80 },
@@ -935,7 +935,35 @@ export default {
       })
 
       this.tableLoadingF = false
-    }
+    },
+    copyTaskNo(column) {
+      // console.log(event)
+      // 双击复制
+      if (column.property === 'TaskNo') {
+        // 获取姓名列的所有数据
+        let TaskNoList = this.tableS.map(item => item.TaskNo)
+        TaskNoList = Array.from(new Set(TaskNoList)).sort((a, b) => a.localeCompare(b))
+        // 格式化为Excel可以识别的内容,这里简单用换行分隔
+        const textToCopy = TaskNoList.join('\n')
+        // 创建一个虚拟的textarea元素,并设置其值
+        const textarea = document.createElement('textarea')
+        textarea.value = textToCopy
+        textarea.setAttribute('readonly', '')
+        textarea.style.position = 'absolute'
+        textarea.style.left = '-9999px'
+
+        // 将textarea添加到DOM中并选中文本
+        document.body.appendChild(textarea)
+        textarea.select()
+        document.execCommand('copy')
+
+        // 清理掉虚拟元素
+        document.body.removeChild(textarea)
+
+        // 提示复制成功
+        this.$message.success('工单号已复制到剪贴板')
+      }
+    },
   }
 }
 </script>

+ 251 - 117
SCADA_DAQ.EicpApp/src/views/customer/item-up-task/index.vue

@@ -2,23 +2,20 @@
   <div class="app-container-min">
     <div class="search-container">
       <el-input v-model.trim="searchInfo.BillNo" size="small" placeholder="收货号" clearable style="width: 150px;margin-right: 2px" />
-      <el-input v-model.trim="searchInfo.TaskNo" size="small" placeholder="任务号" clearable style="width: 150px;margin-right: 2px" />
+      <el-input v-model.trim="searchInfo.TaskNo" size="small" placeholder="任务号" clearable style="width: 150px;margin-right: 2px" @input="handleTaskNoPasteQuery" />
+      <el-input v-model.trim="searchInfo.WoNo" size="small" placeholder="工单号" clearable style="width: 150px;margin-right: 2px" @input="handleWoNoPasteQuery" />
       <el-input v-model.trim="searchInfo.ItemCode" size="small" placeholder="物料号" clearable style="width: 150px;margin-right: 2px" />
-      <el-input v-model.trim="searchInfo.WoNo" size="small" placeholder="工单号" clearable style="width: 150px;margin-right: 2px" />
-      <el-select v-model="showMerged" size="small" placeholder="操作类型" style="width: 8%">
-        <el-option v-for="(value, key) in showMergedState" :key="key" :label="value" :value="key" />
+      <el-select v-model="taskState" size="small" placeholder="操作类型" style="width: 6%;margin-right: 2px">
+        <el-option v-for="(value, key) in taskStateOp" :key="key" :label="value" :value="key" />
       </el-select>
       <el-button v-preventReClick size="small" style="vertical-align: top" type="primary" icon="el-icon-search" @click="handleSearch(1,pageInfo.PageSize)" />
-      <el-button size="small" style="vertical-align: top; margin-left: 20px" type="primary" @click="showAddEditForm(1)">工单合并</el-button>
+      <el-button :class="isMerged === true?'el-icon-document-remove':'el-icon-document'" size="small" style="vertical-align: top; margin-left: 20px" type="primary" @click="showMergeTable" />
+      <el-button size="small" style="vertical-align: top; margin-left: 20px" type="primary" :disabled="isOperateBtn" @click="operateList()">下发</el-button>
+      <el-button size="small" style="vertical-align: top; margin-left: 20px" type="primary" :disabled="isShowUpLoadBtn" @click="upLoadUpShelf()">上传</el-button>
     </div>
 
     <el-dialog width="40%" :title="formConfig.title" :visible.sync="formConfig.isShowForm">
       <el-form ref="form" :model="form" :rules="rules" label-width="80px">
-        <!--        <el-form-item label="货架组" prop="SourceLocationTag">-->
-        <!--          <el-select v-model="form.SourceLocationTag" placeholder="">-->
-        <!--            <el-option v-for="item in ['DQA', 'L']" :key="item" :label="item" :value="item" />-->
-        <!--          </el-select>-->
-        <!--        </el-form-item>-->
         <el-form-item v-if="formConfig.isShowAdd" label="工单号" prop="WoNos">
           <el-input v-model="form.WoNos" size="small" spellcheck="false" autocomplete="off" @input="handleWoNoPaste" />
         </el-form-item>
@@ -29,50 +26,53 @@
         <el-button v-if="formConfig.isShowEdit" size="small" type="primary" @click="handleAddEditRow(0)">确认合并</el-button>
       </div>
     </el-dialog>
-
-    <el-table
-      v-if="table.length!==0"
-      v-loading="tableLoading"
-      element-loading-text="加载中"
-      element-loading-spinner="el-icon-loading"
-      :row-key="row=>row['ID']"
-      :data="table"
-      :cell-class-name="cellStyleF"
-      :row-class-name="rowClassNameF"
-      :row-style="rowStyleF"
-      border
-      fit
-      highlight-current-row
-      @select="selectRowF"
-      @select-all="selectAllRowF"
-      @header-click="copyText"
-    >
-      <el-table-column type="selection" width="55" align="center" />
-      <el-table-column
-        v-for="item in tableConfig"
-        :key="item.prop"
-        :label="item.label"
-        :prop="item.prop"
-        :width="item.width"
-        :show-overflow-tooltip="true"
-        align="center"
-      />
-      <el-table-column label="合并" align="center" width="50">
-        <template v-slot="scope">
-          {{ scope.row["IsMerged"] === false?'否':'是' }}
-        </template>
-      </el-table-column>
-      <el-table-column label="状态" align="center" width="50">
-        <template v-slot="scope">
-          {{ taskStateEnum[scope.row["State"]] }}
-        </template>
-      </el-table-column>
-    </el-table>
+    <div style="height: calc(92vh - 60px - 40px)">
+      <vxe-table
+        ref="xTable"
+        :loading="tableLoading"
+        auto-resize
+        border
+        :resizable="true"
+        show-overflow
+        show-header-overflow
+        show-footer-overflow
+        :footer-method="()=>[]"
+        height="auto"
+        :sort-config="{trigger: 'cell'}"
+        :scroll-x="{enabled: true, gt: 10}"
+        :scroll-y="{enabled: true, gt: 100}"
+        :header-cell-style="{
+          'text-align': 'center',
+          'height': '32px',
+          'background-color': '#fff'
+        }"
+        :row-style="rowStyle"
+        @checkbox-change="selectRow"
+        @checkbox-all="selectAllRow"
+        @cell-dblclick="copyItem"
+      >
+        <vxe-column
+          v-for="item in tableConfig"
+          :key="item.prop"
+          :field="item.prop"
+          :type="item.type"
+          :filter-method="item.filterMethod"
+          :filters="item.filter"
+          :sortable="item.sortable"
+          :title="item.label"
+          :width="item.width"
+          :fixed="item.fixed"
+          :formatter="item.formatter"
+          :show-overflow-tooltip="true"
+          align="center"
+        />
+      </vxe-table>
+    </div>
     <div class="page">
       <el-pagination
         :current-page.sync="pageInfo.PageNum"
         :page-size="pageInfo.PageSize"
-        :page-sizes="[25, 40, 60, 100, 500, 1000]"
+        :page-sizes="[500, 1000, 1500, 2000]"
         layout="total, sizes, prev, pager, next, jumper"
         :total="totalPage"
         @size-change="handleSizeChange"
@@ -87,9 +87,11 @@
 <script>
 import {
   mergeItemUpListAPI,
-  getItemUpTaskTableAPI
+  getItemUpTaskTableAPI,
+  upLoadUpShelfTaskAPI, operateMachineTaskListAPI
 } from '@/api/oldData'
 export default {
+  name: 'ItemUpTask',
   data() {
     return {
       searchInfo: {
@@ -98,23 +100,26 @@ export default {
         ItemCode: '',
         WoNo: ''
       },
-      showMerged: '0',
+      isMerged: false,
+      showMerged: '2',
       showMergedState: {
         '0': '未合并',
         '1': '已合并',
         '2': '不筛选'
       },
-      taskStateEnum: {
-        0: '创建',
-        1: '释放',
-        2: '指派',
-        3: '冻结',
-        4: '挂起',
-        5: '完工',
-        6: '关闭',
-        7: '执行中',
-        8: '异常',
-        9: '自动完工'
+      taskState: '0',
+      taskStateOp: {
+        '0': '创建',
+        '1': '释放',
+        '2': '指派',
+        '3': '冻结',
+        '4': '挂起',
+        '5': '完工',
+        '6': '关闭',
+        '7': '执行中',
+        '8': '异常',
+        '9': '自动完工',
+        '10': '不筛选'
       },
       formList: [],
       form: {
@@ -137,48 +142,102 @@ export default {
       },
       tableLoading: true,
       table: [],
-      tableConfig: [
-        { label: '批号', prop: 'ItemWorkNo', width: 125 },
-        { label: '收货号', prop: 'BillNo', width: 145 },
-        { label: '任务号', prop: 'TaskNo', width: 160 },
-        { label: '物料号', prop: 'ItemCode', width: 100 },
-        { label: '物料名', prop: 'ItemName' },
-        { label: '计划数', prop: 'PlannedQty', width: 80 },
-        { label: '实际数', prop: 'ActualQty', width: 80 },
-        { label: '仓库', prop: 'WarehouseCode', width: 60 },
-        // { label: '货架号', prop: 'SourceLocationTag', width: 160 },
-        { label: '货架', prop: 'SourceLocationGroup', width: 60 },
-        { label: '工单号', prop: 'WoNo', width: 125 },
-        { label: '状态', prop: 'State', width: 60 },
-        { label: '单位', prop: 'UnitCode', width: 60 },
-        { label: '创建时间', prop: 'CreateTime', width: 160 }
-      ],
+      mergedTable: [],
+      noMergedTable: [],
+      tableConfig: (() => {
+        const taskState = { 0: '创建', 1: '释放', 2: '指派', 3: '冻结', 4: '挂起', 5: '完工', 6: '关闭', 7: '执行中', 8: '异常', 9: '自动完工' }
+        return [
+          { label: '', prop: 'checkbox', type: 'checkbox', width: 45, fixed: 'left' },
+          // { label: '批号', prop: 'ItemWorkNo', width: 125, fixed: 'left' },
+          { label: '工单号', prop: 'WoNo', width: 125, fixed: 'left', sortable: true },
+          { label: '物料号', prop: 'ItemCode', width: 100, fixed: 'left', sortable: true },
+          { label: '物料名', prop: 'ItemName', width: 420, fixed: 'left' },
+          { label: '计划数', prop: 'PlannedQty', width: 70, fixed: 'left' },
+          { label: '实际数', prop: 'ActualQty', width: 70, fixed: 'left' },
+          { label: '仓库', prop: 'WarehouseCode', width: 60, fixed: 'left' },
+          { label: '任务库位', prop: 'SourceLocation', width: 130, fixed: 'left', sortable: true, filterMethod: ({ value, row }) => (value.length < row.SourceLocation?.length && row.SourceLocation != null && row.SourceLocation != ''), filter: [{ value: '', label: '有库位' }] },
+          // { label: '货架', prop: 'SourceLocationGroup', width: 60 },
+          { label: '状态', prop: 'State', width: 72, sortable: true, formatter: ({ row }) => taskState[row.State] },
+          { label: '备注', prop: 'ErrorMsg', width: 260, sortable: true },
+          { label: '单位', prop: 'UnitCode', width: 60 },
+          { label: '创建时间', prop: 'CreateTime', width: 160, sortable: true },
+          { label: '结束时间', prop: 'EndDate', width: 160, sortable: true },
+          { label: '发运号', prop: 'BillNo', width: 145, sortable: true },
+          { label: '任务号', prop: 'TaskNo', width: 160, sortable: true }
+        ]
+      })(),
       pageInfo: {
         PageNum: 1,
-        PageSize: 25
+        PageSize: 500
       },
       totalPage: 0,
       currentRowF: null,
-      currentRowBillNoColorF: {}
+      currentRowBillNoColorF: {},
+      isShowUpLoadBtn: true,
+      isOperateBtn: true
+    }
+  },
+  watch: {
+    formList: {
+      immediate: true,
+      deep: true,
+      handler(newVal, oldVal) {
+        this.isOperateBtn = newVal.length == 0
+        if (this.isMerged == true || newVal.length == 0) {
+          this.isShowUpLoadBtn = true
+        } else {
+          this.isShowUpLoadBtn = newVal.filter(e => e.SourceLocation == '' || e.SourceLocation == null).length > 0
+        }
+      }
     }
   },
   created() {
-    this.getInventoryTable()
+    this.getTable()
   },
   methods: {
-    cellStyleF({ row, column, rowIndex, columnIndex }) {
-      return row['State'] === 6 ? 'closed' : 'no-closed'
-    },
-    rowClassNameF({ row }) {
-      // eslint-disable-next-line no-prototype-builtins
-      if (!this.currentRowBillNoColorF.hasOwnProperty(row['BillNo'])) {
-        const keys = Object.keys(this.currentRowBillNoColorF)
-        const lastKey = keys[keys.length - 1]
-        this.currentRowBillNoColorF[row['BillNo']] = this.currentRowBillNoColorF[lastKey] === 'white-row' ? 'black-row' : 'white-row'
-      } else {
-        return this.currentRowBillNoColorF[row['BillNo']]
+    rowStyle({ row }) {
+      if (row['SourceLocation'] == '' || row['SourceLocation'] == null) {
+        return { 'color': '#e35f68' }
       }
     },
+    mergeTable(data) {
+      const merged = {}
+      data.forEach(item => {
+        const key = `${item.WorkCenter}_${item.WarehouseCode}_${item.ItemCode}`
+        if (!merged[key]) {
+          merged[key] = {
+            TaskNo: item.TaskNo,
+            WoNo: item.WoNo,
+            ActualQty: item.ActualQty,
+            PlannedQty: item.PlannedQty,
+            BillNo: item.BillNo,
+            ItemCode: item.ItemCode,
+            ItemName: item.ItemName,
+            WorkCenter: item.WorkCenter,
+            WarehouseCode: item.WarehouseCode,
+            SourceLocationGroup: item.SourceLocationGroup,
+            SourceLocationTag: item.SourceLocationTag,
+            SourceLocation: item.SourceLocation,
+            UnitCode: item.UnitCode
+          }
+        } else {
+          merged[key].ActualQty += item.ActualQty
+          merged[key].PlannedQty += item.PlannedQty
+          merged[key].TaskNo += '/' + item.TaskNo
+          merged[key].WoNo += '/' + item.WoNo
+          merged[key].BillNo += '/' + item.BillNo
+        }
+      })
+      return Object.values(merged)
+    },
+    handleTaskNoPasteQuery() {
+      const items = this.searchInfo.TaskNo.split(/\s+/).filter(item => item.trim() != '').sort((a, b) => a.localeCompare(b))
+      this.searchInfo.TaskNo = items.map(item => `${item.trim()}`).join(',')
+    },
+    handleWoNoPasteQuery() {
+      const items = this.searchInfo.WoNo.split(/\s+/).filter(item => item.trim() != '').sort((a, b) => a.localeCompare(b))
+      this.searchInfo.WoNo = items.map(item => `${item.trim()}`).join(',')
+    },
     copyText(column) {
       // console.log(event)
       // 双击复制
@@ -207,26 +266,52 @@ export default {
         this.$message.success('工单号已复制到剪贴板')
       }
     },
-    // 父表当前行颜色
-    rowStyleF({ row }) {
-      if (this.currentRowF !== null && this.currentRowF['ID'] === row['ID']) {
-        // 此处返回选中行的样式对象,按需设置
-        return {
-          'background-color': 'rgba(64,158,255,0.39)',
-          'color': '#ffffff'
-        }
-      }
-    },
     handleWoNoPaste() {
       const items = this.form.WoNos.split(/\s+/).filter(item => item.trim() != '')
       this.form.WoNos = items.map(item => `${item.trim()}`).join(',')
     },
-    async getInventoryTable() {
+    copyItem({ row }) {
+      // 创建一个虚拟的textarea元素,并设置其值
+      const textarea = document.createElement('textarea')
+      textarea.value = `{"物料号":"${row.ItemCode}", "物料名":"${row.ItemName}", "仓库":"${row.WarehouseCode}", "单位": "${row.UnitCode}"}`
+      textarea.setAttribute('readonly', '')
+      textarea.style.position = 'absolute'
+      textarea.style.left = '-9999px'
+
+      // 将textarea添加到DOM中并选中文本
+      document.body.appendChild(textarea)
+      textarea.select()
+      document.execCommand('copy')
+
+      // 清理掉虚拟元素
+      document.body.removeChild(textarea)
+
+      // 提示复制成功
+      this.$message.success('物料已复制到剪贴板')
+    },
+    showMergeTable() {
+      this.isMerged = !this.isMerged
+      this.formList = []
+      this.$nextTick(async() => {
+        if (this.isMerged === true) {
+          this.table = this.mergedTable
+        } else {
+          this.table = this.noMergedTable
+        }
+        await this.$refs.xTable.loadData(this.table)
+      })
+    },
+    async getTable() {
       this.tableLoading = true
-      let { Data: res } = await getItemUpTaskTableAPI(this.pageInfo, this.searchInfo, this.showMerged)
+      let { Data: res } = await getItemUpTaskTableAPI(this.pageInfo, this.searchInfo, this.showMerged, this.taskState)
       res = res == null ? [] : res
+      this.noMergedTable = res
+      this.mergedTable = this.mergeTable(res)
       this.table = res
+      this.isMerged = false
+      this.formList = []
       this.totalPage = res.length === 0 ? 0 : res[0]['Total']
+      await this.$refs.xTable.loadData(this.table)
       this.tableLoading = false
     },
     // 查询
@@ -234,10 +319,15 @@ export default {
       this.tableLoading = true
       this.pageInfo.PageNum = pageNumVal
       this.pageInfo.PageSize = pageSizeVal
-      const { Data: res } = await getItemUpTaskTableAPI(this.pageInfo, this.searchInfo, this.showMerged)
+      const { Data: res } = await getItemUpTaskTableAPI(this.pageInfo, this.searchInfo, this.showMerged, this.taskState)
       this.totalPage = res?.length === 0 ? 0 : res[0]['Total']
       this.$nextTick(() => {
+        this.noMergedTable = res
+        this.mergedTable = this.mergeTable(res)
         this.table = res
+        this.isMerged = false
+        this.formList = []
+        this.$refs.xTable.loadData(this.table)
       })
       this.tableLoading = false
     },
@@ -282,7 +372,7 @@ export default {
           this.tableLoading = true
           this.formConfig.isShowForm = false
           const res = await mergeItemUpListAPI(this.form.WoNos)
-          await this.getInventoryTable()
+          await this.getTable()
           this.$message({
             type: res['IsSucceed'] === false ? 'error' : 'success',
             message: res['Message']
@@ -291,22 +381,60 @@ export default {
         }
       })
     },
-    // 删除 此处调接口
-    async mergeItemUpList() {
+    selectRow({ checked }) {
+      this.formList = this.$refs.xTable.getCheckboxRecords()
+    },
+    selectAllRow({ checked }) {
+      this.formList = this.$refs.xTable.getCheckboxRecords()
+    },
+    async upLoadUpShelf() {
       this.tableLoading = true
-      const res = await mergeItemUpListAPI()
-      await this.getInventoryTable()
+      const taskNos = []
+      if (this.formList.length !== 0) {
+        this.formList.forEach(item => {
+          taskNos.push(item.TaskNo)
+        })
+      }
+      const res = await upLoadUpShelfTaskAPI(taskNos)
+      await this.getTable()
       this.$message({
+        showClose: true,
+        duration: 60000,
         type: res['IsSucceed'] === false ? 'error' : 'success',
         message: res['Message']
       })
       this.tableLoading = false
     },
-    selectRowF(rows) {
-      this.formList = rows
-    },
-    selectAllRowF(rows) {
-      this.formList = rows
+    async operateList() {
+      const sourceLocationItem = []
+      let list = this.formList.filter(t => t.SourceLocation != '' && t.SourceLocation != null)
+      if (list.length == 0) {
+        this.$message({
+          showClose: true,
+          type: 'error',
+          message: '暂无可下发的库位'
+        })
+        return null
+      }
+      list = Array.from(list.reduce((map, obj) => map.set(obj.ItemCode, obj), new Map()).values())
+      const dic = {}
+      list.forEach((item, index) => {
+        if (dic[item.SourceLocation]) {
+          dic[item.SourceLocation].ItemCode += `  ${item.ItemCode} `
+          dic[item.SourceLocation].ItemName += `  ${item.ItemName} `
+        } else {
+          dic[item.SourceLocation] = { SourceLocation: item.SourceLocation, ItemCode: `  ${item.ItemCode} `, ItemName: `  ${item.ItemName} ` }
+        }
+      })
+      for (const dicKey in dic) {
+        sourceLocationItem.push(dic[dicKey])
+      }
+      const res = await operateMachineTaskListAPI(sourceLocationItem)
+      this.$message({
+        showClose: true,
+        type: res['IsSucceed'] === false ? 'error' : 'success',
+        message: res['Message']
+      })
     }
   }
 
@@ -328,7 +456,7 @@ export default {
 ::v-deep .no-upload{
 }
 ::v-deep .closed{
-  color: #e70f10;
+  color: #c52a2a;
   cursor: default;
 }
 ::v-deep .no-closed{
@@ -359,4 +487,10 @@ export default {
     margin-bottom: 18px;
   }
 }
+::v-deep .vxe-table--render-default .vxe-body--column.col--ellipsis, .vxe-table--render-default .vxe-footer--column.col--ellipsis, .vxe-table--render-default .vxe-header--column.col--ellipsis, .vxe-table--render-default.vxe-editable .vxe-body--column {
+  height: 32px;
+}
+::v-deep .vxe-table--header th{
+  height: 32px;
+}
 </style>

+ 3 - 2
SCADA_DAQ.EicpApp/src/views/customer/item-up/index.vue

@@ -265,7 +265,8 @@ export default {
       showSyncedState: {
         '0': '未上传',
         '1': '已上传',
-        '2': '不筛选'
+        '2': '上传失败',
+        '3': '不筛选'
       },
       onHandStateEnum: {
         1: '未质检',
@@ -337,7 +338,7 @@ export default {
         { label: '物料名', prop: 'ItemName', width: 500 },
         { label: '计划', prop: 'PlannedTotalQty', width: 80 },
         { label: '实际', prop: 'ActualTotalQty', width: 80 },
-        { label: '工单', prop: 'WoNos', width: 120 },
+        { label: '工单', prop: 'WoNos', width: 120 },
         { label: '库位', prop: 'SourceLocations', width: 180 },
         { label: '库存', prop: 'LocationItemsNum', width: 80 },
         { label: '仓库', prop: 'WarehouseCode', width: 80 },

+ 128 - 118
SCADA_DAQ.EicpApp/src/views/customer/operate/components/CraneLine.vue

@@ -155,100 +155,100 @@
           <el-button v-if="formConfig.isShowEdit" type="primary" @click="handleAddEditRow(0)">编 辑</el-button>
         </div>
       </el-dialog>
-<!--      <el-col :span="12">-->
-<!--        <el-card>-->
-<!--          <div style="display: flex; justify-content: space-between; align-items: center">-->
-<!--            <div>-->
-<!--              <el-tag style="margin-right: 14px; cursor: pointer" @click="()=>isShowMachine=true">输送线1_{{ `${currentOperationLine1.StartRow}-${currentOperationLine1.StartCol}-${currentOperationLine1.StartLayer}__${currentOperationLine1.EndRow}-${currentOperationLine1.EndCol}-${currentOperationLine1.EndLayer}` }}</el-tag>-->
-<!--              <el-tag>输送线2_{{ `${currentOperationLine2.StartRow}-${currentOperationLine2.StartCol}-${currentOperationLine2.StartLayer}__${currentOperationLine2.EndRow}-${currentOperationLine2.EndCol}-${currentOperationLine2.EndLayer}` }}</el-tag>-->
-<!--            </div>-->
-<!--            <div>-->
-<!--              <el-button icon="el-icon-delete" size="medium" type="primary" @click="clearCraneTask(1)">堆垛机1任务</el-button>-->
-<!--              <el-button icon="el-icon-delete" size="medium" type="primary" @click="clearLineTask(1)">输送线1任务</el-button>-->
-<!--              <el-button icon="el-icon-delete" size="medium" type="primary" @click="clearLineTask(2)">输送线2任务</el-button>-->
-<!--            </div>-->
-<!--          </div>-->
-<!--          <el-table-->
-<!--            v-loading="tableLoadingCrane1"-->
-<!--            style="margin-top: 8px; margin-bottom: 8px"-->
-<!--            element-loading-text="加载中"-->
-<!--            element-loading-spinner="el-icon-loading"-->
-<!--            :row-key="row=>row['ID']"-->
-<!--            :data="tableCrane1"-->
-<!--            border-->
-<!--            fit-->
-<!--            highlight-current-row-->
-<!--          >-->
-<!--            <el-table-column-->
-<!--              v-for="item in tableConfig"-->
-<!--              :key="item.prop"-->
-<!--              :show-overflow-tooltip="true"-->
-<!--              :label="item.label"-->
-<!--              :prop="item.prop"-->
-<!--              :width="item.width"-->
-<!--              align="center"-->
-<!--            />-->
-<!--            <el-table-column label="动作" align="center" width="80">-->
-<!--              <template v-slot="scope">-->
-<!--                {{ operateTypeEnum[scope.row["machineTaskId"]] }}-->
-<!--              </template>-->
-<!--            </el-table-column>-->
-<!--            <el-table-column align="center" label="操作" width="120">-->
-<!--              <template v-slot="scope">-->
-<!--                <el-button type="primary" icon="el-icon-edit" size="mini" @click="showAddEditForm(0,scope.row)" />-->
-<!--                <el-button type="danger" icon="el-icon-delete" size="mini" @click="handleDeleteRow(scope.row)" />-->
-<!--              </template>-->
-<!--            </el-table-column>-->
-<!--          </el-table>-->
-<!--        </el-card>-->
-<!--      </el-col>-->
-<!--      <el-col :span="12">-->
-<!--        <el-card>-->
-<!--          <div style="display: flex; justify-content: space-between; align-items: center">-->
-<!--            <div>-->
-<!--              <el-tag style="margin-right: 14px">输送线3_{{ `${currentOperationLine3.StartRow}-${currentOperationLine3.StartCol}-${currentOperationLine3.StartLayer}__${currentOperationLine3.EndRow}-${currentOperationLine3.EndCol}-${currentOperationLine3.EndLayer}` }}</el-tag>-->
-<!--              <el-tag>输送线4_{{ `${currentOperationLine4.StartRow}-${currentOperationLine4.StartCol}-${currentOperationLine4.StartLayer}__${currentOperationLine4.EndRow}-${currentOperationLine4.EndCol}-${currentOperationLine4.EndLayer}` }}</el-tag>-->
-<!--            </div>-->
-<!--            <div>-->
-<!--              <el-button icon="el-icon-delete" size="medium" type="primary" @click="clearCraneTask(2)">堆垛机2任务</el-button>-->
-<!--              <el-button icon="el-icon-delete" size="medium" type="primary" @click="clearLineTask(3)">输送线3任务</el-button>-->
-<!--              <el-button icon="el-icon-delete" size="medium" type="primary" @click="clearLineTask(4)">输送线4任务</el-button>-->
-<!--            </div>-->
-<!--          </div>-->
-<!--          <el-table-->
-<!--            v-loading="tableLoadingCrane1"-->
-<!--            style="margin-top: 8px"-->
-<!--            element-loading-text="加载中"-->
-<!--            element-loading-spinner="el-icon-loading"-->
-<!--            :row-key="row=>row['ID']"-->
-<!--            :data="tableCrane2"-->
-<!--            border-->
-<!--            fit-->
-<!--            highlight-current-row-->
-<!--          >-->
-<!--            <el-table-column-->
-<!--              v-for="item in tableConfig"-->
-<!--              :key="item.prop"-->
-<!--              :show-overflow-tooltip="true"-->
-<!--              :label="item.label"-->
-<!--              :prop="item.prop"-->
-<!--              :width="item.width"-->
-<!--              align="center"-->
-<!--            />-->
-<!--            <el-table-column label="动作" align="center" width="80">-->
-<!--              <template v-slot="scope">-->
-<!--                {{ operateTypeEnum[scope.row["machineTaskId"]] }}-->
-<!--              </template>-->
-<!--            </el-table-column>-->
-<!--            <el-table-column align="center" label="操作" width="120">-->
-<!--              <template v-slot="scope">-->
-<!--                <el-button type="primary" icon="el-icon-edit" size="mini" @click="showAddEditForm(0,scope.row)" />-->
-<!--                <el-button type="danger" icon="el-icon-delete" size="mini" @click="handleDeleteRow(scope.row)" />-->
-<!--              </template>-->
-<!--            </el-table-column>-->
-<!--          </el-table>-->
-<!--        </el-card>-->
-<!--      </el-col>-->
+      <!--      <el-col :span="12">-->
+      <!--        <el-card>-->
+      <!--          <div style="display: flex; justify-content: space-between; align-items: center">-->
+      <!--            <div>-->
+      <!--              <el-tag style="margin-right: 14px; cursor: pointer" @click="()=>isShowMachine=true">输送线1_{{ `${currentOperationLine1.StartRow}-${currentOperationLine1.StartCol}-${currentOperationLine1.StartLayer}__${currentOperationLine1.EndRow}-${currentOperationLine1.EndCol}-${currentOperationLine1.EndLayer}` }}</el-tag>-->
+      <!--              <el-tag>输送线2_{{ `${currentOperationLine2.StartRow}-${currentOperationLine2.StartCol}-${currentOperationLine2.StartLayer}__${currentOperationLine2.EndRow}-${currentOperationLine2.EndCol}-${currentOperationLine2.EndLayer}` }}</el-tag>-->
+      <!--            </div>-->
+      <!--            <div>-->
+      <!--              <el-button icon="el-icon-delete" size="medium" type="primary" @click="clearCraneTask(1)">堆垛机1任务</el-button>-->
+      <!--              <el-button icon="el-icon-delete" size="medium" type="primary" @click="clearLineTask(1)">输送线1任务</el-button>-->
+      <!--              <el-button icon="el-icon-delete" size="medium" type="primary" @click="clearLineTask(2)">输送线2任务</el-button>-->
+      <!--            </div>-->
+      <!--          </div>-->
+      <!--          <el-table-->
+      <!--            v-loading="tableLoadingCrane1"-->
+      <!--            style="margin-top: 8px; margin-bottom: 8px"-->
+      <!--            element-loading-text="加载中"-->
+      <!--            element-loading-spinner="el-icon-loading"-->
+      <!--            :row-key="row=>row['ID']"-->
+      <!--            :data="tableCrane1"-->
+      <!--            border-->
+      <!--            fit-->
+      <!--            highlight-current-row-->
+      <!--          >-->
+      <!--            <el-table-column-->
+      <!--              v-for="item in tableConfig"-->
+      <!--              :key="item.prop"-->
+      <!--              :show-overflow-tooltip="true"-->
+      <!--              :label="item.label"-->
+      <!--              :prop="item.prop"-->
+      <!--              :width="item.width"-->
+      <!--              align="center"-->
+      <!--            />-->
+      <!--            <el-table-column label="动作" align="center" width="80">-->
+      <!--              <template v-slot="scope">-->
+      <!--                {{ operateTypeEnum[scope.row["machineTaskId"]] }}-->
+      <!--              </template>-->
+      <!--            </el-table-column>-->
+      <!--            <el-table-column align="center" label="操作" width="120">-->
+      <!--              <template v-slot="scope">-->
+      <!--                <el-button type="primary" icon="el-icon-edit" size="mini" @click="showAddEditForm(0,scope.row)" />-->
+      <!--                <el-button type="danger" icon="el-icon-delete" size="mini" @click="handleDeleteRow(scope.row)" />-->
+      <!--              </template>-->
+      <!--            </el-table-column>-->
+      <!--          </el-table>-->
+      <!--        </el-card>-->
+      <!--      </el-col>-->
+      <!--      <el-col :span="12">-->
+      <!--        <el-card>-->
+      <!--          <div style="display: flex; justify-content: space-between; align-items: center">-->
+      <!--            <div>-->
+      <!--              <el-tag style="margin-right: 14px">输送线3_{{ `${currentOperationLine3.StartRow}-${currentOperationLine3.StartCol}-${currentOperationLine3.StartLayer}__${currentOperationLine3.EndRow}-${currentOperationLine3.EndCol}-${currentOperationLine3.EndLayer}` }}</el-tag>-->
+      <!--              <el-tag>输送线4_{{ `${currentOperationLine4.StartRow}-${currentOperationLine4.StartCol}-${currentOperationLine4.StartLayer}__${currentOperationLine4.EndRow}-${currentOperationLine4.EndCol}-${currentOperationLine4.EndLayer}` }}</el-tag>-->
+      <!--            </div>-->
+      <!--            <div>-->
+      <!--              <el-button icon="el-icon-delete" size="medium" type="primary" @click="clearCraneTask(2)">堆垛机2任务</el-button>-->
+      <!--              <el-button icon="el-icon-delete" size="medium" type="primary" @click="clearLineTask(3)">输送线3任务</el-button>-->
+      <!--              <el-button icon="el-icon-delete" size="medium" type="primary" @click="clearLineTask(4)">输送线4任务</el-button>-->
+      <!--            </div>-->
+      <!--          </div>-->
+      <!--          <el-table-->
+      <!--            v-loading="tableLoadingCrane1"-->
+      <!--            style="margin-top: 8px"-->
+      <!--            element-loading-text="加载中"-->
+      <!--            element-loading-spinner="el-icon-loading"-->
+      <!--            :row-key="row=>row['ID']"-->
+      <!--            :data="tableCrane2"-->
+      <!--            border-->
+      <!--            fit-->
+      <!--            highlight-current-row-->
+      <!--          >-->
+      <!--            <el-table-column-->
+      <!--              v-for="item in tableConfig"-->
+      <!--              :key="item.prop"-->
+      <!--              :show-overflow-tooltip="true"-->
+      <!--              :label="item.label"-->
+      <!--              :prop="item.prop"-->
+      <!--              :width="item.width"-->
+      <!--              align="center"-->
+      <!--            />-->
+      <!--            <el-table-column label="动作" align="center" width="80">-->
+      <!--              <template v-slot="scope">-->
+      <!--                {{ operateTypeEnum[scope.row["machineTaskId"]] }}-->
+      <!--              </template>-->
+      <!--            </el-table-column>-->
+      <!--            <el-table-column align="center" label="操作" width="120">-->
+      <!--              <template v-slot="scope">-->
+      <!--                <el-button type="primary" icon="el-icon-edit" size="mini" @click="showAddEditForm(0,scope.row)" />-->
+      <!--                <el-button type="danger" icon="el-icon-delete" size="mini" @click="handleDeleteRow(scope.row)" />-->
+      <!--              </template>-->
+      <!--            </el-table-column>-->
+      <!--          </el-table>-->
+      <!--        </el-card>-->
+      <!--      </el-col>-->
     </el-row>
     <el-row :gutter="2">
       <el-card>
@@ -311,15 +311,15 @@
                 :width="item.width"
                 align="center"
               />
-              <el-table-column label="动作" align="center" width="80">
+              <el-table-column label="动作" align="center" width="64">
                 <template v-slot="scope">
                   {{ operateTypeEnum[scope.row["machineTaskId"]] }}
                 </template>
               </el-table-column>
-              <el-table-column align="center" label="操作">
+              <el-table-column align="center" label="操作" width="60">
                 <template v-slot="scope">
-                  <el-button type="primary" icon="el-icon-edit" size="mini" @click="showAddEditForm(0,scope.row)" />
-                  <el-button type="danger" icon="el-icon-delete" size="mini" @click="handleDeleteRow(scope.row)" />
+                  <i style="cursor: pointer" type="primary" class="el-icon-edit" @click="showAddEditForm(0,scope.row)" />
+                  <i style="cursor: pointer" type="danger" class="el-icon-delete" @click="handleDeleteRow(scope.row)" />
                 </template>
               </el-table-column>
             </el-table>
@@ -345,15 +345,15 @@
                 :width="item.width"
                 align="center"
               />
-              <el-table-column label="动作" align="center" width="80">
+              <el-table-column label="动作" align="center" width="64">
                 <template v-slot="scope">
                   {{ operateTypeEnum[scope.row["machineTaskId"]] }}
                 </template>
               </el-table-column>
-              <el-table-column align="center" label="操作">
+              <el-table-column align="center" label="操作" width="60">
                 <template v-slot="scope">
-                  <el-button type="primary" icon="el-icon-edit" size="mini" @click="showAddEditForm(0,scope.row)" />
-                  <el-button type="danger" icon="el-icon-delete" size="mini" @click="handleDeleteRow(scope.row)" />
+                  <i style="cursor: pointer" type="primary" class="el-icon-edit" @click="showAddEditForm(0,scope.row)" />
+                  <i style="cursor: pointer" type="danger" class="el-icon-delete" @click="handleDeleteRow(scope.row)" />
                 </template>
               </el-table-column>
             </el-table>
@@ -379,15 +379,15 @@
                 :width="item.width"
                 align="center"
               />
-              <el-table-column label="动作" align="center" width="80">
+              <el-table-column label="动作" align="center" width="64">
                 <template v-slot="scope">
                   {{ operateTypeEnum[scope.row["machineTaskId"]] }}
                 </template>
               </el-table-column>
-              <el-table-column align="center" label="操作">
+              <el-table-column align="center" label="操作" width="60">
                 <template v-slot="scope">
-                  <el-button type="primary" icon="el-icon-edit" size="mini" @click="showAddEditForm(0,scope.row)" />
-                  <el-button type="danger" icon="el-icon-delete" size="mini" @click="handleDeleteRow(scope.row)" />
+                  <i style="cursor: pointer" type="primary" class="el-icon-edit" @click="showAddEditForm(0,scope.row)" />
+                  <i style="cursor: pointer" type="danger" class="el-icon-delete" @click="handleDeleteRow(scope.row)" />
                 </template>
               </el-table-column>
             </el-table>
@@ -413,15 +413,15 @@
                 :width="item.width"
                 align="center"
               />
-              <el-table-column label="动作" align="center" width="80">
+              <el-table-column label="动作" align="center" width="64">
                 <template v-slot="scope">
                   {{ operateTypeEnum[scope.row["machineTaskId"]] }}
                 </template>
               </el-table-column>
-              <el-table-column align="center" label="操作">
+              <el-table-column align="center" label="操作" width="60">
                 <template v-slot="scope">
-                  <el-button type="primary" icon="el-icon-edit" size="mini" @click="showAddEditForm(0,scope.row)" />
-                  <el-button type="danger" icon="el-icon-delete" size="mini" @click="handleDeleteRow(scope.row)" />
+                  <i style="cursor: pointer" type="primary" class="el-icon-edit" @click="showAddEditForm(0,scope.row)" />
+                  <i style="cursor: pointer" type="danger" class="el-icon-delete" @click="handleDeleteRow(scope.row)" />
                 </template>
               </el-table-column>
             </el-table>
@@ -440,7 +440,7 @@ export default {
       operateTypeEnum: {
         '1': '仅入库',
         '3': '仅出库',
-        '5': '出再入'
+        '5': '出再入'
       },
       machineStateDecEnum: {
         0: '未知',
@@ -515,9 +515,11 @@ export default {
       tableConfig: [
         // { label: '操作号', prop: 'operateNo' },
         // { label: '输送线', prop: 'line', width: 63 },
-        { label: '起点', prop: 'start', width: 72 },
-        { label: '终点', prop: 'end', width: 72 },
-        { label: '排序', prop: 'order', width: 50 }
+        { label: '起点', prop: 'start', width: 70 },
+        { label: '终点', prop: 'end', width: 70 },
+        { label: '排序', prop: 'order', width: 50 },
+        { label: '物料', prop: 'itemCode' }
+        // { label: '物料名', prop: 'itemName', width: 70 }
       ],
       tableLine1: [],
       tableLine2: [],
@@ -627,7 +629,9 @@ export default {
                 crane: item['Crane'],
                 line: item['Line'],
                 operateNo: item['OperateNo'],
-                machineTaskId: item['MachineTaskId']
+                machineTaskId: item['MachineTaskId'],
+                itemCode: item['ItemCode'],
+                itemName: item['ItemName']
               }
             )
           }
@@ -640,7 +644,9 @@ export default {
                 crane: item['Crane'],
                 line: item['Line'],
                 operateNo: item['OperateNo'],
-                machineTaskId: item['MachineTaskId']
+                machineTaskId: item['MachineTaskId'],
+                itemCode: item['ItemCode'],
+                itemName: item['ItemName']
               }
             )
           }
@@ -662,7 +668,9 @@ export default {
                 crane: item['Crane'],
                 line: item['Line'],
                 operateNo: item['OperateNo'],
-                machineTaskId: item['MachineTaskId']
+                machineTaskId: item['MachineTaskId'],
+                itemCode: item['ItemCode'],
+                itemName: item['ItemName']
               }
             )
           }
@@ -675,7 +683,9 @@ export default {
                 crane: item['Crane'],
                 line: item['Line'],
                 operateNo: item['OperateNo'],
-                machineTaskId: item['MachineTaskId']
+                machineTaskId: item['MachineTaskId'],
+                itemCode: item['ItemCode'],
+                itemName: item['ItemName']
               }
             )
           }

+ 8 - 8
SCADA_DAQ.EicpApp/src/views/customer/operate/components/LowUpShelf.vue

@@ -5,14 +5,14 @@
         <el-row>
           <el-col :span="2">
             <el-form-item prop="MachineTaskId">
-              <el-select v-model="form.MachineTaskId" placeholder="操作类型" @change="machineIdTaskChange">
+              <el-select v-model="form.MachineTaskId" placeholder="操作类型" filterable @change="machineIdTaskChange">
                 <el-option v-for="(value, key) in operateTypeEnum" :key="key" :label="value" :value="key" />
               </el-select>
             </el-form-item>
           </el-col>
           <el-col :span="2">
             <el-form-item prop="Line">
-              <el-select v-model="form.Line" placeholder="输送线" @change="lineChange">
+              <el-select v-model="form.Line" placeholder="输送线" filterable @change="lineChange">
                 <el-option v-for="item in 4" :key="item" :label="item" :value="item" />
               </el-select>
             </el-form-item>
@@ -22,7 +22,7 @@
           </el-col>
           <el-col v-show="flag" :span="2">
             <el-form-item prop="StartRow">
-              <el-select v-model="form.StartRow" placeholder="排" :disabled="startDisable">
+              <el-select v-model="form.StartRow" placeholder="排" :disabled="startDisable" filterable>
                 <el-option v-for="item in rows" :key="item" :label="item" :value="item" />
               </el-select>
             </el-form-item>
@@ -46,7 +46,7 @@
           </el-col>
           <el-col v-show="!flag" :span="2">
             <el-form-item prop="EndRow">
-              <el-select v-model="form.EndRow" placeholder="排" :disabled="endDisable">
+              <el-select v-model="form.EndRow" placeholder="排" :disabled="endDisable" filterable>
                 <el-option v-for="item in rows" :key="item" :label="item" :value="item" />
               </el-select>
             </el-form-item>
@@ -65,12 +65,12 @@
               </el-select>
             </el-form-item>
           </el-col>
-          <el-col :span="2">
-            <el-button style="margin-left: 10px" type="primary" :disabled="lineTaskDisable" @click="craneUpLowShelfL">启动</el-button>
-          </el-col>
           <el-col :span="2">
             <el-button type="primary" @click="upLowShelfOperateList">下发</el-button>
           </el-col>
+          <el-col :span="11" style="display:flex; justify-content: right">
+            <el-button style="margin-left: 10px" :disabled="lineTaskDisable" @click="craneUpLowShelfL">启动</el-button>
+          </el-col>
         </el-row>
       </el-form>
     </el-card>
@@ -88,7 +88,7 @@ export default {
       operateTypeEnum: {
         '1': '仅入库',
         '3': '仅出库',
-        '5': '出再入'
+        '5': '出再入'
       },
       startDisable: true,
       endDisable: true,

+ 1 - 0
SCADA_DAQ.EicpApp/src/views/customer/operate/index.vue

@@ -10,6 +10,7 @@
 import LowUpShelf from '@/views/customer/operate/components/LowUpShelf.vue'
 import CraneLine from '@/views/customer/operate/components/CraneLine.vue'
 export default {
+  name: 'Operate',
   components: { LowUpShelf, CraneLine },
   data() {
     return {}