From 582fc0831a659d1c9e90ac9f84a779e4eaeebd77 Mon Sep 17 00:00:00 2001
From: 小小儁爺 <1694218219@qq.com>
Date: 星期五, 08 十一月 2024 14:14:38 +0800
Subject: [PATCH] 1.生产入库T+ 手动写表
---
src/api/WorkOrder.js | 11
src/views/materialManager/unitList2.vue | 693 ++++++++
src/views/materialManager/inventoryList2.vue | 1710 ++++++++++++++++++++
src/views/produce/productWarehouse2.vue | 944 +++++++++++
src/router/index.js | 27
src/views/produce/stepReport2.vue | 1686 +++++++++++++++++++
6 files changed, 5,069 insertions(+), 2 deletions(-)
diff --git a/src/api/WorkOrder.js b/src/api/WorkOrder.js
index 3c7f95f..a620417 100644
--- a/src/api/WorkOrder.js
+++ b/src/api/WorkOrder.js
@@ -321,7 +321,7 @@
})
}
-// 閫氭槗T8鐢熶骇鍏ュ簱鎻愪氦
+// 閫氭槗T8鐢熶骇鍏ュ簱鎻愪氦-瀛樺偍杩囩▼鐗�(閫傜敤鍚屼竴鍙版湇鍔″櫒锛屽悓涓�涓暟鎹簱)
export function ProductInHouseOrderSeave(data) {
return request({
url: 'WorkOrder/ProductInHouseOrderSpSeave',
@@ -330,3 +330,12 @@
})
}
+// 鐣呮嵎閫歍+鐢熶骇鍏ュ簱鎻愪氦-瀛樺偍杩囩▼鐗�(閫傜敤鍚屼竴鍙版湇鍔″櫒锛屽悓涓�涓暟鎹簱)
+export function TProductInHouseOrderSpSeave(data) {
+ return request({
+ url: 'WorkOrder/TProductInHouseOrderSpSeave',
+ method: 'post',
+ data
+ })
+}
+
diff --git a/src/router/index.js b/src/router/index.js
index 40768e6..96f2b7e 100644
--- a/src/router/index.js
+++ b/src/router/index.js
@@ -224,6 +224,18 @@
code: '0203',
component: () => import('@/views/materialManager/materialList'),
meta: { code: '0203', title: '鐗╂枡娓呭崟', icon: '', keepAlive: true }
+ }, {
+ path: 'unitList2',
+ name: 'UnitList2',
+ code: '0204',
+ component: () => import('@/views/materialManager/unitList2'),
+ meta: { code: '0204', title: '璁¢噺鍗曚綅', icon: '', keepAlive: true }
+ }, {
+ path: 'inventoryList2',
+ name: 'InventoryList2',
+ code: '0205',
+ component: () => import('@/views/materialManager/inventoryList2'),
+ meta: { code: '0205', title: '瀛樿揣妗f', icon: '', keepAlive: true }
}
]
@@ -477,6 +489,13 @@
meta: { code: '0601', title: '宸ュ簭鎶ュ伐', icon: '', keepAlive: true }
},
{
+ path: 'stepReport2',
+ name: 'StepReport2',
+ code: '0606',
+ component: () => import('@/views/produce/stepReport2'),
+ meta: { code: '0606', title: '宸ュ簭鎶ュ伐', icon: '', keepAlive: true }
+ },
+ {
path: 'reportCorrect',
name: 'ReportCorrect',
code: '0602',
@@ -493,7 +512,13 @@
name: 'productWarehouse',
code: '0604',
component: () => import('@/views/produce/productWarehouse'),
- meta: { code: '0604', title: '鐢熶骇鍏ュ簱', icon: '', keepAlive: true }
+ meta: { code: '0604', title: 'T8鐢熶骇鍏ュ簱', icon: '', keepAlive: true }
+ }, {
+ path: 'productWarehouse2',
+ name: 'productWarehouse2',
+ code: '0605',
+ component: () => import('@/views/produce/productWarehouse2'),
+ meta: { code: '0605', title: 'T+鐢熶骇鍏ュ簱', icon: '', keepAlive: true }
}
]
diff --git a/src/views/materialManager/inventoryList2.vue b/src/views/materialManager/inventoryList2.vue
new file mode 100644
index 0000000..d4ba311
--- /dev/null
+++ b/src/views/materialManager/inventoryList2.vue
@@ -0,0 +1,1710 @@
+<template>
+ <div>
+ <div class="body" :style="{height:mainHeight+'px'}">
+
+ <div style="display: flex">
+ <div style="width: 300px;margin: 10px 10px 0 0;background:#fff">
+
+ <div style="margin: 20px 10px 0 10px;display: flex;justify-content: space-between;">
+ <div style="display: flex;">
+ <div
+ style="width: 5px;height: 100%;border-radius: 5px;"
+ :style="{background:$store.state.settings.theme}"
+ />
+ <div style="margin-left: 8px;">瀛樿揣妗f</div>
+ </div>
+
+ <div style="margin-right:10px">
+ <el-tooltip v-del-tab-index class="item" effect="dark" content="鏂板" placement="top">
+ <i class="el-icon-plus" style="cursor: pointer;color: #999" @click="treeAddClick('add')" />
+ </el-tooltip>
+ </div>
+
+ </div>
+
+ <el-tree
+ ref="treeLeftRef"
+ style="padding: 10px;overflow: auto"
+ :style="{height:(tableHeight+222)+'px'}"
+ :data="treeLeft"
+ node-key="code"
+ highlight-current
+ :props="defaultPropsLeft"
+ :default-expand-all="true"
+ :expand-on-click-node="false"
+ @node-click="getTMaterielData"
+ >
+ <span slot-scope="{ node, data }" class="custom-tree-node">
+ <span v-if="!data.isEdit" class="ellipsis" style="width:150px;">{{ data.name }}</span>
+ <span v-if="!data.isEdit">
+ <el-tooltip v-del-tab-index class="item" effect="dark" content="缂栬緫" placement="top">
+ <i
+ v-if="data.code!=='-1'"
+ class="el-icon-edit"
+ style="margin-right:10px;color: #999"
+ @click.stop="treeEditClick(node,data,'edit')"
+ />
+ </el-tooltip>
+ <el-tooltip v-del-tab-index class="item" effect="dark" content="鍒犻櫎" placement="top">
+ <i
+ v-if="data.code!=='-1'"
+ class="el-icon-delete"
+ style="margin-right: 4px;color: #999"
+ @click.stop="treeDeleteClick(node,data)"
+ />
+ </el-tooltip>
+ </span>
+ </span>
+ </el-tree>
+ </div>
+
+ <div
+ style=" width:calc(100% - 300px);"
+ >
+ <div class="bodyTopButtonGroup" style="justify-content: space-between">
+ <el-button v-waves type="primary" icon="el-icon-circle-plus-outline" @click="add('add')">鏂板</el-button>
+ <div style="display: flex">
+ <el-button
+ v-waves
+ type="success"
+ icon="el-icon-download"
+ @click="$router.push('./../systemSetting/dataImport?fileCode=8')"
+ >瀵煎叆
+ </el-button>
+ <el-button v-waves icon="el-icon-refresh-right" @click="syncERP">鍚屾瀛樿揣妗f</el-button>
+ </div>
+ </div>
+
+ <div class="bodyTopFormGroup">
+ <el-form
+ ref="form"
+ :model="form"
+ label-width="100px"
+ inline
+ style="display: flex;"
+ >
+ <div class="elForm">
+ <el-form-item label="瀛樿揣缂栫爜" style=" display: flex;">
+ <el-input v-model="form.partcode" placeholder="璇疯緭鍏�" style="width: 200px" />
+ </el-form-item>
+ <el-form-item label="瀛樿揣鍚嶇О" style=" display: flex;">
+ <el-input v-model="form.partname" placeholder="璇疯緭鍏�" style="width: 200px" />
+ </el-form-item>
+ <el-form-item label="瀛樿揣瑙勬牸" style=" display: flex;">
+ <el-input v-model="form.partspec" placeholder="璇疯緭鍏�" style="width: 200px" />
+ </el-form-item>
+ <!-- <el-form-item label="鐢ㄦ埛缂栫爜" style=" display: flex;">-->
+ <!-- <el-input v-model="form.usercode" placeholder="璇疯緭鍏�" style="width: 200px" />-->
+ <!-- </el-form-item>-->
+ <!-- <el-form-item v-show="isExpandForm" label="鐢ㄦ埛鍚嶇О" style=" display: flex;">-->
+ <!-- <el-input v-model="form.username" placeholder="璇疯緭鍏�" style="width: 200px" />-->
+ <!-- </el-form-item>-->
+ <!-- <el-form-item v-show="isExpandForm" label="鐢ㄦ埛缂栫爜" style=" display: flex;">-->
+ <!-- <el-input v-model="form.usercode" placeholder="璇疯緭鍏�" style="width: 200px" />-->
+ <!-- </el-form-item>-->
+ <!-- <el-form-item v-show="isExpandForm" label="鐢ㄦ埛鍚嶇О" style=" display: flex;">-->
+ <!-- <el-input v-model="form.username" placeholder="璇疯緭鍏�" style="width: 200px" />-->
+ <!-- </el-form-item>-->
+ <!-- <el-form-item v-show="isExpandForm" label="鐢ㄦ埛缂栫爜" style=" display: flex;">-->
+ <!-- <el-input v-model="form.usercode" placeholder="璇疯緭鍏�" style="width: 200px" />-->
+ <!-- </el-form-item>-->
+ <!-- <el-form-item v-show="isExpandForm" label="鐢ㄦ埛鍚嶇О" style=" display: flex;">-->
+ <!-- <el-input v-model="form.username" placeholder="璇疯緭鍏�" style="width: 200px" />-->
+ <!-- </el-form-item>-->
+ </div>
+ <div
+ class="bodySearchReset"
+ :style="{marginLeft:$store.state.app.sidebar.opened? $store.state.settings.menuIsHorizontal?'15%':'3%':'10%'}"
+ >
+ <el-button
+ v-waves
+ type="primary"
+ icon="el-icon-search"
+ @click="getTMaterielData($refs.treeLeftRef.getCurrentNode())"
+ >鏌ヨ
+ </el-button>
+ <el-button v-waves type="info" icon="el-icon-refresh" @click="reset">閲嶇疆</el-button>
+ </div>
+ </el-form>
+ <div
+ class="bodyTopFormExpand"
+ style="height: 5px;"
+ >
+ <!-- <svg-icon-->
+ <!-- v-show="mouseHoverType==='mouseout'"-->
+ <!-- style="cursor: pointer"-->
+ <!-- :icon-class="!isExpandForm?'doubleDown3':'doubleUp3'"-->
+ <!-- @mouseenter="mouseHoverType=$event.type"-->
+ <!-- />-->
+ <!-- <svg-icon-->
+ <!-- v-show="mouseHoverType==='mouseenter'"-->
+ <!-- style="cursor: pointer"-->
+ <!-- :icon-class="!isExpandForm?'doubleDown':'doubleUp'"-->
+ <!-- @click="isExpandForm=!isExpandForm"-->
+ <!-- @mouseout="mouseHoverType=$event.type"-->
+ <!-- />-->
+ </div>
+ </div>
+
+ <div class="elTableDiv">
+ <el-table
+ ref="tableDataRef"
+ class="tableFixed"
+ :data="tableData"
+ :height="isExpandForm?tableHeight:(tableHeight+80)+'px'"
+ border
+ row-class-name="custom-row"
+ :style="{width: 100+'%',height:isExpandForm?tableHeight:(tableHeight+80)+'px',}"
+ highlight-current-row
+ :header-cell-style="this.$headerCellStyle"
+ :cell-style="this.$cellStyle"
+ @sort-change="sortChange"
+ >
+ <!-- prop="RowNum"-->
+ <el-table-column
+ prop="rowNum"
+ width="50"
+ fixed
+ label="搴忓彿"
+ />
+ <el-table-column
+ prop="partcode"
+ label="瀛樿揣缂栫爜"
+ sortable="custom"
+ width="110"
+ />
+ <el-table-column
+ prop="partname"
+ label="瀛樿揣鍚嶇О"
+ sortable="custom"
+ show-tooltip-when-overflow
+ min-width="200"
+ />
+ <el-table-column
+ prop="partspec"
+ label="瑙勬牸鍨嬪彿"
+ width="110"
+ sortable="custom"
+ >
+ <template slot-scope="{row}">
+ {{ row.partspec ? row.partspec : '/' }}
+ </template>
+ </el-table-column>
+ <el-table-column
+ prop="idinventoryclassname"
+ label="鎵�灞炵被鍒�"
+ sortable="custom"
+ width="110"
+ />
+ <el-table-column
+ label="璁¢噺鍗曚綅"
+ width="110"
+ sortable="custom"
+ >
+ <template slot-scope="{row}">
+ {{ row.isSingleUnit === '0' ? row.idunitgroupname : row.idunitname }}
+ </template>
+ </el-table-column>
+ <el-table-column
+ prop="status"
+ label="瀛樿揣鐘舵��"
+ width="110"
+ sortable="custom"
+ >
+ <template slot-scope="{row}">
+ <el-tag v-if="row.status==='0'" size="small" type="success">姝e父</el-tag>
+ <el-tag v-if="row.status==='1'" size="small" type="danger">鍋滅敤</el-tag>
+ </template>
+ </el-table-column>
+ <el-table-column
+ label="瀛樿揣灞炴��"
+ sortable="custom"
+ min-width="220"
+ >
+ <template slot-scope="{row}">
+ {{ row.isPurchase === '1' ? '澶栬喘' : '' }}
+ {{ row.isSale === '1' ? '閿�鍞�' : '' }}
+ {{ row.isMadeSelf === '1' ? '鑷埗' : '' }}
+ {{ row.isMaterial === '1' ? '鐢熶骇娑堣��' : '' }}
+ {{ row.isMadeRequest === '1' ? '濮斿' : '' }}
+ </template>
+ </el-table-column>
+
+ <el-table-column
+ label="宸ヨ壓"
+ prop=""
+
+ width="110"
+ >
+ <template slot-scope="{row}">
+
+ <!-- <i-->
+ <!-- v-if="row.is_retdproc==='Y'"-->
+ <!-- :style="{color:$store.state.settings.theme}"-->
+ <!-- class="el-icon-share"-->
+ <!-- style="cursor: pointer"-->
+ <!-- @click="routeClick(row)"-->
+ <!-- />-->
+
+ <i
+ :style="{color:row.is_retdproc==='Y'?$store.state.settings.theme:`rgb(180 ,181, 185)`,cursor: 'pointer'}"
+ class="el-icon-share"
+ @click="mesSetting.route?routeClick(row):routeClick2(row)"
+ />
+ </template>
+ </el-table-column>
+
+ <!-- <el-table-column-->
+ <!-- label="鏁版嵁鏉ユ簮"-->
+ <!-- prop="data_sources"-->
+ <!-- sortable="custom"-->
+ <!-- width="110"-->
+ <!-- />-->
+ <el-table-column
+ label="鍒涘缓浜哄憳"
+ prop="lm_user"
+ sortable="custom"
+ width="110"
+ />
+ <el-table-column
+ label="鍒涘缓鏃堕棿"
+ prop="lm_date"
+ sortable="custom"
+ width="160"
+ />
+
+ <el-table-column
+ label="鎿嶄綔"
+ width="120"
+ fixed="right"
+ >
+ <template slot-scope="{row}">
+ <div class="operationClass">
+ <el-tooltip class="item" effect="dark" content="缂栬緫" placement="top">
+ <i
+ class="el-icon-edit-outline"
+ :style="{color:$store.state.settings.theme}"
+ @click="edit('edit',row)"
+ />
+ </el-tooltip>
+ <el-tooltip v-del-tab-index class="item" effect="dark" content="鍒犻櫎" placement="top">
+ <i
+ class="el-icon-delete"
+ :style="{color:$store.state.settings.theme}"
+ @click="del(row)"
+ />
+ </el-tooltip>
+ </div>
+ </template>
+ </el-table-column>
+ </el-table>
+ </div>
+
+ <!--鍒嗛〉-->
+ <pagination
+ :total="total"
+ :page.sync="form.page"
+ :limit.sync="form.rows"
+ align="right"
+ layout="total,prev, pager, next,sizes,jumper"
+ popper-class="select_bottom"
+ @pagination="getTMaterielData($refs.treeLeftRef.getCurrentNode())"
+ />
+
+ </div>
+ </div>
+ </div>
+
+ <!-- 瀛樿揣绫诲埆鏂板淇敼-->
+ <el-dialog
+ v-el-drag-dialog
+ :title="operation==='add'?'鏂板':'缂栬緫'"
+ :visible.sync="dialogClassVisible"
+ width="800px"
+ :close-on-click-modal="false"
+ top="15vh"
+ @closed="handleClassClose"
+ @close="handleClassClose"
+ >
+ <el-form ref="dialogClassForm" inline :rules="dialogClassFormRules" :model="dialogClassForm" label-width="80px">
+ <el-form-item label="鍒嗙被缂栫爜" prop="inventoryclasscode">
+ <el-input v-model="dialogClassForm.inventoryclasscode" :disabled="operation!=='add'" style="width: 200px" />
+ </el-form-item>
+ <el-form-item label="鍒嗙被鍚嶇О" prop="inventoryclassname">
+ <el-input v-model="dialogClassForm.inventoryclassname" style="width: 200px" />
+ </el-form-item>
+ <el-form-item label="涓婄骇鍒嗙被">
+ <el-select
+ v-model="dialogClassForm.parentcode"
+ style="width:200px"
+ placeholder="璇烽�夋嫨"
+ :popper-append-to-body="false"
+ clearable
+ >
+ <el-option
+ v-for="item in treeLeftArr"
+ :key="item.code"
+ :label="item.name"
+ :value="item.code"
+ />
+ </el-select>
+ </el-form-item>
+ </el-form>
+
+ <span slot="footer" class="dialog-footer">
+ <div class="footerButton">
+ <el-button v-waves @click="dialogVisibleClassCancel">鍙� 娑�</el-button>
+ <el-button
+ v-waves
+ type="primary"
+ :loading="$store.state.app.buttonIsDisabled"
+ :disabled="$store.state.app.buttonIsDisabled"
+ @click="dialogVisibleClassConfirm"
+ >纭� 瀹�</el-button>
+ </div>
+ </span>
+ </el-dialog>
+
+ <!-- 瀛樿揣妗f鏂板淇敼-->
+ <el-dialog
+ v-el-drag-dialog
+ :title="operation==='add'?'鏂板':'缂栬緫'"
+ :visible.sync="dialogVisible"
+ width="1200px"
+ :close-on-click-modal="false"
+ top="15vh"
+ @closed="handleClose"
+ @close="handleClose"
+ >
+
+ <el-form ref="dialogForm" class="" inline :rules="dialogFormRules" :model="dialogForm" label-width="110px">
+ <el-divider content-position="left">鍩烘湰淇℃伅</el-divider>
+ <el-form-item label="瀛樿揣缂栫爜" prop="partcode">
+ <el-input v-model="dialogForm.partcode" :disabled="operation!=='add'" style="width: 200px" />
+ </el-form-item>
+ <el-form-item label="瀛樿揣鍚嶇О" prop="partname">
+ <el-input v-model="dialogForm.partname" style="width: 200px" />
+ </el-form-item>
+ <el-form-item label="瑙勬牸鍨嬪彿">
+ <el-input v-model="dialogForm.partspec" style="width: 200px" />
+ </el-form-item>
+ <el-form-item label="鎵�灞炵被鍒�" prop="inventoryclasscode">
+ <el-select
+ v-model="dialogForm.inventoryclasscode"
+ style="width:200px"
+ placeholder="璇烽�夋嫨"
+ filterable
+ :popper-append-to-body="false"
+ >
+ <el-option
+ v-for="item in treeLeftArr"
+ :key="item.code"
+ :label="item.name"
+ :value="item.code"
+ />
+ </el-select>
+ </el-form-item>
+ <el-form-item label="鎵�灞炰粨搴�" prop="idwarehouse">
+ <el-select
+ v-model="dialogForm.idwarehouse"
+ style="width:200px"
+ placeholder="璇烽�夋嫨"
+ filterable
+ :popper-append-to-body="false"
+ >
+ <el-option
+ v-for="item in idwarehouseArr"
+ :key="item.code"
+ :label="item.name"
+ :value="item.code"
+ />
+ </el-select>
+ </el-form-item>
+ <el-form-item required label="瀛樿揣鐘舵��">
+ <el-radio-group v-model="dialogForm.status">
+ <el-radio label="0">姝e父</el-radio>
+ <el-radio label="1">鍋滅敤</el-radio>
+ </el-radio-group>
+ </el-form-item>
+
+ <el-divider content-position="left">璁¢噺鍗曚綅</el-divider>
+ <el-form-item label="璁¢噺鏂瑰紡" required prop="unittypcode">
+ <el-select
+ v-model="dialogForm.unittypcode"
+ style="width:200px"
+ placeholder="璇烽�夋嫨"
+ filterable
+ :popper-append-to-body="false"
+ @change="unittypcodeChange"
+ >
+ <el-option
+ v-for="item in unittypcodeArr"
+ :key="item.code"
+ :label="item.name"
+ :value="item.code"
+ />
+ </el-select>
+ </el-form-item>
+ <el-form-item :label="dialogForm.unittypcode==='1'? '璁¢噺鍗曚綅':'璁¢噺鍗曚綅缁�'" prop="unitcode">
+ <el-select
+ v-if="dialogForm.unittypcode==='1'"
+ v-model="dialogForm.unitcode"
+ style="width:200px"
+ placeholder="璇烽�夋嫨"
+ filterable
+ :popper-append-to-body="false"
+ @change="val=>unitcodeChange(val,'1')"
+ >
+ <el-option
+ v-for="item in unitcodeSingleArr"
+ :key="item.unitcode"
+ :label="item.unitname"
+ :value="item.unitcode"
+ />
+ </el-select>
+ <el-select
+ v-if="dialogForm.unittypcode!=='1'"
+ v-model="dialogForm.unitcode"
+ style="width:200px"
+ placeholder="璇烽�夋嫨"
+ filterable
+ :popper-append-to-body="false"
+ @change="val=>unitcodeChange(val,'0')"
+ >
+ <el-option
+ v-for="item in unitcodeGroupArr"
+ :key="item.unitcode"
+ :label="item.unitname"
+ :value="item.unitcode"
+ />
+ </el-select>
+ </el-form-item>
+ <el-form-item label="鎶ヨ〃杈呭崟浣�">
+ <el-select
+ v-model="dialogForm.idSubUnitByReport"
+ style="width:200px"
+ placeholder="璇烽�夋嫨"
+ filterable
+ :disabled="dialogForm.unittypcode==='1'"
+ :popper-append-to-body="false"
+ >
+ <el-option
+ v-for="item in idSubUnitByReportArr"
+ :key="item.unitcode"
+ :label="item.unitname"
+ :value="item.unitcode"
+ />
+ </el-select>
+ </el-form-item>
+ <el-form-item label="搴撳瓨甯哥敤鍗曚綅">
+ <el-select
+ v-model="dialogForm.idUnitByStock"
+ style="width:200px"
+ placeholder="璇烽�夋嫨"
+ filterable
+ :disabled="dialogForm.unittypcode==='1'"
+ :popper-append-to-body="false"
+ >
+ <el-option
+ v-for="item in idUnitBvStockArr"
+ :key="item.unitcode"
+ :label="item.unitname"
+ :value="item.unitcode"
+ />
+ </el-select>
+ </el-form-item>
+ <el-form-item label="閲囪喘甯哥敤鍗曚綅">
+ <el-select
+ v-model="dialogForm.idUnitByPurchase"
+ style="width:200px"
+ placeholder="璇烽�夋嫨"
+ filterable
+ :disabled="dialogForm.unittypcode==='1'"
+ :popper-append-to-body="false"
+ >
+ <el-option
+ v-for="item in idUnitBvStockArr"
+ :key="item.unitcode"
+ :label="item.unitname"
+ :value="item.unitcode"
+ />
+ </el-select>
+ </el-form-item>
+ <el-form-item label="閿�鍞父鐢ㄥ崟浣�">
+ <el-select
+ v-model="dialogForm.idUnitBySale"
+ style="width:200px"
+ placeholder="璇烽�夋嫨"
+ filterable
+ :disabled="dialogForm.unittypcode==='1'"
+ :popper-append-to-body="false"
+ >
+ <el-option
+ v-for="item in idUnitBvStockArr"
+ :key="item.unitcode"
+ :label="item.unitname"
+ :value="item.unitcode"
+ />
+ </el-select>
+ </el-form-item>
+ <el-form-item label="鐢熶骇甯哥敤鍗曚綅">
+ <el-select
+ v-model="dialogForm.idunitbymanufacture"
+ style="width:200px"
+ placeholder="璇烽�夋嫨"
+ filterable
+ :disabled="dialogForm.unittypcode==='1'"
+ :popper-append-to-body="false"
+ >
+ <el-option
+ v-for="item in idUnitBvStockArr"
+ :key="item.unitcode"
+ :label="item.unitname"
+ :value="item.unitcode"
+ />
+ </el-select>
+ </el-form-item>
+ <el-divider content-position="left">瀛樿揣灞炴��</el-divider>
+ <el-checkbox v-model="dialogForm.isPurchase" style="margin-left: 70px;">澶栬喘</el-checkbox>
+ <el-checkbox v-model="dialogForm.isSale">閿�鍞�</el-checkbox>
+ <el-checkbox v-model="dialogForm.isMadeSelf">鑷埗</el-checkbox>
+ <el-checkbox v-model="dialogForm.isMaterial">鐢熶骇娑堣��</el-checkbox>
+ <el-checkbox v-model="dialogForm.isMadeRequest">濮斿</el-checkbox>
+ <!-- <el-divider content-position="left">瀛樿揣鎻忚堪</el-divider>-->
+ <!-- <el-form-item label="瀛樿揣鎻忚堪">-->
+ <!-- <el-input-->
+ <!-- v-model="dialogForm.username"-->
+ <!-- type="textarea"-->
+ <!-- :autosize="{ minRows: 2, maxRows: 4}"-->
+ <!-- style="width: 490px;"-->
+ <!-- />-->
+ <!-- </el-form-item>-->
+
+ </el-form>
+
+ <span slot="footer" class="dialog-footer">
+ <div class="footerButton">
+ <el-button v-waves @click="dialogVisibleCancel">鍙� 娑�</el-button>
+ <el-button
+ v-waves
+ type="primary"
+ :loading="$store.state.app.buttonIsDisabled"
+ :disabled="$store.state.app.buttonIsDisabled"
+ @click="dialogVisibleConfirm"
+ >纭� 瀹�</el-button>
+ </div>
+ </span>
+ </el-dialog>
+
+ <!-- 宸ヨ壓璺嚎瀵硅瘽妗�-->
+ <el-dialog
+ v-el-drag-dialog
+ :close-on-click-modal="false"
+ title="鍏宠仈宸ヨ壓璺嚎"
+ :visible.sync="dialogVisibleRoute"
+ width="800px"
+ top="5vh"
+ class="dialogVisibleRoute"
+ @closed="handleCloseRoute"
+ @close="handleCloseRoute"
+ >
+ <div>
+ <i class="el-icon-s-comment" :style="{color:$store.state.settings.theme}" /> 浜у搧鍚嶇О锛歿{
+ dialogFormRoute.projectName
+ }}
+ </div>
+ <el-divider />
+ <div style="margin-bottom: 10px">
+ <i class="el-icon-s-operation" :style="{color:$store.state.settings.theme}" /> 宸ヨ壓璺嚎闆嗗悎
+ </div>
+
+ <div class="myCheckboxGroup">
+ <div
+ v-for="item in dialogFormRoute.routeOperationArr"
+ :key="item.code"
+ :style="{border:item.isSelected1?'1px solid '+$store.state.settings.theme:'1px solid #eee'}"
+ class="myCheckbox"
+ @click="myCheckboxClick(item)"
+ >
+ <!-- <input-->
+ <!-- class="myCheckboxInput"-->
+ <!-- type="checkbox"-->
+ <!-- :value="item.code"-->
+ <!-- :name="item.name"-->
+ <!-- :style="{color:item.isSelected2?'#42b983':'#fff'}"-->
+ <!-- @click="myCheckboxInputClick(item)"-->
+ <!-- >{{ item.name }}-->
+ <!-- 鐖跺瓙鐐瑰嚮浜嬩欢涓嶅奖鍝�-->
+ <!-- onClick="event.cancelBubble = true"-->
+ <el-checkbox
+ :key="item.code"
+ v-model="item.isSelected2"
+ class="myCheckboxInput"
+ :value="item.code"
+ :name="item.name"
+ :label="item.name"
+ :checked="item.isSelected2"
+ @change="myCheckboxInputClick(item)"
+ />
+ <div class="myCheckboxInputLabel">{{ item.name }}</div>
+
+ </div>
+ </div>
+
+ <el-divider />
+ <div>
+ <i class="el-icon-s-operation" :style="{color:$store.state.settings.theme}" /> 榛樿宸ヨ壓璺嚎
+ </div>
+ <div style="margin-top: 20px">
+ <el-select
+ v-model="defaultroute_code"
+ filterable
+ style="width: 200px;"
+ placeholder="璇烽�夋嫨"
+ class="defaultroute_code"
+ >
+ <el-option
+ v-for="item in defaultroute_codeArr"
+ :key="item.code"
+ :label="item.name"
+ :value="item.code"
+ />
+ </el-select>
+ </div>
+ <el-divider />
+ <div style="margin-bottom: 10px">
+ <i class="el-icon-s-operation" :style="{color:$store.state.settings.theme}" /> 宸ュ簭鍒楄〃
+ </div>
+ <div style="overflow-y: scroll">
+ <el-table
+ ref="projectTableData"
+ :data="projectTableData"
+ border
+ height="280"
+ :row-class-name="tableRowClassName"
+ highlight-current-row
+ :header-cell-style="this.$headerCellStyle"
+ :cell-style="this.$cellStyle"
+ >
+ <el-table-column
+ prop="seq"
+ width="100"
+ label="宸ュ簭搴忓彿"
+ fixed
+ />
+ <el-table-column
+ prop="stepcode"
+ show-tooltip-when-overflow
+ label="宸ュ簭缂栫爜"
+ />
+ <el-table-column
+ prop="stepname"
+ label="宸ュ簭鍚嶇О"
+ show-tooltip-when-overflow
+ />
+ <el-table-column
+ prop="enable"
+ label="鍚敤鐘舵��"
+ show-tooltip-when-overflow
+ fixed="right"
+ >
+ <template slot-scope="{row}">
+ <div v-if="row.enable==='Y'">
+ <i class="el-icon-success" :style="{color:$store.state.settings.theme}" style="margin-right: 2px" />
+ 鏄�
+ </div>
+ <div v-if="row.enable==='N'">
+ <i class="el-icon-info" style="margin-right: 2px" />
+ 鍚�
+ </div>
+ </template>
+ </el-table-column>
+ </el-table>
+ </div>
+ <span slot="footer" class="dialog-footer">
+ <div class="footerButton">
+ <el-button v-waves @click="routeDialogVisibleCancel">鍙� 娑�</el-button>
+ <el-button
+ v-waves
+ type="primary"
+ :loading="$store.state.app.buttonIsDisabled"
+ :disabled="$store.state.app.buttonIsDisabled"
+ @click="routeDialogVisibleConfirm"
+ >纭� 瀹�</el-button>
+ </div>
+ </span>
+ </el-dialog>
+
+ <!-- 鎸夊伐鑹鸿蛋 宸ュ簭瀵硅瘽妗�-->
+ <el-dialog
+ v-el-drag-dialog
+ :close-on-click-modal="false"
+ title="鍏宠仈宸ュ簭"
+ :visible.sync="dialogVisibleStep"
+ width="800px"
+ top="15vh"
+ class="dialogVisibleStep"
+ @closed="handleCloseStep"
+ @close="handleCloseStep"
+ >
+
+ <div style="display: flex;align-items: center">
+ <div style="font-weight: bolder">宸ュ簭閫夋嫨锛�</div>
+ <el-drag-select
+ v-model="stepSelectedValue"
+ style="width:570px;"
+ multiple
+ placeholder="璇烽�夋嫨鐩稿搴斿伐搴�"
+ >
+ <!-- :disabled="!(dialogForm.mesorderstus==='NEW'||dialogForm.mesorderstus==='ALLO')"-->
+ <el-option
+ v-for="item in stepSelectArr"
+ :key="item.stepcode"
+ :label="item.stepname"
+ :value="item.stepcode"
+ />
+ </el-drag-select>
+ </div>
+
+ <el-table
+ ref="stepTableDataRef"
+ :data="stepTableData"
+ border
+ :row-class-name="tableRowClassName"
+ height="300"
+ style="width: 100%;margin-top: 15px;"
+ highlight-current-row
+ :header-cell-style="this.$headerCellStyle"
+ :cell-style="this.$cellStyle"
+ row-key="stepcode"
+ >
+ <el-table-column
+ type="index"
+ label="搴忓彿"
+ width="50"
+ />
+ <el-table-column
+ prop="stepcode"
+ show-tooltip-when-overflow
+ label="宸ュ簭缂栫爜"
+ />
+ <el-table-column
+ prop="stepname"
+ label="宸ュ簭鍚嶇О"
+ show-tooltip-when-overflow
+ />
+ <!-- <el-table-column-->
+ <!-- prop="stepprice"-->
+ <!-- label="鐢熶骇鍗曚环"-->
+ <!-- show-tooltip-when-overflow-->
+ <!-- >-->
+ <!-- <template slot-scope="{row}">-->
+ <!-- <el-input-->
+ <!-- v-model="row.stepprice"-->
+ <!-- placeholder="璇疯緭鍏ュ伐搴忓崟浠�"-->
+ <!-- oninput="value=value.replace(/[^0-9.]/g,'')"-->
+ <!-- style="width: 100%"-->
+ <!-- @click.stop=""-->
+ <!-- />-->
+ <!-- </template>-->
+ <!-- </el-table-column>-->
+ <el-table-column
+ label="鎿嶄綔"
+ width="120"
+ >
+ <template slot-scope="{row}">
+ <div class="operationClass">
+ <!-- <el-tooltip class="item" effect="dark" content="绉诲姩" placement="top">-->
+ <i
+ class="el-icon-rank"
+ :style="{color:$store.state.settings.theme}"
+ style="cursor: move"
+ />
+ <!-- </el-tooltip>-->
+ <!-- @click="edit('edit',row)"-->
+
+ <el-tooltip v-del-tab-index class="item" effect="dark" content="鍒犻櫎" placement="top">
+ <i
+ class="el-icon-delete"
+ :style="{color:$store.state.settings.theme}"
+ style="margin-left: 15px;"
+ @click="stepDel(row)"
+ />
+ </el-tooltip>
+ </div>
+ </template>
+ </el-table-column>
+ </el-table>
+
+ <span slot="footer" class="dialog-footer">
+ <div class="footerButton">
+ <el-button v-waves @click="stepDialogVisibleCancel">鍙� 娑�</el-button>
+ <el-button
+ v-waves
+ type="primary"
+ :loading="$store.state.app.buttonIsDisabled"
+ :disabled="$store.state.app.buttonIsDisabled"
+ @click="stepDialogVisibleConfirm"
+ >纭� 瀹�</el-button>
+ </div>
+ </span>
+ </el-dialog>
+ </div>
+</template>
+
+<script>
+import waves from '@/directive/waves'
+import Pagination from '@/components/Pagination'
+import { validateCode } from '@/utils/global'
+import elDragDialog from '@/directive/el-drag-dialog'
+import {
+ SaveTMaterielFile,
+ TMaterielAddUpdate,
+ TMaterielClassTree,
+ TMaterielClassTreeAddUpdate,
+ TMaterielClassTreeDelete,
+ TMaterielData, TMaterielDelete, TMaterielFileAssociationRoute
+} from '@/api/ProductModel'
+import arrayToTree from 'array-to-tree'
+import { StepData, UnitSerch, WareHouse } from '@/api/GeneralBasicData'
+import { SaveSearchMateriel_Info } from '@/api/ErpSyncMes'
+import $ from 'jquery'
+import Sortable from 'sortablejs'
+import ElDragSelect from '@/components/DragSelect'
+
+export default {
+ name: 'InventoryList2',
+ directives: { waves, elDragDialog },
+ components: {
+ Pagination, ElDragSelect
+ },
+ data() {
+ return {
+ mouseHoverType: 'mouseout',
+ isExpandForm: false,
+ mainHeight: 0,
+ tableHeight: 0,
+ operation: '',
+
+ treeLeft: [
+ {
+ code: '-1',
+ name: '鍏ㄩ儴'
+ }
+ ], // 宸︿晶鏍�
+ treeLeftArr: [],
+ defaultPropsLeft: {
+ children: 'children',
+ label: 'name'
+ },
+
+ tableData: [],
+ form: {
+ inventoryclasscode: '',
+ partcode: '',
+ partname: '',
+ partspec: '',
+ page: 1,
+ rows: 20,
+ prop: 'lm_date', // 鎺掑簭瀛楁
+ order: 'desc' // 鎺掑簭瀛楁
+ },
+ total: 0,
+ dialogClassVisible: false,
+ dialogClassForm: {
+ data_sources: '', // 鏁版嵁鏉ユ簮:ERP/MES
+ inventoryclasscode: '', // 瀛樿揣鍒嗙被缂栫爜
+ inventoryclassname: '', // 瀛樿揣鍒嗙被鍚嶇О
+ parentcode: '', // 涓婄骇鍒嗙被缂栫爜
+ OperType: ''// OperType
+ },
+ classArr: [],
+ dialogClassFormRules: {
+ inventoryclasscode: [
+ { required: true, validator: validateCode, trigger: ['blur', 'change'] }
+ ],
+ inventoryclassname: [
+ { required: true, message: '璇疯緭瀛樿揣绫诲瀷鍚嶇О', trigger: ['blur', 'change'] }
+ ]
+ },
+
+ dialogVisible: false,
+ dialogForm: {
+ data_sources: 'MES', // 鏁版嵁鏉ユ簮锛汦RP/MES
+ partcode: '', // 瀛樿揣缂栫爜
+ partname: '', // 瀛樿揣鍚嶇О
+ partspec: '', // 瑙勬牸鍨嬪彿
+ inventoryclasscode: '', // 瀛樿揣绫诲瀷缂栫爜
+ unittypcode: '1', // 璁¢噺鏂瑰紡(0:澶氳閲�,1:鍗曡閲�)
+ unitcode: '', // 璁¢噺鍗曚綅缂栫爜/璁¢噺鍗曚綅缁勭紪鐮�
+ unitsubcode: '', // 璁¢噺鍗曚綅缁勫瓙椤圭紪鐮侊紙瀵瑰簲鐨勬槸 涓昏閲忓崟浣嶇紪鐮侊級
+ idSubUnitByReport: '', // 鎶ヨ〃杈呭崟浣嶇紪鐮�
+ idUnitByStock: '', // 搴撳瓨甯哥敤鍗曚綅缂栫爜
+ idUnitByPurchase: '', // 閲囪喘甯哥敤鍗曚綅缂栫爜
+ idUnitBySale: '', // 閿�鍞父鐢ㄥ崟浣嶇紪鐮�
+ idunitbymanufacture: '', // 鐢熶骇甯哥敤鍗曚綅
+ isPurchase: false, // 鏄惁澶栬喘: 0(鍚�)1(鏄�)
+ isSale: false, // 鏄惁閿�鍞�:0(鍚�)1(鏄�)
+ isMadeSelf: false, // 鏄惁鑷埗: 0(鍚�)1(鏄�)
+ isMaterial: false, // 鏄惁鐢熶骇鑰楃敤: 0(鍚�)1(鏄�)
+ isMadeRequest: false, // 鏄惁濮斿锛�0(鍚�)1(鏄�)
+ idwarehouse: '', // 浠撳簱缂栫爜
+ status: '0', // 浣跨敤鐘舵��: 姝e父(0)鍋滅敤(1)
+ OperType: '' // 鎿嶄綔绫诲瀷
+ },
+ dialogFormRules: {
+ partcode: [
+ { required: true, validator: validateCode, trigger: ['blur', 'change'] }
+ ],
+ partname: [
+ { required: true, message: '璇疯緭鍏ョ粍缁囧悕绉�', trigger: ['blur', 'change'] }
+ ],
+ unitcode: [
+ { required: true, message: '璇烽�夋嫨璁¢噺鍗曚綅(缁�)', trigger: ['blur', 'change'] }
+ ],
+ inventoryclasscode: [
+ { required: true, message: '璇烽�夋嫨鎵�灞炲崟浣�', trigger: ['blur', 'change'] }
+ ]
+ },
+ unittypcodeArr: [
+ { code: '1', name: '鍗曡閲�' },
+ { code: '0', name: '澶氳閲�' }
+ ],
+ unitcodeSingleArr: [],
+ unitcodeGroupArr: [],
+ idSubUnitByReportArr: [],
+ idUnitBvStockArr: [],
+ idwarehouseArr: [],
+
+ // 宸ヨ壓
+ dialogVisibleRoute: false,
+ dialogFormRoute: {
+ projectName: '', // 浜у搧鍚嶇О
+ projectCode: '', // 浜у搧浠g爜
+ routeOperationArr: [] // 宸ヨ壓璺嚎闆嗗悎
+ // routeOperationSelectedArr: [] // 宸ヨ壓璺嚎閫変腑闆嗗悎鏁扮粍
+ },
+ defaultroute_code: '', // 榛樿宸ヨ壓璺嚎閫変腑鍊�
+ defaultroute_codeArr: '', // 榛樿宸ヨ壓璺嚎鏁扮粍
+ projectTableData: [], // 宸ュ簭鍒楄〃
+ mesSetting: JSON.parse(localStorage.getItem('mesSetting')),
+
+ // 鎸夊伐搴忚蛋
+ dialogVisibleStep: false,
+ stepTableData: [],
+ sortable: null,
+ stepSelectArr: [], // 宸ュ簭涓嬫媺鏁版嵁
+ stepSelectedValue: [] // 宸ュ簭涓嬫媺閫変腑鍊�
+ }
+ },
+ watch: {
+ 'stepSelectedValue': {
+ // deep: true,
+ handler: function(val) {
+ // do something with the new and old value of stepSelectedValue
+ console.log(val, 1)
+ const arr = JSON.parse(JSON.stringify(this.stepTableData))
+ const arrStepcode = arr.map(i => i.stepcode)
+ this.stepTableData = []
+ val.forEach(i => {
+ this.stepTableData.push(
+ {
+ stepcode: i,
+ stepname: this.stepSelectArr.find(j => j.stepcode === i).stepname
+ // stepprice: arrStepcode.includes(i) ? arr.find(j => j.stepcode === i).stepprice : 0
+ }
+ )
+ })
+ }
+ }
+ },
+
+ activated() {
+ window.addEventListener('resize', this.getHeight)
+ this.getHeight()
+ },
+ created() {
+
+ },
+ mounted() {
+ window.addEventListener('resize', this.getHeight)
+ this.getHeight()
+
+ this.getTMaterielClassTree()
+ this.getSelectApi()
+ },
+ methods: {
+ // 宸ヨ壓鐐瑰嚮 ,鎸夊伐搴忚蛋
+ async routeClick2(row) {
+ this.dialogVisibleStep = true
+ this.dialogFormRoute.projectCode = row.partcode
+
+ const res = await TMaterielFileAssociationRoute({ partcode: this.dialogFormRoute.projectCode })
+ if (res.code === '200' && res.data.length > 0) {
+ this.stepSelectedValue = res.data.map(i => i.step_code)
+ }
+
+ // 鎷栧姩琛ㄦ牸
+ this.$nextTick(() => {
+ this.setSort()
+ })
+ },
+
+ stepDialogVisibleCancel() {
+ this.dialogVisibleStep = false
+ },
+
+ async stepDialogVisibleConfirm() {
+ if (this.stepSelectedValue.length === 0) {
+ return this.$message.info('宸ュ簭鑷冲皯瑕佹湁涓�閬擄紒')
+ }
+ const children = []
+ this.stepSelectedValue.forEach((item, index) => {
+ const t = this.stepSelectArr.find(i => i.stepcode === item)
+ children.push({
+ 'code': t.stepcode,
+ 'name': t.stepname,
+ 'seq': index + 1,
+ 'isbott': index === 0 ? 'Y' : 'N',
+ 'isend': index === this.stepSelectedValue.length - 1 ? 'Y' : 'N'
+ })
+ })
+ const data = [
+ {
+ 'partcode': this.dialogFormRoute.projectCode,
+ 'defaultroute_code': '',
+ 'children': children
+ }
+ ]
+ this.$store.state.app.buttonIsDisabled = true
+ const res = await SaveTMaterielFile(data)
+ if (res.code === '200') {
+ this.dialogVisibleStep = false
+ this.$message.success('淇濆瓨鎴愬姛锛�')
+ await this.getTMaterielData(this.$refs.treeLeftRef.getCurrentNode())
+ this.$store.state.app.buttonIsDisabled = false
+ }
+ },
+ // 宸ュ簭鍒犻櫎
+ stepDel(row) {
+ const index = this.stepSelectedValue.findIndex(i => i === row.stepcode)
+ this.stepSelectedValue.splice(index, 1)
+ },
+ handleCloseStep() {
+ this.stepTableData = []
+ this.sortable = null
+ this.stepSelectedValue = []
+ },
+
+ setSort() {
+ const el = this.$refs.stepTableDataRef.$el.querySelectorAll('.el-table__body-wrapper > table > tbody')[0]
+ this.sortable = Sortable.create(el, {
+ ghostClass: 'sortable-ghost', // Class name for the drop placeholder,
+ setData: function(dataTransfer) {
+ // to avoid Firefox bug
+ // Detail see : https://github.com/RubaXa/Sortable/issues/1012
+ dataTransfer.setData('Text', '')
+ },
+ onEnd: evt => {
+ const targetRow = this.stepTableData.splice(evt.oldIndex, 1)[0]
+ this.stepTableData.splice(evt.newIndex, 0, targetRow)
+
+ this.stepSelectedValue = this.stepTableData.map(i => i.stepcode)
+ // for show the changes, you can delete in you code
+ // const tempIndex = this.newList.splice(evt.oldIndex, 1)[0]
+ // this.newList.splice(evt.newIndex, 0, tempIndex)
+ }
+ })
+ },
+
+ tableRowClassName({ row, rowIndex }) {
+ return 'custom-row'
+ },
+
+ /* 鐐瑰嚮鍏宠仈宸ヨ壓璺嚎妯″潡*/
+ // 宸ヨ壓璺嚎鐐瑰嚮
+ routeClick(row) {
+ const loading = this.$loading({
+ lock: true,
+ text: '姝e湪鍔犺浇鏁版嵁锛岃绋嶇瓑...',
+ spinner: 'el-icon-loading',
+ customClass: 'osloading',
+ background: 'rgba(0, 0, 0, 0.7)'
+ })
+
+ this.defaultroute_code = row.default_route
+ this.dialogFormRoute.projectCode = row.partcode
+ this.dialogFormRoute.projectName = row.partname
+
+ TMaterielFileAssociationRoute({ partcode: this.dialogFormRoute.projectCode }).then(res => {
+ if (res.code === '200') {
+ setTimeout(() => {
+ loading.close()
+ this.dialogVisibleRoute = true
+ this.dialogFormRoute.routeOperationArr = res.data
+ // let waitFlag = false// 鍥炴樉绛夊緟鏄惁鏀捐
+
+ this.dialogFormRoute.routeOperationArr.forEach((item, index) => {
+ item.isSelected1 = false
+ item.isSelected2 = false
+ if (index === 0) {
+ item.isSelected1 = true
+ this.projectTableData = item.Data
+ }
+ if (item.flag === 'Y') {
+ item.isSelected2 = true
+ this.$nextTick(() => {
+ $('input:checkbox').eq(index).prop('checked', true)
+ })
+
+ // const interval = setInterval(() => {
+ // if ($('input:checkbox').length > 0) {
+ // waitFlag = true
+ // }
+ // if (waitFlag) {
+ // clearInterval(interval)
+ // this.$nextTick(() => {
+ // $('input:checkbox').eq(index).prop('checked', true)
+ // })
+ // }
+ // }, 100)
+ }
+ })
+
+ this.defaultroute_codeArr = this.dialogFormRoute.routeOperationArr.filter(item => item.flag === 'Y')
+ }, 1000)
+ } else {
+ loading.close()
+ }
+ })
+ },
+ // 瀵硅瘽妗嗗叧闂�
+ handleCloseRoute() {
+ this.dialogFormRoute.routeOperationArr = []
+ this.defaultroute_codeArr = []
+ },
+ // 鍙栨秷
+ routeDialogVisibleCancel() {
+ this.dialogVisibleRoute = false
+ },
+ // 纭畾
+ async routeDialogVisibleConfirm() {
+ if (!this.defaultroute_code || this.defaultroute_code === 'null') {
+ return this.$message.info('榛樿宸ヨ壓璺嚎涓嶈兘涓虹┖锛�')
+ }
+
+ // 鎻愪氦鏍煎紡
+ const data = []
+ this.dialogFormRoute.routeOperationArr.forEach(item => {
+ if (item.isSelected2) {
+ data.push({ code: item.code, name: item.name })
+ }
+ })
+
+ const D = [{
+ 'partcode': this.dialogFormRoute.projectCode,
+ 'defaultroute_code': this.defaultroute_code,
+ 'children': data
+ }]
+
+ this.$store.state.app.buttonIsDisabled = true
+ const res = await SaveTMaterielFile(D)
+ if (res.code === '200') {
+ this.dialogVisibleRoute = false
+ this.$message.success('淇濆瓨鎴愬姛锛�')
+ await this.getTMaterielData(this.$refs.treeLeftRef.getCurrentNode())
+ this.$store.state.app.buttonIsDisabled = false
+ }
+ },
+ // 澶х洅瀛愮偣鍑讳簨浠�
+ myCheckboxClick(val) {
+ console.log(val, 1)
+ this.dialogFormRoute.routeOperationArr.forEach(item => {
+ item.isSelected1 = val.code === item.code
+ })
+
+ this.projectTableData = val.Data
+ },
+ // 灏忕洅瀛愮偣鍑讳簨浠�
+ myCheckboxInputClick(val) {
+ // console.log(val, 2)
+ val.isSelected2 = !!val.isSelected2
+
+ this.dialogFormRoute.routeOperationArr.forEach((item, index) => {
+ if (val.code === item.code) {
+ item.flag = !item.flag
+ }
+ })
+ if (val.code === this.defaultroute_code) {
+ this.defaultroute_code = ''
+ }
+ this.defaultroute_codeArr = this.dialogFormRoute.routeOperationArr.filter(item => item.isSelected2)
+ },
+
+ async getSelectApi() {
+ const { data: res } = await UnitSerch({ tunittype: 'M' })
+ this.unitcodeGroupArr = res
+
+ const { data: res2 } = await UnitSerch({ tunittype: 'S' })
+ this.unitcodeSingleArr = res2
+
+ const { data: res3 } = await WareHouse()
+ this.idwarehouseArr = res3
+
+ // 鑾峰彇宸ュ簭
+ const { data: res4 } = await StepData()
+ this.stepSelectArr = res4
+ },
+
+ async getTMaterielClassTree() {
+ const res = await TMaterielClassTree()
+ res.data.forEach(i => {
+ i.idparent = i.idparent ? i.idparent : '-1'
+ })
+ this.treeLeftArr = res.data
+ this.treeLeftArr.forEach(e => {
+ e.name = e.code + ' ' + e.name
+ })
+ this.treeLeft = arrayToTree(this.treeLeft.concat(res.data), {
+ parentProperty: 'idparent',
+ customID: 'code',
+ childrenProperty: 'children'
+ })
+
+ this.$nextTick(() => {
+ this.$refs.treeLeftRef.setCurrentKey('-1')
+ this.getTMaterielData(this.$refs.treeLeftRef.getCurrentNode())
+ })
+ },
+ async getTMaterielData(node) {
+ const result = this.getChildrenCodeMethod(node, [])
+ if (result.includes('-1')) {
+ result.shift()
+ }
+ this.form.inventoryclasscode = result.join(',')
+ const res = await TMaterielData(this.form)
+
+ this.tableData = res.data
+ this.total = res.count
+ },
+
+ // 鑾峰彇椤甸潰楂樺害
+ getHeight() {
+ this.$nextTick(() => {
+ this.mainHeight = window.innerHeight - 85
+ this.tableHeight = this.mainHeight - 280
+ this.$refs.tableDataRef.doLayout()
+ })
+ },
+ sortChange({ column, prop, order }) {
+ if (order === 'descending') {
+ order = 'desc'
+ } else if (order === 'ascending') {
+ order = 'asc'
+ } else {
+ order = 'desc'
+ }
+ this.form.order = order
+ this.form.prop = prop
+ this.getTMaterielData(this.$refs.treeLeftRef.getCurrentNode())
+ },
+ // 鏂板鎸夐挳
+ add(operation) {
+ this.operation = operation
+ this.dialogVisible = true
+ this.dialogForm.OperType = 'Add'
+ },
+ // 淇敼鎸夐挳
+ async edit(operation, row) {
+ this.operation = operation
+ this.dialogVisible = true
+ this.dialogForm.OperType = 'Update'
+
+ this.$nextTick(() => {
+ this.dialogForm.data_sources = row.data_sources
+ this.dialogForm.partcode = row.partcode
+ this.dialogForm.partname = row.partname
+ this.dialogForm.partspec = row.partspec
+ this.dialogForm.inventoryclasscode = row.idinventoryclasscode
+ this.dialogForm.unittypcode = row.isSingleUnit
+ // 璁¢噺鏂瑰紡(0:澶氳閲�,1:鍗曡閲�)
+ if (this.dialogForm.unittypcode === '1') {
+ this.dialogForm.unitcode = row.idunitcode
+ this.dialogForm.unitsubcode = ''
+ this.dialogForm.idSubUnitByReport = ''
+ const unitname = this.unitcodeSingleArr.find(i => i.unitcode === this.dialogForm.unitcode).unitname
+
+ this.dialogForm.idUnitByStock = unitname
+ this.dialogForm.idUnitByPurchase = unitname
+ this.dialogForm.idUnitBySale = unitname
+ this.dialogForm.idunitbymanufacture = unitname
+ }
+
+ if (this.dialogForm.unittypcode === '0') {
+ this.dialogForm.unitcode = row.idunitgroupcode
+
+ const t = this.unitcodeGroupArr.find(i => i.unitcode === this.dialogForm.unitcode).children
+
+ this.idSubUnitByReportArr = t.filter(i => i.isMainUnit !== '1')
+ this.idUnitBvStockArr = t
+
+ const mainUnitCode = t.find(i => i.isMainUnit === '1').unitcode
+ this.dialogForm.unitsubcode = mainUnitCode
+ this.dialogForm.idSubUnitByReport = this.idSubUnitByReportArr[0].unitcode
+
+ this.dialogForm.idUnitByStock = mainUnitCode
+ this.dialogForm.idUnitByPurchase = mainUnitCode
+ this.dialogForm.idUnitBySale = mainUnitCode
+ this.dialogForm.idunitbymanufacture = mainUnitCode
+ }
+
+ this.dialogForm.isPurchase = row.isPurchase === '1'
+ this.dialogForm.isSale = row.isSale === '1'
+ this.dialogForm.isMadeSelf = row.isMadeSelf === '1'
+ this.dialogForm.isMaterial = row.isMaterial === '1'
+ this.dialogForm.isMadeRequest = row.isMadeRequest === '1'
+
+ this.dialogForm.idwarehouse = row.idwarehousecode
+ this.dialogForm.status = row.status
+ })
+ },
+ del(row) {
+ this.$confirm('鏄惁纭鍒犻櫎?', '鎻愮ず', {
+ confirmButtonText: '纭畾',
+ cancelButtonText: '鍙栨秷',
+ type: 'warning'
+ }).then(() => {
+ TMaterielDelete({ partcode: row.partcode, data_sources: row.data_sources }).then(res => {
+ if (res.code === '200') {
+ this.$notify.success('鍒犻櫎鎴愬姛!')
+ this.getTMaterielData(this.$refs.treeLeftRef.getCurrentNode())
+ }
+ })
+ }).catch(() => {
+ this.$notify.info('宸插彇娑堝垹闄�')
+ })
+ },
+ reset() {
+ this.form.inventoryclasscode = ''
+ this.form.partcode = ''
+ this.form.partname = ''
+ this.form.partspec = ''
+ this.$refs.treeLeftRef.setCurrentKey('-1')
+ this.getTMaterielData(this.$refs.treeLeftRef.getCurrentNode())
+ },
+ // 瀵硅瘽妗嗗叧闂簨浠�
+ handleClose() {
+ this.dialogForm.data_sources = 'MES'
+ this.dialogForm.partcode = ''
+ this.dialogForm.partname = ''
+ this.dialogForm.partspec = ''
+ this.dialogForm.inventoryclasscode = ''
+ this.dialogForm.unittypcode = '1'
+ this.dialogForm.unitcode = ''
+ this.dialogForm.unitsubcode = ''
+ this.dialogForm.idSubUnitByReport = ''
+ this.dialogForm.idUnitByStock = ''
+ this.dialogForm.idUnitByPurchase = ''
+ this.dialogForm.idUnitBySale = ''
+ this.dialogForm.idunitbymanufacture = ''
+ this.dialogForm.isPurchase = false
+ this.dialogForm.isSale = false
+ this.dialogForm.isMadeSelf = false
+ this.dialogForm.isMaterial = false
+ this.dialogForm.isMadeRequest = false
+ this.dialogForm.idwarehouse = ''
+ this.dialogForm.status = '0'
+ this.$refs.dialogForm.clearValidate()
+ },
+ // 瀵硅瘽妗嗗彇娑�
+ dialogVisibleCancel() {
+ this.dialogVisible = false
+ },
+ // 瀵硅瘽妗嗙‘璁�
+ dialogVisibleConfirm() {
+ this.$refs.dialogForm.validate(valid => {
+ if (valid) {
+ if (!(this.dialogForm.isPurchase || this.dialogForm.isSale || this.dialogForm.isMadeSelf || this.dialogForm.isMaterial || this.dialogForm.isMadeRequest)) {
+ return this.$message.info('瀛樿揣灞炴�т笉鑳戒负绌猴紒')
+ }
+ this.dialogForm.isPurchase = this.dialogForm.isPurchase ? '1' : '0'
+ this.dialogForm.isSale = this.dialogForm.isSale ? '1' : '0'
+ this.dialogForm.isMadeSelf = this.dialogForm.isMadeSelf ? '1' : '0'
+ this.dialogForm.isMaterial = this.dialogForm.isMaterial ? '1' : '0'
+ this.dialogForm.isMadeRequest = this.dialogForm.isMadeRequest ? '1' : '0'
+ // console.log(JSON.parse(JSON.stringify(this.dialogForm)), 1)
+
+ if (this.dialogForm.unittypcode === '1') {
+ this.dialogForm.idUnitByStock = this.dialogForm.unitcode
+ this.dialogForm.idUnitByPurchase = this.dialogForm.unitcode
+ this.dialogForm.idUnitBySale = this.dialogForm.unitcode
+ this.dialogForm.idunitbymanufacture = this.dialogForm.unitcode
+ }
+ this.$store.state.app.buttonIsDisabled = true
+ TMaterielAddUpdate(this.dialogForm).then(res => {
+ if (res.code === '200') {
+ this.$notify.success(this.operation === 'add' ? '娣诲姞鎴愬姛锛�' : '淇敼鎴愬姛锛�')
+ this.dialogVisible = false
+ this.$store.state.app.buttonIsDisabled = false
+ this.getTMaterielData(this.$refs.treeLeftRef.getCurrentNode())
+ } else {
+ this.$store.state.app.buttonIsDisabled = false
+ this.$notify.error(this.operation === 'add' ? '娣诲姞澶辫触锛�' : '淇敼澶辫触锛�')
+ }
+ })
+ }
+ })
+ },
+
+ // 閫掑綊鍙栧瓙闆嗙殑鎵�鏈塩ode
+ getChildrenCodeMethod(node, result) {
+ result.push(node.code)
+ if (node.children && node.children.length > 0) {
+ node.children.forEach(i => {
+ this.getChildrenCodeMethod(i, result)
+ })
+ }
+ return result
+ },
+
+ treeEditClick(node, data, operation) {
+ this.dialogClassForm.data_sources = data.data_sources
+ this.dialogClassForm.inventoryclasscode = data.code
+ this.dialogClassForm.inventoryclassname = data.name.split(' ')[1]
+ this.dialogClassForm.parentcode = data.idparent === '-1' ? '' : data.idparent
+ this.dialogClassForm.OperType = 'Update'
+ this.operation = operation
+ this.dialogClassVisible = true
+ },
+ treeDeleteClick(node, data) {
+ this.$confirm('鏄惁纭鍒犻櫎?', '鎻愮ず', {
+ confirmButtonText: '纭畾',
+ cancelButtonText: '鍙栨秷',
+ type: 'warning'
+ }).then(() => {
+ const result = this.getChildrenCodeMethod(data, [])
+ TMaterielClassTreeDelete({ inventoryclasscode: result.join(',') }).then(res => {
+ if (res.code === '200') {
+ this.$notify.success('鍒犻櫎鎴愬姛!')
+ this.getTMaterielClassTree()
+ }
+ })
+ }).catch(() => {
+ this.$notify.info('宸插彇娑堝垹闄�')
+ })
+ },
+ treeAddClick(operation) {
+ this.operation = operation
+ this.dialogClassVisible = true
+ this.dialogClassForm.OperType = 'Add'
+ this.dialogClassForm.data_sources = 'MES'
+ },
+
+ handleClassClose() {
+ this.dialogClassForm.data_sources = ''
+ this.dialogClassForm.inventoryclasscode = ''
+ this.dialogClassForm.inventoryclassname = ''
+ this.dialogClassForm.parentcode = ''
+ this.dialogClassForm.OperType = ''
+ this.$refs.dialogClassForm.clearValidate()
+ },
+ dialogVisibleClassCancel() {
+ this.dialogClassVisible = false
+ },
+ dialogVisibleClassConfirm() {
+ this.$refs.dialogClassForm.validate(valid => {
+ if (valid) {
+ TMaterielClassTreeAddUpdate(this.dialogClassForm).then(res => {
+ if (res.code === '200') {
+ this.$notify.success(this.operation === 'add' ? '娣诲姞鎴愬姛锛�' : '淇敼鎴愬姛锛�')
+ this.dialogClassVisible = false
+ this.$store.state.app.buttonIsDisabled = false
+ this.getTMaterielClassTree()
+ } else {
+ this.$store.state.app.buttonIsDisabled = false
+ this.$notify.error(this.operation === 'add' ? '娣诲姞澶辫触锛�' : '淇敼澶辫触锛�')
+ }
+ })
+ }
+ })
+ },
+ unittypcodeChange(val) {
+ console.log(val)
+
+ this.dialogForm.unitcode = ''
+ this.dialogForm.unitsubcode = ''
+ this.dialogForm.idSubUnitByReport = ''
+ this.dialogForm.idUnitByStock = ''
+ this.dialogForm.idUnitByPurchase = ''
+ this.dialogForm.idUnitBySale = ''
+ this.dialogForm.idunitbymanufacture = ''
+ // this.$refs.dialogForm.clearValidate()
+ // this.$forceUpdate()
+ },
+ unitcodeChange(val, type) {
+ console.log(val)
+
+ if (type === '1') {
+ // this.dialogForm.unitcode = val
+ this.dialogForm.unitsubcode = ''
+ this.dialogForm.idSubUnitByReport = ''
+
+ const unitname = this.unitcodeSingleArr.find(i => i.unitcode === val).unitname
+
+ this.dialogForm.idUnitByStock = unitname
+ this.dialogForm.idUnitByPurchase = unitname
+ this.dialogForm.idUnitBySale = unitname
+ this.dialogForm.idunitbymanufacture = unitname
+ }
+
+ if (type === '0') {
+ const t = this.unitcodeGroupArr.find(i => i.unitcode === val).children
+
+ this.idSubUnitByReportArr = t.filter(i => i.isMainUnit !== '1')
+ this.idUnitBvStockArr = t
+
+ const mainUnitCode = t.find(i => i.isMainUnit === '1').unitcode
+ this.dialogForm.unitsubcode = mainUnitCode
+ this.dialogForm.idSubUnitByReport = this.idSubUnitByReportArr[0].unitcode
+
+ this.dialogForm.idUnitByStock = mainUnitCode
+ this.dialogForm.idUnitByPurchase = mainUnitCode
+ this.dialogForm.idUnitBySale = mainUnitCode
+ this.dialogForm.idunitbymanufacture = mainUnitCode
+ }
+ },
+ // 鍚屾ERP
+ syncERP() {
+ const loading = this.$loading({
+ lock: true,
+ text: '姝e湪鍚屾ERP锛岃绋嶇瓑...',
+ spinner: 'el-icon-loading',
+ customClass: 'osloading',
+ background: 'rgba(0, 0, 0, 0.7)'
+ })
+
+ SaveSearchMateriel_Info().then(res => {
+ if (res.code === '200') {
+ setTimeout(() => {
+ this.getTMaterielData(this.$refs.treeLeftRef.getCurrentNode())
+ this.getTMaterielClassTree()
+ loading.close()
+ this.$notify.success('鍚屾鎴愬姛锛�')
+ }, 2000)
+ }
+ // else if (res.code === '300') {
+ // setTimeout(() => {
+ // loading.close()
+ // this.$message.error('鍚屾澶辫触锛�')
+ // }, 10000)
+ // }
+ }).catch(e => {
+ loading.close()
+ })
+ }
+ }
+}
+</script>
+
+<style scoped lang="scss">
+$main_color: #42b983;
+.custom-tree-node {
+ flex: 1;
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ font-size: 14px;
+ padding-right: 8px;
+}
+
+//::v-deep .el-checkbox__label {
+// width: 55px;
+//}
+//
+.el-icon-plus:hover, .el-icon-edit:hover, .el-icon-delete:hover {
+ color: #000 !important;
+}
+
+.dialogVisibleRoute {
+ .myCheckboxGroup {
+ display: flex;
+ flex-wrap: wrap;
+
+ .myCheckbox {
+ //border: 1px solid $main_color;
+ border: 1px solid #eee;
+ display: flex;
+ min-width: 100px;
+ padding: 10px;
+ margin: 10px 30px 0 0;
+ border-radius: 5px;
+ cursor: default;
+ position: relative;
+
+ .myCheckboxInput {
+ margin: 1px 5px 0 0;
+ cursor: pointer;
+ }
+
+ .myCheckboxInputLabel {
+ position: absolute;
+ left: 29px;
+ padding: 5px;
+ top: 6px;
+ color: transparent;
+ }
+
+ }
+
+ //.myCheckbox{
+ // border: 1px solid $main_color;
+ //}
+
+ input[type=checkbox] {
+ cursor: pointer;
+ position: relative;
+ width: 14px;
+ height: 14px;
+ font-size: 14px;
+ }
+
+ input[type=checkbox]::after {
+ position: absolute;
+ top: 0;
+ //color: rgb(130, 35, 35);
+ color: $main_color;
+ width: 14px;
+ height: 14px;
+ display: inline-block;
+ visibility: visible;
+ padding-left: 0px;
+ text-align: center;
+ content: ' ';
+ border-radius: 3px
+ }
+
+ input[type=checkbox]:checked::after {
+ //content: "鉁�";
+ content: "鈭�";
+ color: #fff;
+ font-size: 12px;
+ font-weight: bold;
+ background-color: $main_color;
+ }
+ }
+}
+
+.defaultroute_code ::v-deep .el-input__suffix-inner {
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ margin-top: -3px;
+}
+
+::v-deep .el-select__caret {
+ display: flex !important;
+ justify-content: center !important;
+ align-items: center !important;
+}
+
+</style>
diff --git a/src/views/materialManager/unitList2.vue b/src/views/materialManager/unitList2.vue
new file mode 100644
index 0000000..463fbe3
--- /dev/null
+++ b/src/views/materialManager/unitList2.vue
@@ -0,0 +1,693 @@
+<template>
+ <div>
+ <div class="body" :style="{height:mainHeight+'px'}">
+ <div style="display: flex">
+ <!-- background:rgba(248,248,250,1);-->
+ <div style="width: 300px;margin: 10px 10px 0 0;background: #fff">
+
+ <div style="margin: 20px 10px 0 10px;display: flex;justify-content: space-between;">
+ <div style="display: flex;">
+ <div
+ style="width: 5px;height: 100%;border-radius: 5px;"
+ :style="{background:$store.state.settings.theme}"
+ />
+ <div style="margin-left: 8px;">璁¢噺鍗曚綅</div>
+ </div>
+
+ <!-- <div style="margin-right:10px">-->
+ <!-- <i class="el-icon-plus" style="cursor: pointer;color: #999" />-->
+ <!-- </div>-->
+
+ </div>
+
+ <el-tree
+ ref="treeLeftRef"
+ key="treeLeftKey"
+ style="padding: 10px;overflow: auto;"
+ :style="{height:(tableHeight+150)+'px'}"
+ :data="treeLeft"
+ node-key="code"
+ highlight-current
+ :props="defaultPropsLeft"
+ :default-expand-all="true"
+ :expand-on-click-node="false"
+ @node-click="nodeClick"
+ />
+
+ </div>
+
+ <div style="width: calc(100% - 300px)">
+ <div class="bodyTopButtonGroup">
+ <el-button v-waves type="primary" icon="el-icon-circle-plus-outline" @click="add('add')">鏂板</el-button>
+ <el-button v-waves type="info" icon="el-icon-refresh" @click="getSaveSearchUnit">鍚屾璁¢噺鍗曚綅</el-button>
+ </div>
+
+ <div class="elTableDiv">
+ <el-table
+ ref="tableDataRef"
+ class="tableFixed"
+ :data="tableData"
+ :height="isExpandForm?tableHeight:(tableHeight+80)+'px'"
+ border
+ row-class-name="custom-row"
+ :style="{width: 100+'%',height:isExpandForm?tableHeight:(tableHeight+80)+'px',}"
+ highlight-current-row
+ :header-cell-style="this.$headerCellStyle"
+ :cell-style="this.$cellStyle"
+ @sort-change="sortChange"
+ >
+ <el-table-column
+ prop="rowNum"
+ width="50"
+ fixed
+ label="搴忓彿"
+ />
+ <el-table-column
+ prop="code"
+ label="璁¢噺鍗曚綅缂栫爜"
+ sortable="custom"
+ >
+ <template slot-scope="{row}">
+ {{ row.isGroup === '0' ? row.code :(!isMainUnitHidden?row.code:'') }}
+ </template>
+ </el-table-column>
+ <el-table-column
+ prop="name"
+ label="璁¢噺鍗曚綅鍚嶇О"
+ sortable="custom"
+ />
+ <el-table-column
+ v-if="!isMainUnitHidden"
+ prop="isMainUnit"
+ label="涓昏閲�"
+ sortable="custom"
+ >
+ <template slot-scope="{row}">
+ {{ row.isMainUnit === '1' ? '鏄�' : '鍚�' }}
+ </template>
+ </el-table-column>
+ <el-table-column
+ v-if="!isMainUnitHidden"
+ prop="changeRate"
+ label="鎹㈢畻鐜�"
+ sortable="custom"
+ />
+
+ <!-- <el-table-column-->
+ <!-- prop="data_sources"-->
+ <!-- label="鏁版嵁鏉ユ簮"-->
+ <!-- sortable="custom"-->
+ <!-- />-->
+ <el-table-column
+ prop="lm_user"
+ label="鍒涘缓浜哄憳"
+ sortable="custom"
+ />
+ <el-table-column
+ prop="lm_date"
+ label="鍒涘缓鏃堕棿"
+ sortable="custom"
+ />
+ <el-table-column
+ label="鎿嶄綔"
+ width="120"
+ fixed="right"
+ >
+ <template slot-scope="{row}">
+ <div class="operationClass">
+ <el-tooltip class="item" effect="dark" content="缂栬緫" placement="top">
+ <i
+ class="el-icon-edit-outline"
+ :style="{color:$store.state.settings.theme}"
+ @click="edit('edit',row)"
+ />
+ </el-tooltip>
+
+ <el-tooltip v-del-tab-index class="item" effect="dark" content="鍒犻櫎" placement="top">
+ <i
+ class="el-icon-delete"
+ :style="{color:$store.state.settings.theme}"
+ @click="del(row)"
+ />
+ </el-tooltip>
+ </div>
+ </template>
+ </el-table-column>
+ </el-table>
+ </div>
+ <!--鍒嗛〉-->
+ <pagination
+ :total="total"
+ :page.sync="form.page"
+ :limit.sync="form.rows"
+ align="right"
+ layout="total,prev, pager, next,sizes,jumper"
+ popper-class="select_bottom"
+ @pagination="getTUnitData"
+ />
+ </div>
+
+ </div>
+
+ </div>
+
+ <el-dialog
+ v-el-drag-dialog
+ :title="operation==='add'?'鏂板':'缂栬緫'"
+ :visible.sync="dialogVisible"
+ width="800px"
+ :close-on-click-modal="false"
+ top="15vh"
+ @closed="handleClose"
+ @close="handleClose"
+ >
+ <el-form
+ ref="dialogForm"
+ inline
+ :rules="dialogFormRules"
+ :model="dialogForm"
+ label-width="120px"
+ style="display: flex;justify-content: space-between;align-content: flex-end"
+ >
+
+ <el-form-item :label="dialogForm.tunittype==='S'? '璁¢噺鍗曚綅鍚嶇О':'璁¢噺鍗曚綅缁勫悕绉�'" prop="unitname">
+ <el-input v-model="dialogForm.unitname" style="width: 200px" />
+ </el-form-item>
+
+ <el-form-item v-if="dialogForm.tunittype==='M'">
+ <el-button v-waves type="primary" icon="el-icon-circle-plus-outline" @click="tableDataDialogAdd">鏂板琛�
+ </el-button>
+ </el-form-item>
+
+ </el-form>
+
+ <div v-if="dialogForm.tunittype==='M'">
+ <el-table
+ ref="tableDataDialogRef"
+ class="tableFixed"
+ :data="tableDataDialog"
+ row-class-name="custom-row"
+ height="400"
+ border
+ :style="{width: 100+'%',height:'400px',}"
+ highlight-current-row
+ :header-cell-style="this.$headerCellStyle"
+ :cell-style="this.$cellStyle"
+ >
+
+ <el-table-column
+ type="index"
+ width="50"
+ fixed
+ label="搴忓彿"
+ />
+ <el-table-column
+ prop="unitname"
+ label="璁¢噺鍗曚綅鍚嶇О"
+ >
+ <template slot-scope="{row}">
+ <el-input
+ v-if="row.isVisible===1"
+ v-model="row.unitname"
+ placeholder="璇疯緭鍏�"
+ />
+ <div v-else> {{ row.unitname }}</div>
+ </template>
+
+ </el-table-column>
+ <el-table-column
+
+ label="涓昏閲�"
+ prop="checkboxSelected"
+ >
+ <template slot-scope="{row}">
+
+ <el-select
+ v-if="row.isVisible===1"
+ v-model="row.checkboxSelected"
+ :popper-append-to-body="false"
+ :disabled="row.checkboxSelected==='1'"
+ placeholder="璇烽�夋嫨"
+ filterable
+ @change="val=>checkboxSelectedChange(val,row)"
+ >
+ <el-option
+ v-for="item in checkboxSelectedArr"
+ :key="item.code"
+ :label="item.name"
+ :value="item.code"
+ />
+ </el-select>
+ <div v-else> {{ row.checkboxSelected === '1' ? '鏄�' : '鍚�' }}</div>
+ </template>
+ </el-table-column>
+
+ <el-table-column
+ prop="changeRate"
+ label="鎹㈢畻鐜�"
+ >
+ <template slot-scope="{row}">
+ <el-input
+ v-if="row.isVisible===1"
+ v-model="row.changeRate"
+ :disabled="row.checkboxSelected==='1'"
+ placeholder="璇疯緭鍏�"
+ oninput="value=value.replace(/[^0-9.]/g,'')"
+ />
+ <div v-else> {{ row.changeRate }}</div>
+ </template>
+ </el-table-column>
+ <el-table-column
+ prop="rateDescription"
+ label="鎹㈢畻璇存槑"
+ />
+ <el-table-column
+ label="鎿嶄綔"
+ width="120"
+ fixed="right"
+ >
+ <template slot-scope="{row}">
+ <div class="operationClass">
+ <el-tooltip class="item" effect="dark" content="缂栬緫" placement="top">
+ <i
+ v-if="row.isVisible===0&&tableDataDialog.filter(i=>i.isVisible===1).length===0"
+ class="el-icon-edit-outline"
+ :style="{color:$store.state.settings.theme}"
+ @click="tableDataDialogEdit(row)"
+ />
+ </el-tooltip>
+ <el-tooltip v-del-tab-index class="item" effect="dark" content="鍒犻櫎" placement="top">
+ <i
+ v-if="row.isVisible===0&&tableDataDialog.filter(i=>i.isVisible===1).length===0"
+ class="el-icon-delete"
+ :style="{color:$store.state.settings.theme}"
+ @click="tableDataDialogDel(row)"
+ />
+ </el-tooltip>
+ <el-tooltip class="item" effect="dark" content="淇濆瓨" placement="top">
+ <i
+ v-if="row.isVisible===1"
+ class="el-icon-circle-check"
+ style="cursor:pointer;"
+ :style="{color:$store.state.settings.theme}"
+ @click="tableDataDialogSave(row)"
+ />
+ </el-tooltip>
+ </div>
+ </template>
+ </el-table-column>
+
+ </el-table>
+
+ </div>
+
+ <span slot="footer" class="dialog-footer">
+ <div class="footerButton">
+ <el-button v-waves @click="dialogVisibleCancel">鍙� 娑�</el-button>
+ <el-button
+ v-waves
+ type="primary"
+ :loading="$store.state.app.buttonIsDisabled"
+ :disabled="$store.state.app.buttonIsDisabled"
+ @click="dialogVisibleConfirm"
+ >纭� 瀹�</el-button>
+ </div>
+ </span>
+ </el-dialog>
+
+ </div>
+</template>
+
+<script>
+import Pagination from '@/components/Pagination'
+import elDragDialog from '@/directive/el-drag-dialog'
+import waves from '@/directive/waves'
+import { SaveSearchUnit } from '@/api/ErpSyncMes'
+import { AddUpdateTUnit, DeleteTUnit, TUnitData, TUnitGroup, TUnitGroupProject } from '@/api/ProductModel'
+
+export default {
+ name: 'UnitList2',
+ components: {
+ Pagination
+ },
+ directives: { elDragDialog, waves },
+ data() {
+ return {
+ // mouseHoverType: 'mouseout',
+ isExpandForm: false,
+ mainHeight: 0,
+ tableHeight: 0,
+ form: {
+ tunittype: '', // 鍗曡閲�(S) 澶氳閲�(M)
+ tunitgroupcode: '', // 璁¢噺鍗曚綅缁勭紪鐮�
+ prop: 'isGroup', // 鎺掑簭瀛楁
+ order: 'asc', // 鎺掑簭瀛楁
+ page: 1, // 绗嚑椤�
+ rows: 20 // 姣忛〉澶氬皯鏉�
+ },
+ total: 10,
+ tableData: [],
+ dialogVisible: false,
+ dialogForm: {
+ tunittype: '', // 鍗曡閲�(S) 澶氳閲�(M)
+ tunitgroupcode: '', // 璁¢噺鍗曚綅缁勭紪鐮�
+ unitcode: '',
+ unitname: '',
+ data_sources: 'MES'
+ },
+ operation: '',
+ dialogFormRules: {
+ unitname: [
+ { required: true, message: '璇疯緭鍏ュ悕绉�', trigger: ['blur', 'change'] }
+ ]
+ },
+
+ defaultPropsLeft: {
+ children: 'children',
+ label: 'name'
+ },
+ treeLeft: [],
+
+ tableDataDialog: [],
+
+ checkboxSelectedArr: [
+ { code: '0', name: '鍚�' },
+ { code: '1', name: '鏄�' }
+ ],
+
+ isMainUnitHidden: true
+
+ }
+ },
+ activated() {
+ window.addEventListener('resize', this.getHeight)
+ this.getHeight()
+ },
+ created() {
+
+ },
+ mounted() {
+ window.addEventListener('resize', this.getHeight)
+ this.getHeight()
+ this.handleGetApi('')
+ },
+ methods: {
+ async handleGetApi(code) {
+ await this.getTUnitGroup(code)
+ await this.getTUnitData()
+ },
+ async getSaveSearchUnit() {
+ const res = await SaveSearchUnit()
+ if (res.code === '200') {
+ await this.handleGetApi(this.$refs.treeLeftRef.getCurrentKey())
+ this.$notify.success('璁¢噺鍗曚綅鍚屾鎴愬姛锛�')
+ }
+ },
+ async getTUnitGroup(code) {
+ const { data: res } = await TUnitGroup()
+
+ this.treeLeft = [
+ {
+ code: '', name: '鍏ㄩ儴', children: [
+ { code: 'S', name: '鍗曡閲�' },
+ { code: 'M', name: '澶氳閲�', children: res }
+ ]
+ }
+ ]
+ this.$nextTick(() => {
+ this.$refs.treeLeftRef.setCurrentKey(code)
+ })
+ },
+ async getTUnitData() {
+ const res = await TUnitData(this.form)
+
+ this.tableData = res.data
+ this.total = res.count
+ },
+
+ async getTUnitGroupProject(unitcode) {
+ const data = {
+ unitcode, isgroup: '1'
+ }
+ const res = await TUnitGroupProject(data)
+ res.data.forEach((i, index) => {
+ i.unitname = i.name
+ i.unitcode = i.code
+ i.uuid = new Date().getTime() + index
+ i.isVisible = 0
+ // i.idunitgroup = unitcode
+ i.checkboxSelected = i.isMainUnit === '1' ? '1' : '0'
+ })
+ this.tableDataDialog = res.data
+ },
+
+ // 鎺掑簭鏀瑰彉鏃�
+ sortChange({ column, prop, order }) {
+ if (order === 'descending') {
+ order = 'desc'
+ } else if (order === 'ascending') {
+ order = 'asc'
+ } else {
+ order = 'desc'
+ }
+ this.form.order = order
+ this.form.prop = prop
+ this.getTUnitData()
+ },
+ async nodeClick(obj, Node, VueComponent) {
+ if (obj.code === 'S' || obj.code === 'M' || obj.code === '') {
+ this.form.tunittype = obj.code
+ this.form.tunitgroupcode = ''
+ await this.getTUnitData(obj.code)
+ this.isMainUnitHidden = true
+ this.$nextTick(() => {
+ this.$refs.tableDataRef.doLayout()
+ })
+ } else {
+ this.form.tunittype = 'M'
+ this.form.tunitgroupcode = obj.code
+ await this.getTUnitData(obj.code)
+ this.isMainUnitHidden = false
+ this.$nextTick(() => {
+ this.$refs.tableDataRef.doLayout()
+ })
+ }
+ },
+ add(operation) {
+ if (this.$refs.treeLeftRef.getCurrentKey() === 'S' || this.$refs.treeLeftRef.getCurrentKey() === 'M') {
+ this.dialogForm.tunittype = this.$refs.treeLeftRef.getCurrentKey()
+ } else {
+ return this.$message.error('璇峰厛閫夋嫨鏍戜笂鐨勫崟璁¢噺鎴栧璁¢噺锛�')
+ }
+ this.operation = operation
+ this.dialogVisible = true
+ this.dialogForm.OperType = 'Add'
+ },
+ // 淇敼鎸夐挳
+ async edit(operation, row) {
+ this.operation = operation
+ this.dialogVisible = true
+ this.dialogForm.OperType = 'Update'
+
+ this.$nextTick(() => {
+ if (this.$refs.treeLeftRef.getCurrentKey() === 'S' || this.$refs.treeLeftRef.getCurrentKey() === 'M' || this.$refs.treeLeftRef.getCurrentKey() === '') {
+ this.dialogForm.tunittype = row.isGroup === '0' ? 'S' : 'M'
+ this.dialogForm.tunitgroupcode = row.isGroup === '0' ? row.code : row.idunitgroup
+ this.dialogForm.unitcode = row.code
+ this.dialogForm.unitname = row.name
+ this.dialogForm.data_sources = row.data_sources
+ } else {
+ this.dialogForm.tunittype = 'M'
+ this.dialogForm.tunitgroupcode = row.idunitgroup
+ this.dialogForm.unitcode = row.idunitgroup
+ this.dialogForm.unitname = this.treeLeft[0].children[1].children.find(i => i.code === this.$refs.treeLeftRef.getCurrentKey()).name
+ this.dialogForm.data_sources = row.data_sources
+ }
+
+ if (this.dialogForm.tunittype === 'M') {
+ this.getTUnitGroupProject(row.idunitgroup)
+ }
+ })
+ },
+
+ // 鍒犻櫎鎸夐挳
+ async del(row) {
+ this.$confirm('鏄惁纭鍒犻櫎?', '鎻愮ず', {
+ confirmButtonText: '纭畾',
+ cancelButtonText: '鍙栨秷',
+ type: 'warning'
+ }).then(() => {
+ if (this.$refs.treeLeftRef.getCurrentKey() === 'S' || this.$refs.treeLeftRef.getCurrentKey() === 'M' || this.$refs.treeLeftRef.getCurrentKey() === '') {
+ // this.dialogForm.tunittype = this.$refs.treeLeftRef.getCurrentKey()
+ } else {
+ if (row.isMainUnit === '1' || this.tableData.length === 2) {
+ return this.$message.info('璁¢噺鍗曚綅缁勪笅锛屽繀椤绘湁涓�涓富璁¢噺鍜岃嚦灏戜竴涓緟璁¢噺锛�')
+ }
+ }
+
+ const data = {
+ data_sources: row.data_sources,
+ tunittype: row.isGroup === '0' ? 'S' : 'M',
+
+ tunitgroupcode: row.isGroup === '0' ? '' : row.idunitgroup,
+ tunitcode: row.isGroup === '0' ? row.code : (this.$refs.treeLeftRef.getCurrentKey() === 'M' ? '' : row.code)
+ }
+ DeleteTUnit(data).then(res => {
+ if (res.code === '200') {
+ this.$notify.success('鍒犻櫎鎴愬姛!')
+ if (this.form.page > 1 && this.tableData.length === 1) {
+ this.form.page--
+ }
+
+ this.handleGetApi(this.$refs.treeLeftRef.getCurrentKey())
+ }
+ })
+ }).catch(() => {
+ this.$notify.info('宸插彇娑堝垹闄�')
+ })
+ },
+ // 瀵硅瘽妗嗗叧闂簨浠�
+ handleClose() {
+ this.dialogForm.tunittype = ''
+ this.dialogForm.tunitgroupcode = ''
+ this.dialogForm.unitcode = ''
+ this.dialogForm.unitname = ''
+ this.dialogForm.data_sources = 'MES'
+ this.tableDataDialog = []
+ this.$refs.dialogForm.clearValidate()
+ },
+ // 瀵硅瘽妗嗗彇娑�
+ dialogVisibleCancel() {
+ this.dialogVisible = false
+ },
+ // 瀵硅瘽妗嗙‘璁�
+ dialogVisibleConfirm() {
+ this.$refs.dialogForm.validate(valid => {
+ if (valid) {
+ if (this.tableDataDialog.find(i => i.isVisible === 1)) {
+ return this.$message.info('璇峰厛淇濆瓨褰撳墠琛岋紒')
+ }
+
+ let data
+ if (this.dialogForm.tunittype === 'S') { // 鍗曡閲忔柊澧烇紝淇敼
+ data = [{
+ unitcode: this.dialogForm.unitcode,
+ unitname: this.dialogForm.unitname,
+ children: [
+ {
+ 'unitcode': this.dialogForm.unitcode,
+ 'unitname': this.dialogForm.unitname,
+ 'isMainUnit': '0',
+ 'changeRate': '1',
+ 'isSingleUnit': '1',
+ 'disabled': '0',
+ 'isGroup': '0',
+ 'rateDescription': '',
+ 'idunitgroup': ''
+ }
+ ]
+ }]
+ }
+ if (this.dialogForm.tunittype === 'M') { // 澶氳閲忔柊澧烇紝淇敼
+ if (this.tableDataDialog.length === 0) {
+ return this.$message.info('璁¢噺鍗曚綅缁勪腑鑷冲皯鍖呭惈涓�涓閲忓崟浣嶏紒')
+ }
+ if (this.tableDataDialog.length === 1) {
+ return this.$message.info('璁¢噺鍗曚綅缁勪笅锛屽繀椤绘湁涓�涓富璁¢噺鍜岃嚦灏戜竴涓緟璁¢噺锛�')
+ }
+
+ this.tableDataDialog.forEach((i, index) => {
+ i.unitcode = i.unitcode ? i.unitcode : 'U' + index.toString()
+ i.isMainUnit = i.checkboxSelected === '1' ? '1' : '0'
+ i.isSingleUnit = '0'
+ i.disabled = '0'
+ i.isGroup = '1'
+ i.idunitgroup = this.dialogForm.tunitgroupcode
+ })
+ data = [{
+ unitcode: this.dialogForm.unitcode,
+ unitname: this.dialogForm.unitname,
+ children: this.tableDataDialog
+ }]
+ }
+ console.log(data)
+ this.$store.state.app.buttonIsDisabled = true
+ AddUpdateTUnit(data, this.dialogForm.data_sources, this.dialogForm.tunittype, this.dialogForm.tunitgroupcode, this.dialogForm.OperType).then(res => {
+ if (res.code === '200') {
+ this.$notify.success(this.operation === 'add' ? '娣诲姞鎴愬姛锛�' : '淇敼鎴愬姛锛�')
+ this.dialogVisible = false
+ this.$store.state.app.buttonIsDisabled = false
+ this.handleGetApi(this.$refs.treeLeftRef.getCurrentKey())
+ } else {
+ this.$store.state.app.buttonIsDisabled = false
+ this.$notify.error(this.operation === 'add' ? '娣诲姞澶辫触锛�' : '淇敼澶辫触锛�')
+ }
+ })
+ }
+ })
+ },
+
+ tableDataDialogAdd() {
+ if (this.tableDataDialog.find(i => i.isVisible === 1)) {
+ return this.$message.info('璇峰厛淇濆瓨涓婁竴鏉℃暟鎹紒')
+ }
+
+ this.tableDataDialog.push({
+ unitname: '',
+ changeRate: 1,
+ uuid: new Date().getTime(),
+ checkboxSelected: this.tableDataDialog.length === 0 ? '1' : '0',
+ isVisible: 1,
+ data_sources: 'MES'
+ })
+ console.log(this.tableDataDialog)
+ },
+ tableDataDialogEdit(row) {
+ row.isVisible = 1
+ },
+ tableDataDialogDel(row) {
+ if (row.checkboxSelected === '1') {
+ return this.$message.info('涓昏閲忓崟浣嶄笉鑳藉垹闄わ紒')
+ }
+ this.tableDataDialog = this.tableDataDialog.filter(i => i.uuid !== row.uuid)
+ },
+ tableDataDialogSave(row) {
+ if (!row.unitname) {
+ return this.$message.info('璁¢噺鍗曚綅鍚嶇О涓嶈兘涓虹┖锛�')
+ }
+ if (!row.changeRate) {
+ return this.$message.info('鎹㈢畻鐜囦笉鑳戒负绌猴紒')
+ }
+ if (this.tableDataDialog.filter(i => i.unitname === row.unitname).length > 1) {
+ return this.$message.info('澶氳閲忕粍鍐呰閲忓崟浣嶅悕绉颁笉鑳介噸澶嶏紒')
+ }
+ // console.log(row, 234)
+ row.isVisible = 0
+ if (this.tableDataDialog.length > 1) {
+ const unitname = this.tableDataDialog.find(i => i.checkboxSelected === '1').unitname
+ this.tableDataDialog.forEach(i => {
+ if (i.checkboxSelected === '0') {
+ i.rateDescription = '1' + i.unitname + '=' + i.changeRate + unitname
+ } else {
+ i.rateDescription = ''
+ }
+ })
+ }
+ },
+ checkboxSelectedChange(val, row) {
+ row.changeRate = 1
+ this.tableDataDialog.forEach(item => {
+ item.checkboxSelected = item.uuid === row.uuid ? '1' : '0'
+ })
+ },
+ // 鑾峰彇椤甸潰楂樺害
+ getHeight() {
+ this.$nextTick(() => {
+ this.mainHeight = window.innerHeight - 85
+ this.tableHeight = this.mainHeight - 220
+ this.$refs.tableDataRef.doLayout()
+ })
+ }
+ }
+}
+</script>
diff --git a/src/views/produce/productWarehouse2.vue b/src/views/produce/productWarehouse2.vue
new file mode 100644
index 0000000..f8e77aa
--- /dev/null
+++ b/src/views/produce/productWarehouse2.vue
@@ -0,0 +1,944 @@
+<template>
+ <div>
+ <div class="body" :style="{height:mainHeight+'px'}">
+ <!-- <div class="bodyTopButtonGroup" style="justify-content: space-between">-->
+ <!-- <el-button type="primary" icon="el-icon-circle-plus-outline" @click="add('add')">鏂板</el-button>-->
+ <!-- <el-button icon="el-icon-download" @click="upload">瀵煎叆</el-button>-->
+ <!-- </div>-->
+
+ <div
+ class="bodyTopFormGroup"
+ style="margin-top: 10px"
+ :style="{height:(mainHeight-20)+'px'}"
+ >
+ <div style="display: flex;align-items: center">
+ <i
+ class="el-icon-s-operation"
+ :style="{color:$store.state.settings.theme,fontSize:'14px'}"
+ />
+ <div style="font-size: 14px;margin-left: 5px;color: #a7a7a7">
+ 鏌ヨ椤�
+ </div>
+ <!-- <div v-if="!isPermission" style="font-size: 14px;margin-left: 10px;color: red">-->
+ <!-- 褰撳墠鐢ㄦ埛鍦‥RP绯荤粺涓笉瀛樺湪鎴栨湭鎺堟潈锛屾棤娉曞叆搴撴彁浜�-->
+ <!-- </div>-->
+ </div>
+ <el-form
+ ref="form"
+ :model="form"
+ label-width="100px"
+ inline
+ style="display: flex;"
+ >
+ <div class="elForm" style="display: flex;flex-direction: column;justify-content: flex-start">
+ <div style="display: flex">
+ <el-form-item label="鐢熶骇杞﹂棿" required style=" display: flex;">
+ <el-select
+ v-model="form.wkshopcode"
+ :popper-append-to-body="false"
+ filterable
+ style="width: 200px"
+ placeholder="璇烽�夋嫨"
+ @change="getProductInHouseOrderSearch"
+ >
+ <el-option
+ v-for="item in WorkShopArr"
+ :key="item.torg_code"
+ :label="item.torg_name"
+ :value="item.torg_code"
+ />
+ </el-select>
+ </el-form-item>
+ <el-form-item
+ label="鐢熶骇璁㈠崟"
+ style="display: flex;"
+ >
+ <el-input
+ v-model="form.erpordercode"
+ placeholder="璇疯緭鍏�"
+ style="width: 200px"
+ />
+ </el-form-item>
+ <el-form-item
+ label="鐢熶骇宸ュ崟"
+ style="display: flex;"
+ >
+ <el-input
+ v-model="form.mesordercode"
+ placeholder="璇疯緭鍏�"
+ style="width: 200px"
+ />
+ </el-form-item>
+ <el-form-item
+ label="閿�鍞鍗�"
+ style="display: flex;"
+ >
+ <el-input
+ v-model="form.saleOrderCode"
+ readonly
+ style="width: 200px"
+ />
+ </el-form-item>
+ </div>
+
+ <div style="display: flex">
+ <el-form-item label="浜у搧缂栫爜" style=" display: flex;">
+ <el-input v-model="form.partcode" placeholder="璇疯緭鍏�" style="width: 200px" />
+ </el-form-item>
+ <el-form-item label="浜у搧鍚嶇О" style=" display: flex;">
+ <el-input v-model="form.partname" style="width: 200px" placeholder="璇疯緭鍏�" />
+ </el-form-item>
+ <el-form-item label="浜у搧瑙勬牸" style=" display: flex;">
+ <el-input v-model="form.partspec" style="width: 200px" placeholder="璇疯緭鍏�" />
+ </el-form-item>
+ </div>
+
+ </div>
+ <div
+ class="bodySearchReset"
+ >
+ <el-button type="primary" icon="el-icon-search" @click="getProductInHouseOrderSearch">鏌ヨ</el-button>
+ <el-button type="info" icon="el-icon-refresh" @click="reset">閲嶇疆</el-button>
+ </div>
+ </el-form>
+
+ <div style="display: flex;align-items: center">
+ <i
+ class="el-icon-s-operation"
+ :style="{color:$store.state.settings.theme,fontSize:'14px'}"
+ />
+ <div style="font-size: 14px;margin-left: 5px;color: #a7a7a7">
+ 閫夋嫨椤�
+ </div>
+ </div>
+ <el-form
+ ref="form"
+ :model="form"
+ label-width="100px"
+ inline
+ style="display: flex;"
+ >
+ <div class="elForm" style="justify-content: flex-start">
+ <el-form-item label="鍗曟嵁鏃ユ湡" style=" display: flex;">
+ <el-date-picker
+ v-model="form.hbdate"
+ style="width: 200px"
+ readonly
+ type="date"
+ placeholder="閫夋嫨鏃ユ湡"
+ />
+ </el-form-item>
+ <el-form-item label="鍗曟嵁缂栧彿" style=" display: flex;">
+ <el-input
+ v-model="form.hbillno"
+
+ placeholder="璇疯緭鍏�"
+ style="width: 200px"
+ />
+ <!-- readonly-->
+ </el-form-item>
+
+ <el-form-item label="鍏ュ簱浠撳簱" required style=" display: flex;">
+ <el-select
+ v-model="form.stockcode"
+ :popper-append-to-body="false"
+ filterable
+ style="width: 200px"
+ placeholder="璇烽�夋嫨"
+ @change="stockCodeChange"
+ >
+ <el-option
+ v-for="item in stockcodeArr"
+ :key="item.code"
+ :label="item.name"
+ :value="item.code"
+ />
+ </el-select>
+ </el-form-item>
+
+ <!-- <el-form-item label="鍏ュ簱閮ㄩ棬" required style=" display: flex;">-->
+ <!-- <el-select-->
+ <!-- v-model="form.deptno"-->
+ <!-- :popper-append-to-body="false"-->
+ <!-- filterable-->
+ <!-- style="width: 200px"-->
+ <!-- placeholder="璇烽�夋嫨"-->
+ <!-- >-->
+ <!-- <el-option-->
+ <!-- v-for="item in departmentArr"-->
+ <!-- :key="item.code"-->
+ <!-- :label="item.name"-->
+ <!-- :value="item.code"-->
+ <!-- />-->
+ <!-- </el-select>-->
+ <!-- </el-form-item>-->
+
+ </div>
+ <div
+ class="bodySearchReset"
+ :style="{marginLeft:$store.state.app.sidebar.opened? $store.state.settings.menuIsHorizontal?'15%':'3%':'10%'}"
+ >
+ <el-button
+
+ type="primary"
+ icon="el-icon-s-promotion"
+ :disabled="$store.state.app.buttonIsDisabled"
+ @click="submit"
+ >鍏ュ簱鎻愪氦
+ </el-button>
+ <!-- <el-button type="info" icon="el-icon-refresh" @click="reset">閲嶇疆</el-button>-->
+ </div>
+ </el-form>
+ <div style="display: flex;align-items: center">
+ <i
+ class="el-icon-s-operation"
+ :style="{color:$store.state.settings.theme,fontSize:'14px'}"
+ />
+ <div style="font-size: 14px;margin-left: 5px;color: #a7a7a7">
+ 淇℃伅鏍�
+ </div>
+ </div>
+ <div style="padding:0 10px;position: relative">
+ <!-- <el-button-->
+ <!-- -->
+ <!-- type="primary"-->
+ <!-- style="position: absolute;right: 10px;top: 10px;z-index: 10"-->
+ <!-- icon="el-icon-s-promotion"-->
+ <!-- @click=""-->
+ <!-- >鍏ュ簱鎻愪氦-->
+ <!-- </el-button>-->
+ <el-tabs style="margin-top: 10px;" @tab-click="tabClick">
+ <el-tab-pane label="鏄庣粏">
+ <div class="elTableDiv" style="margin: 0 auto 10px;">
+ <el-table
+ ref="tableDataRef"
+ class="tableFixed"
+ :data="tableDataDetail"
+ :height="(tableHeight-25)+'px'"
+ border
+ :row-class-name="tableRowClassName"
+ :style="{width: 100+'%',height:(tableHeight-25)+'px',}"
+ highlight-current-row
+ :header-cell-style="this.$headerCellStyle"
+ :cell-style="this.$cellStyle"
+ @selection-change="handleSelectionChange"
+ >
+ <!-- @cell-dblclick="cellDblclick"-->
+ <!-- @cell-click="cellClick"-->
+ <el-table-column
+ type="selection"
+ width="50"
+ fixed
+ />
+ <el-table-column
+ type="index"
+ width="50"
+ fixed
+ label="搴忓彿"
+ />
+
+ <!-- <el-table-column-->
+ <!-- prop="stockcode"-->
+ <!-- label="浠撳簱"-->
+ <!-- width="160"-->
+ <!-- show-tooltip-when-overflow-->
+ <!-- >-->
+ <!-- <template slot-scope="{row}">-->
+ <!-- <div>{{ row.stockcode ? stockcodeArr.find(i => i.code === row.stockcode).name : '/' }}</div>-->
+ <!-- <!– <div–>-->
+ <!-- <!– v-if="!(row.index === tabClickIndex && tabClickLabel === '浠撳簱')"–>-->
+ <!-- <!– >–>-->
+ <!-- <!– {{ row.stockcode ? stockcodeArr.find(i => i.code === row.stockcode).name : '/' }}–>-->
+ <!-- <!– </div>–>-->
+ <!-- <!– <el-select–>-->
+ <!-- <!– v-if="row.index === tabClickIndex && tabClickLabel === '浠撳簱'"–>-->
+ <!-- <!– v-model="row.stockcode"–>-->
+ <!-- <!– placeholder="璇烽�夋嫨"–>-->
+ <!-- <!– >–>-->
+ <!-- <!– <el-option–>-->
+ <!-- <!– v-for="item in stockcodeArr"–>-->
+ <!-- <!– :key="item.code"–>-->
+ <!-- <!– :label="item.name"–>-->
+ <!-- <!– :value="item.code"–>-->
+ <!-- <!– />–>-->
+ <!-- <!– </el-select>–>-->
+ <!-- </template>-->
+ <!-- </el-table-column>-->
+ <!-- <el-table-column-->
+ <!-- prop="inbarcode"-->
+ <!-- label="鍏ュ簱鏉$爜"-->
+ <!-- width="160"-->
+ <!-- show-tooltip-when-overflow-->
+ <!-- />-->
+ <el-table-column
+ prop="stockcode"
+ label="鍏ュ簱浠撳簱"
+ width="160"
+ show-tooltip-when-overflow
+ >
+ <template slot-scope="{row}">
+ <!-- <div v-if="row.stockcode">{{ row.stockcode }}</div>-->
+ <!-- <div v-else>/</div>-->
+ <el-select
+ v-model="row.stockcode"
+ placeholder="璇烽�夋嫨"
+ @change="val=>stockCodeRowChange(val,row)"
+ >
+ <el-option
+ v-for="item in stockcodeArr"
+ :key="item.code"
+ :label="item.name"
+ :value="item.code"
+ />
+ </el-select>
+
+ </template>
+ </el-table-column>
+
+ <el-table-column
+ prop="saleOrderCode"
+ label="閿�鍞崟鍙�"
+ width="160"
+ show-tooltip-when-overflow
+ >
+ <template slot-scope="{row}">
+ <div v-if="row.saleOrderCode">{{ row.saleOrderCode }}</div>
+ <div v-else>/</div>
+ </template>
+ </el-table-column>
+
+ <el-table-column
+ prop="m_po"
+ label="璁㈠崟缂栧彿"
+ width="160"
+ show-tooltip-when-overflow
+ >
+ <template slot-scope="{row}">
+ <div v-if="row.m_po">{{ row.m_po }}</div>
+ <div v-else>/</div>
+ </template>
+ </el-table-column>
+ <el-table-column
+ prop="wo_code"
+ label="宸ュ崟缂栧彿"
+ width="160"
+ show-tooltip-when-overflow
+ />
+ <el-table-column
+ prop="partcode"
+ label="浜у搧缂栫爜"
+ width="160"
+ show-tooltip-when-overflow
+ />
+ <el-table-column
+ prop="partname"
+ label="浜у搧鍚嶇О"
+ width="160"
+ show-tooltip-when-overflow
+ />
+ <el-table-column
+ prop="partspec"
+ label="浜у搧瑙勬牸"
+ width="160"
+ show-tooltip-when-overflow
+ >
+ <template slot-scope="{row}">
+ <div v-if="row.partspec">{{ row.partspec }}</div>
+ <div v-else>/</div>
+ </template>
+ </el-table-column>
+
+ <el-table-column
+ prop="initname"
+ label="鍗曚綅鍚嶇О"
+ width="160"
+ show-tooltip-when-overflow
+ >
+ <template slot-scope="{row}">
+ <div v-if="row.initname">{{ row.initname }}</div>
+ <div v-else>/</div>
+ </template>
+ </el-table-column>
+
+ <el-table-column
+ prop="wkshp_name"
+ label="杞﹂棿鍚嶇О"
+ width="160"
+ show-tooltip-when-overflow
+ >
+ <template slot-scope="{row}">
+ <div v-if="row.wkshp_name">{{ row.wkshp_name }}</div>
+ <div v-else>/</div>
+ </template>
+ </el-table-column>
+
+ <el-table-column
+ prop="stepname"
+ label="宸ュ簭鍚嶇О"
+ width="160"
+ show-tooltip-when-overflow
+ >
+ <template slot-scope="{row}">
+ <div v-if="row.stepname">{{ row.stepname }}</div>
+ <div v-else>/</div>
+ </template>
+ </el-table-column>
+
+ <el-table-column
+ prop="qty"
+ label="璁㈠崟鏁伴噺"
+ min-width="95"
+ fixed="right"
+ show-tooltip-when-overflow
+ >
+ <template slot-scope="{row}">
+ <div v-if="row.qty">{{ row.qty }}</div>
+ <div v-else>/</div>
+ </template>
+ </el-table-column>
+ <el-table-column
+ prop="plan_qty"
+ label="宸ュ崟鏁伴噺"
+ min-width="95"
+ fixed="right"
+ show-tooltip-when-overflow
+ />
+ <el-table-column
+ prop="good_qty"
+ label="瀹屽伐鏁伴噺"
+ min-width="95"
+ fixed="right"
+ show-tooltip-when-overflow
+ />
+ <el-table-column
+ prop="inhouseqty"
+ label="宸插叆搴撴暟閲�"
+ min-width="95"
+ fixed="right"
+ show-tooltip-when-overflow
+ />
+ <el-table-column
+ prop="stinhouseqty"
+ label="寰呭叆搴撴暟閲�"
+ min-width="130"
+ fixed="right"
+ >
+ <!-- <template slot-scope="{row}">-->
+ <!-- <el-input-number v-model="row.stinhouseqty" :min="0" :max="row.good_qty" size="small" />-->
+ <!-- </template>-->
+ </el-table-column>
+ </el-table>
+
+ </div>
+ </el-tab-pane>
+ <!-- <el-tab-pane label="姹囨��">-->
+ <!-- <div class="elTableDiv" style="margin: 0 auto 10px;">-->
+ <!-- <el-table-->
+ <!-- ref="tableDataRef"-->
+ <!-- class="tableFixed"-->
+ <!-- :data="tableDataSummary"-->
+ <!-- :height="(tableHeight-25)+'px'"-->
+ <!-- border-->
+ <!-- :row-class-name="tableRowClassName2"-->
+ <!-- :style="{width: 100+'%',height:(tableHeight-25)+'px',}"-->
+ <!-- highlight-current-row-->
+ <!-- :header-cell-style="this.$headerCellStyle"-->
+ <!-- :cell-style="this.$cellStyle"-->
+ <!-- >-->
+ <!-- <el-table-column-->
+ <!-- type="index"-->
+ <!-- width="50"-->
+ <!-- fixed-->
+ <!-- label="搴忓彿"-->
+ <!-- />-->
+ <!-- <!– <el-table-column–>-->
+ <!-- <!– prop="stockcode"–>-->
+ <!-- <!– label="浠撳簱"–>-->
+ <!-- <!– width="110"–>-->
+ <!-- <!– >–>-->
+ <!-- <!– <template slot-scope="{row}">–>-->
+ <!-- <!– <div>{{ stockcodeArr.find(i => i.code === row.stockcode).name }}</div>–>-->
+ <!-- <!– </template>–>-->
+ <!-- <!– </el-table-column>–>-->
+ <!-- <!– <template slot-scope="{row}">–>-->
+ <!-- <!– <div v-if="row.stockname">{{ row.stockname }}</div>–>-->
+ <!-- <!– <div v-else>/</div>–>-->
+ <!-- <!– </template>–>-->
+
+ <!-- <!– </el-table-column>–>-->
+ <!-- <!– <el-table-column–>-->
+ <!-- <!– prop="inbarcode"–>-->
+ <!-- <!– label="鍏ュ簱鏉$爜"–>-->
+ <!-- <!– width="160"–>-->
+ <!-- <!– show-tooltip-when-overflow–>-->
+ <!-- <!– />–>-->
+ <!-- <!– <el-table-column–>-->
+ <!-- <!– prop="m_po"–>-->
+ <!-- <!– label="璁㈠崟缂栧彿"–>-->
+ <!-- <!– width="160"–>-->
+ <!-- <!– show-tooltip-when-overflow–>-->
+ <!-- <!– >–>-->
+ <!-- <!– <template slot-scope="{row}">–>-->
+ <!-- <!– <div v-if="row.m_po">{{ row.m_po }}</div>–>-->
+ <!-- <!– <div v-else>/</div>–>-->
+ <!-- <!– </template>–>-->
+ <!-- <!– </el-table-column>–>-->
+ <!-- <!– <el-table-column–>-->
+ <!-- <!– prop="wo_code"–>-->
+ <!-- <!– label="宸ュ崟缂栧彿"–>-->
+ <!-- <!– width="160"–>-->
+ <!-- <!– show-tooltip-when-overflow–>-->
+ <!-- <!– />–>-->
+ <!-- <el-table-column-->
+ <!-- prop="partcode"-->
+ <!-- label="浜у搧缂栫爜"-->
+ <!-- min-width="160"-->
+ <!-- show-tooltip-when-overflow-->
+ <!-- />-->
+ <!-- <el-table-column-->
+ <!-- prop="partname"-->
+ <!-- label="浜у搧鍚嶇О"-->
+ <!-- min-width="160"-->
+ <!-- show-tooltip-when-overflow-->
+ <!-- />-->
+ <!-- <el-table-column-->
+ <!-- prop="partspec"-->
+ <!-- label="浜у搧瑙勬牸"-->
+ <!-- min-width="160"-->
+ <!-- show-tooltip-when-overflow-->
+ <!-- >-->
+ <!-- <template slot-scope="{row}">-->
+ <!-- <div v-if="row.stockname">{{ row.stockname }}</div>-->
+ <!-- <div v-else>/</div>-->
+ <!-- </template>-->
+ <!-- </el-table-column>-->
+
+ <!-- <el-table-column-->
+ <!-- prop="qty"-->
+ <!-- label="璁㈠崟鏁伴噺"-->
+ <!-- min-width="95"-->
+
+ <!-- show-tooltip-when-overflow-->
+ <!-- >-->
+ <!-- <template slot-scope="{row}">-->
+ <!-- <div v-if="row.qty">{{ row.qty }}</div>-->
+ <!-- <div v-else>/</div>-->
+ <!-- </template>-->
+ <!-- </el-table-column>-->
+ <!-- <!– <el-table-column–>-->
+ <!-- <!– prop="plan_qty"–>-->
+ <!-- <!– label="宸ュ崟鏁伴噺"–>-->
+ <!-- <!– min-width="95"–>-->
+ <!-- <!– fixed="right"–>-->
+ <!-- <!– show-tooltip-when-overflow–>-->
+ <!-- <!– />–>-->
+ <!-- <el-table-column-->
+ <!-- prop="good_qty"-->
+ <!-- label="瀹屽伐鏁伴噺"-->
+ <!-- min-width="95"-->
+
+ <!-- show-tooltip-when-overflow-->
+ <!-- />-->
+ <!-- <el-table-column-->
+ <!-- prop="inhouseqty"-->
+ <!-- label="宸插叆搴撴暟閲�"-->
+ <!-- min-width="95"-->
+
+ <!-- show-tooltip-when-overflow-->
+ <!-- />-->
+ <!-- <el-table-column-->
+ <!-- prop="stinhouseqty"-->
+ <!-- label="鍙叆搴撴暟閲�"-->
+ <!-- min-width="95"-->
+
+ <!-- show-tooltip-when-overflow-->
+ <!-- />-->
+ <!-- </el-table>-->
+ <!-- </div>-->
+ <!-- </el-tab-pane>-->
+ </el-tabs>
+ </div>
+
+ </div>
+
+ </div>
+
+ </div>
+</template>
+
+<script>
+
+import { PrentOrganizationNoCompany, WareHouse } from '@/api/GeneralBasicData'
+import {
+ DeptSelectData,
+ ProductInHouseOrderCodeSearch,
+ ProductInHouseOrderSearch,
+ ProductInHouseOrderSeave, TProductInHouseOrderSpSeave
+} from '@/api/WorkOrder'
+import { TSecLocaTree } from '@/api/basicSettings'
+import { handleDatetime, handleDatetime2 } from '@/utils/global'
+
+export default {
+ name: 'ProductWarehouse2',
+ components: {},
+ data() {
+ return {
+ mainHeight: 0,
+ tableHeight: 0,
+ form: {
+ hbillno: '', // 鍏ュ簱鍗曞彿
+ incbit: '', // 娴佹按鍙�
+ hbdate: new Date(), // 鍏ュ簱鍗曟棩鏈�
+
+ saleordercode: '', // 閿�鍞崟鍙�
+ wkshopcode: '', // 鐢熶骇杞﹂棿
+ erpordercode: '', // 璁㈠崟缂栧彿
+ mesordercode: '', // 宸ュ崟缂栧彿
+ partcode: '', // 浜у搧缂栫爜
+ partname: '', // 浜у搧鍚嶇О
+ partspec: '', // 瑙勬牸鍨嬪彿
+
+ deptno: '', // 鍏ュ簱閮ㄩ棬
+ saleOrderCode: '', // 閿�鍞鍗�
+ stockcode: '' // 鍏ュ簱浠撳簱
+
+ },
+
+ tableDataDetail: [], // 鏄庣粏琛�
+ multipleSelection: [],
+ stockcodeArr: [], // 鍏ュ簱浠撳簱鏁扮粍
+ WorkShopArr: [], // 鐢熶骇杞﹂棿鏁扮粍
+ departmentArr: [], // 鍏ュ簱閮ㄩ棬
+
+ tabClickIndex: null, // 鐐瑰嚮鐨勫崟鍏冩牸
+ tabClickLabel: '', // 褰撳墠鐐瑰嚮鐨勫垪鍚�
+
+ tableDataSummary: [] // 姹囨�昏〃
+
+ }
+ },
+ watch: {},
+ created() {
+ },
+ mounted() {
+ window.addEventListener('resize', this.getHeight)
+ this.getHeight()
+
+ this.getPrentOrganizationNoCompany()
+ this.getTSecLocaTree()
+ this.getProductInHouseOrderCodeSearch()
+ // this.getDeptSelectData()
+
+ // this.getProductInHouseOrderSearch()
+ },
+ methods: {
+ // 鑾峰彇鍏ュ簱閮ㄩ棬
+ async getDeptSelectData() {
+ const { data: res } = await DeptSelectData()
+ this.departmentArr = res
+ },
+ // 鑾峰彇鍗曟嵁缂栧彿(鍏ュ簱鍗曞彿)銆佹祦姘村彿
+ async getProductInHouseOrderCodeSearch() {
+ const { data: res } = await ProductInHouseOrderCodeSearch({ rightcode: '0604' })
+ this.form.hbillno = res[0]
+ this.form.incbit = res[1]
+ },
+ // 鑾峰彇浠撳簱淇℃伅
+ async getTSecLocaTree() {
+ const { data: res } = await WareHouse()
+ this.stockcodeArr = res
+ // const { data: res } = await TSecLocaTree()
+ // this.stockcodeArr = res.filter(i => i.depth === 0)// 灞傜骇涓�0鐨� 鏄粨搴�
+ },
+ // 鑾峰彇杞﹂棿淇℃伅
+ async getPrentOrganizationNoCompany() {
+ const { data: res } = await PrentOrganizationNoCompany()
+ this.WorkShopArr = res
+ },
+ // 鑾峰彇澶у垪琛ㄦ煡璇�
+ async getProductInHouseOrderSearch() {
+ const data = {
+ saleordercode: this.form.saleordercode, // 閿�鍞崟鍙�
+ wkshopcode: this.form.wkshopcode, // 鐢熶骇杞﹂棿
+ erpordercode: this.form.erpordercode, // 璁㈠崟缂栧彿
+ mesordercode: this.form.mesordercode, // 宸ュ崟缂栧彿
+ partcode: this.form.partcode, // 浜у搧缂栫爜
+ partname: this.form.partname, // 浜у搧鍚嶇О
+ partspec: this.form.partspec // 瑙勬牸鍨嬪彿
+
+ }
+ const { data: res } = await ProductInHouseOrderSearch(data)
+ this.tableDataDetail = res
+ },
+
+ // 鍏ュ簱浠撳簱鍊兼敼鍙樻椂
+ stockCodeChange() {
+
+ },
+
+ stockCodeRowChange(val, row) {
+ row.stockid = this.stockcodeArr.find(i => i.code === val).noid
+ },
+
+ // 椤电鍒囨崲
+ tabClick() {
+
+ },
+ // 澶嶉�夋鍒囨崲
+ handleSelectionChange(val) {
+ this.multipleSelection = val
+ },
+ // 閫掍氦
+ async submit() {
+ // usercode
+ // console.log(localStorage.getItem('username'))
+
+ if (this.multipleSelection.length === 0) {
+ return this.$message.info('璇峰厛鍕鹃�夊崟鎹紒')
+ }
+ if (this.form.stockcode === '') {
+ return this.$message.info('鍏ュ簱浠撳簱涓嶈兘涓虹┖锛�')
+ }
+ // if (this.form.deptno === '') {
+ // return this.$message.info('鍏ュ簱閮ㄩ棬涓嶈兘涓虹┖锛�')
+ // }
+
+ const TableDetailData = []
+ this.multipleSelection.forEach((i, index) => {
+ TableDetailData.push({
+ 'hbillno': this.form.hbillno, // 鍏ュ簱鍗曞彿
+ 'wocode': i.wo_code, // 宸ュ崟鍙�
+ 'rownumber': (index + 1).toString(), // 琛屽彿
+ 'sourceVoucherId': i.mpoid.toString(), // 鏉ユ簮鍗曟嵁id
+ 'sourceVoucherCode': i.m_po, // 鏉ユ簮鍗曟嵁缂栧彿
+ 'SourceVoucherDetailId': i.sbid.toString(), // 鏉ユ簮鍗曟嵁鏄庣粏id
+ 'inbarcode': i.inbarcode, // 鍏ュ簱鏉$爜
+ 'idinventory': i.materiel_id.toString(), // 瀛樿揣id
+ 'inventorycode': i.partcode, // 瀛樿揣缂栫爜
+ 'idunit': i.unitid.toString(), // 璁¢噺鍗曚綅id
+ 'unitcode': i.unitcode, // 璁¢噺鍗曚綅缂栫爜
+ idwarehouse: i.stockid.toString(), // 浠撳簱id
+ warehousecode: i.stockcode, // 浠撳簱缂栫爜
+ 'saleOrderId': i.saleOrderid.toString(), // 閿�鍞崟id
+ 'saleOrderCode': i.saleOrderCode, // 閿�鍞崟鍙�
+ 'saleOrderDetailId': i.saleOrderDetailId.toString(), // 閿�鍞崟鏄庣粏id
+ 'qty': i.good_qty.toString(), // 鍏ュ簱鏁伴噺
+ 'stepcode': i.step_code, // 宸ュ簭缂栫爜
+ 'style': i.style, // 鎶ュ伐绫诲瀷锛欱(鑷埗) S(澶栧崗)
+ 'status': '0' // 鍏ュ簱鍗曠姸鎬侊細0(鏈鏍�) 1(宸插鏍�)
+ })
+ })
+
+ const data = {
+ 'rightcode': '0604', // 鍔熻兘缂栧彿
+ 'incbit': this.form.incbit, // 娴佹按鍙�
+ 'TableData': [
+ [
+ {
+ 'hbillno': this.form.hbillno, // 鍏ュ簱鍗曞彿
+ 'madedate': handleDatetime(this.form.hbdate) + ' 00:00:00', // 鍒跺崟鏃ユ湡锛堝勾鏈堟棩 00:00:00锛�
+ 'hbdate': this.multipleSelection[this.multipleSelection.length - 1].voucherdate,
+
+ sourceVoucherId: [...new Set(this.multipleSelection.map(i => i.mpoid))].length > 1 ? '' : this.multipleSelection[0].mpoid,
+ sourceVoucherCode: [...new Set(this.multipleSelection.map(i => i.m_po))].length > 1 ? '' : this.multipleSelection[0].m_po,
+ saleOrderCode: [...new Set(this.multipleSelection.map(i => i.saleOrderCode))].length > 1 ? '' : this.multipleSelection[0].saleOrderCode,
+
+ 'iddepartment': this.multipleSelection[0].dept_id, // 閮ㄩ棬id
+ 'departmentcode': this.multipleSelection[0].dept_code, // 閮ㄩ棬缂栫爜
+
+ 'idwarehouse': this.stockcodeArr.find(i => i.code === this.form.stockcode).noid, // 浠撳簱id
+ 'warehousecode': this.form.stockcode, // 浠撳簱缂栫爜
+ 'status': '0', // 鍏ュ簱鍗曠姸鎬侊細0(鏈鏍�) 1(宸插鏍�)
+ PurchaseOrderCode: '', // 閲囪喘璁㈠崟鍙�
+ 'remark': '', // 澶囨敞
+ 'create_user': localStorage.getItem('username'), // 鍒涘缓浜哄憳
+ 'create_date': handleDatetime2(new Date()),
+ 'check_user': '', // 瀹℃牳浜哄憳
+ 'check_date': ''// 瀹℃牳鏃堕棿
+ }
+ ],
+ TableDetailData// 琛ㄤ綋
+ ]
+ }
+
+ // console.log(JSON.stringify(data))
+ const res = await TProductInHouseOrderSpSeave(data)
+ if (res.code === '200') {
+ this.$message.success('鍏ュ簱鎴愬姛锛�')
+ this.multipleSelection = []
+ this.form.deptno = ''
+ this.form.stockcode = ''
+ await this.getProductInHouseOrderSearch()
+ await this.getProductInHouseOrderCodeSearch()
+ }
+ },
+ // 閲嶇疆
+ reset() {
+ this.form.saleordercode = '' // 閿�鍞崟鍙�
+ this.form.wkshopcode = '' // 鐢熶骇杞﹂棿
+ this.form.erpordercode = ''// 璁㈠崟缂栧彿
+ this.form.mesordercode = ''// 宸ュ崟缂栧彿
+ this.form.partcode = ''// 浜у搧缂栫爜
+ this.form.partname = '' // 浜у搧鍚嶇О
+ this.form.partspec = '' // 瑙勬牸鍨嬪彿
+ },
+ // 鑾峰彇椤甸潰楂樺害
+ getHeight() {
+ this.$nextTick(() => {
+ this.mainHeight = window.innerHeight - 85
+ this.tableHeight = this.mainHeight - 255
+ this.$refs.tableDataRef.doLayout()
+ })
+ },
+ tableRowClassName({ row, rowIndex }) {
+ // 鎶婃瘡涓�琛岀殑绱㈠紩鏀捐繘row
+ row.index = rowIndex
+ return 'custom-row'
+ },
+ tableRowClassName2({ row, rowIndex }) {
+ return 'custom-row'
+ }
+ }
+}
+</script>
+
+<!--鍏叡椤甸潰鏍峰紡-->
+<style lang="scss" scoped>
+$main_color: #42b983;
+::v-deep .el-range__icon {
+ line-height: 28px !important;
+}
+
+::v-deep .el-range-separator {
+ line-height: 28px !important;
+}
+
+::v-deep .el-range-input {
+ font-size: 14px;
+}
+
+::v-deep .el-range-separator {
+ display: flex;
+ justify-content: center;
+ align-items: center;
+}
+
+::v-deep .el-button--text {
+ font-size: 14px;
+ cursor: pointer;
+}
+
+.el-icon-share, .el-icon-delete, .el-icon-edit-outline {
+ color: $main_color;
+ cursor: pointer;
+}
+
+.el-icon-edit-outline {
+ margin-right: 15px;
+}
+
+::v-deep .el-button--primary, .el-button--default, .el-button--info {
+ height: 34px;
+ display: flex;
+ align-items: center;
+ padding: 0 15px;
+}
+
+::v-deep .el-button--primary {
+ //background-color: $main_color !important;
+}
+
+::v-deep .el-button--default {
+ background-color: #f8f8fa;
+ border: none;
+}
+
+::v-deep .el-input__inner {
+ height: 34px;
+ line-height: 34px;
+ //color: #a7a7a7;
+}
+
+::v-deep .el-dialog__body {
+ padding: 20px 100px !important;
+}
+
+::v-deep .dialogVisibleRoles .el-dialog__body {
+ padding: 20px 20px !important;
+}
+
+::v-deep .importPickerClass .el-dialog__body {
+ padding: 20px 20px !important;
+}
+
+::v-deep .el-dialog__footer {
+ display: flex;
+ justify-content: flex-end;
+}
+
+::v-deep .el-table .caret-wrapper {
+ transform: scale(0.8);
+}
+
+::v-deep .cell {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+}
+
+::v-deep .el-table::before {
+ height: 0;
+}
+
+::v-deep .el-table__body-wrapper {
+ background-color: #f8f8fa;
+}
+
+::v-deep .el-table__body .el-table__row.hover-row td {
+ background-color: #eaecef;
+}
+
+::v-deep .el-form--inline .el-form-item__label {
+ color: #a7a7a7;
+}
+
+.body ::v-deep .el-divider {
+ border: 1px solid #eee;
+ width: 99%;
+ margin: 10px auto;
+}
+
+.body ::v-deep .el-form-item {
+ margin-bottom: 0;
+}
+
+.userDialogVisible ::v-deep .el-form-item {
+ margin-bottom: 0;
+}
+
+::v-deep .el-select__caret {
+ display: flex;
+ align-items: center;
+ justify-content: center;
+}
+
+.tableFixed {
+ ::v-deep .el-table__fixed-right {
+ height: 100% !important;
+ }
+
+ ::v-deep .el-table__fixed {
+ height: 100% !important;
+ }
+}
+
+::v-deep .el-tabs__item {
+ padding-right: 0;
+}
+</style>
+<style>
+
+.el-table .custom-row {
+ background: #f8f8fa;
+}
+</style>
diff --git a/src/views/produce/stepReport2.vue b/src/views/produce/stepReport2.vue
new file mode 100644
index 0000000..507bf08
--- /dev/null
+++ b/src/views/produce/stepReport2.vue
@@ -0,0 +1,1686 @@
+<template>
+ <div>
+ <div class="body" style="padding-top: 10px;" :style="{height:mainHeight+'px'}">
+
+ <div style="position: absolute;right:36px;z-index: 2;top: 13px">
+ <el-button
+ v-if="activeName==='鐢熶骇鍒楄〃'&&tableData.length>0"
+ v-waves
+ icon="el-icon-thumb"
+ type="primary"
+ :disabled="radioSelected===''"
+ @click="report()"
+ >鎶ュ伐
+ </el-button>
+ <el-button
+ v-if="activeName==='澶栧崗鍙戞枡'&&tableData.length>0"
+ v-waves
+ type="primary"
+ icon="el-icon-thumb"
+ :disabled="radioSelected===''"
+ @click="sendOut()"
+ >鍙戞枡
+ </el-button>
+ <el-button
+ v-if="activeName==='澶栧崗鏀舵枡'&&tableData.length>0"
+ v-waves
+ type="primary"
+ icon="el-icon-thumb"
+ :disabled="radioSelected===''"
+ @click="takeIn()"
+ >鏀舵枡
+ </el-button>
+ <el-button
+ v-if="activeName==='涓嶈壇寰呭鐞�'&&tableData.length>0"
+ v-waves
+ type="primary"
+ icon="el-icon-thumb"
+ :disabled="radioSelected===''"
+ @click="handleBad()"
+ >澶勭悊
+ </el-button>
+ </div>
+
+ <div v-if="form.wocode" style="position: absolute;left: 460px;z-index: 2;top: 23px;font-weight: bolder">
+ 褰撳墠宸ュ崟鍙蜂负锛歿{ form.wocode }}
+ </div>
+
+ <el-tabs
+ ref="elTabs"
+ v-model="activeName"
+ type="border-card"
+ @tab-click="tabClick"
+ >
+
+ <el-tab-pane
+ v-for="item in elTabsArr"
+ :key="item.code"
+ :label="item.name"
+ :name="item.name"
+ >
+
+ <div class="bodyTopFormGroup">
+ <el-form
+ ref="form"
+ :model="form"
+ label-width="100px"
+ inline
+ style="display: flex;"
+ >
+ <div class="elForm">
+
+ <el-form-item label="宸ュ崟鍙�" style=" display: flex;">
+ <el-input
+ v-model="workOrderCurrentValue"
+ :name="'produceCode'+item.code"
+ placeholder="璇锋壂鎻忔垨杈撳叆"
+ style="width: 300px"
+
+ @keyup.enter.native="val=>enterNative(val,'produceCode' + item.code)"
+ />
+ </el-form-item>
+ <el-form-item label="浜у搧缂栫爜" style=" display: flex;">
+ <el-input
+ v-model="form.partcode"
+ placeholder="璇疯緭鍏�"
+ style="width: 200px"
+
+ @keyup.enter.native="val=>enterNative(val,'produceCode' + item.code)"
+ />
+ </el-form-item>
+ <el-form-item label="浜у搧鍚嶇О" style=" display: flex;">
+ <el-input
+ v-model="form.partname"
+ placeholder="璇疯緭鍏�"
+
+ style="width: 200px"
+ @keyup.enter.native="val=>enterNative(val,'produceCode' + item.code)"
+ />
+ </el-form-item>
+ <el-form-item label="杞﹂棿鍚嶇О" style=" display: flex;">
+ <el-select
+ v-model="form.wkshopcode"
+ filterable
+ :popper-append-to-body="false"
+ style="width: 200px"
+
+ placeholder="璇烽�夋嫨"
+ >
+ <el-option
+ v-for="item in wkshopcodeArr"
+ :key="item.torg_code"
+ :label="item.torg_name"
+ :value="item.torg_code"
+ />
+ </el-select>
+ </el-form-item>
+
+ <!-- <el-form-item label="瑙勬牸鍨嬪彿" style=" display: flex;">-->
+ <!-- <el-input v-model="form.partspec" placeholder="璇疯緭鍏�" style="width: 200px" />-->
+ <!-- </el-form-item>-->
+
+ </div>
+ <div
+ class="bodySearchReset"
+ :style="{marginLeft:$store.state.app.sidebar.opened? $store.state.settings.menuIsHorizontal?'15%':'3%':'10%'}"
+ >
+ <el-button v-waves type="primary" icon="el-icon-search" @click="search">鏌ヨ</el-button>
+ <el-button v-waves type="info" icon="el-icon-refresh" @click="reset">閲嶇疆</el-button>
+ </div>
+ </el-form>
+ <div
+ class="bodyTopFormExpand"
+ style="height:5px"
+ >
+ <!-- <svg-icon-->
+ <!-- v-show="mouseHoverType==='mouseout'"-->
+ <!-- style="cursor: pointer"-->
+ <!-- :icon-class="!isExpandForm?'doubleDown3':'doubleUp3'"-->
+ <!-- @mouseenter="mouseHoverType=$event.type"-->
+ <!-- />-->
+ <!-- <svg-icon-->
+ <!-- v-show="mouseHoverType==='mouseenter'"-->
+ <!-- style="cursor: pointer"-->
+ <!-- :icon-class="!isExpandForm?'doubleDown':'doubleUp'"-->
+ <!-- @click="isExpandForm=!isExpandForm"-->
+ <!-- @mouseout="mouseHoverType=$event.type"-->
+ <!-- />-->
+ </div>
+ </div>
+
+ <div class="elTableDiv">
+ <el-table
+ ref="tableDataRef"
+ :key="'tableDataRef'+item.code"
+ class="tableFixed"
+ :data="tableData"
+ :height="tableHeight+50"
+ border
+ row-class-name="custom-row"
+ :style="{width: 100+'%',height:tableHeight+'px'}"
+ highlight-current-row
+ :header-cell-style="headerCellStyle()"
+ :cell-style="cellStyle()"
+ @sort-change="sortChange"
+ @row-click="rowClick"
+ >
+ <el-table-column
+ width="50"
+ fixed
+ >
+ <template slot-scope="{row}">
+ <el-radio
+ v-model="radioSelected"
+ :label="row.id"
+ style="color: transparent;padding-left: 10px;"
+ />
+ </template>
+ </el-table-column>
+ <el-table-column
+ prop="rowNum"
+ width="50"
+ label="搴忓彿"
+ fixed
+ />
+ <el-table-column
+ v-if="activeName!=='涓嶈壇寰呭鐞�'"
+ prop="status"
+ show-tooltip-when-overflow
+ label="鐘舵��"
+ sortable="custom"
+ width="80"
+ >
+ <template slot-scope="{row}">
+ <div v-if="row.status==='NEW'">鏂拌鍗�</div>
+ <div v-if="row.status==='ALLO'">宸叉淳鍙�</div>
+ <div v-if="row.status==='START'">寮�宸�</div>
+ <div v-if="row.status==='CLOSED'">瀹屽伐</div>
+ <div v-if="row.status==='NOSCHED'">寰呮帓绋�</div>
+ <div v-if="row.status==='SCHED'">宸叉帓绋�</div>
+ </template>
+ </el-table-column>
+ <el-table-column
+ prop="wo_code"
+ label="宸ュ崟鍙�"
+ min-width="160"
+ show-tooltip-when-overflow
+ sortable="custom"
+ />
+ <el-table-column
+ prop="partcode"
+ label="浜у搧缂栫爜"
+ min-width="110"
+ sortable="custom"
+ show-tooltip-when-overflow
+ />
+ <el-table-column
+ prop="partname"
+ min-width="110"
+ show-tooltip-when-overflow
+ label="浜у搧鍚嶇О"
+ sortable="custom"
+ />
+ <el-table-column
+ prop="partspec"
+ min-width="110"
+ show-tooltip-when-overflow
+ label="瑙勬牸鍨嬪彿"
+ sortable="custom"
+ >
+ <template slot-scope="{row}">
+ {{ row.partspec ? row.partspec : '/' }}
+ </template>
+ </el-table-column>
+ <el-table-column
+ prop="wkshp_name"
+ min-width="110"
+ show-tooltip-when-overflow
+ label="杞﹂棿鍚嶇О"
+ sortable="custom"
+ />
+ <el-table-column
+ prop="stepname"
+ label="宸ュ簭鍚嶇О"
+ show-tooltip-when-overflow
+ width="120"
+ sortable="custom"
+ />
+ <el-table-column
+ prop="plan_qty"
+ label="浠诲姟鏁伴噺"
+ width="110"
+ sortable="custom"
+ show-tooltip-when-overflow
+ />
+ <el-table-column
+ v-if="activeName==='澶栧崗鍙戞枡'||activeName==='澶栧崗鏀舵枡'"
+ prop="fqty"
+ show-tooltip-when-overflow
+ label="宸插彂鏂欐暟閲�"
+ sortable="custom"
+ width="120"
+ />
+ <el-table-column
+ prop="good_qty"
+ show-tooltip-when-overflow
+ :label="activeName==='澶栧崗鍙戞枡'||activeName==='澶栧崗鏀舵枡'?'宸叉敹鏂欐暟閲�':'鍚堟牸鏁伴噺'"
+ sortable="custom"
+ width="120"
+ />
+ <el-table-column
+ prop="ng_qty"
+ label="涓嶈壇鏁伴噺"
+ show-tooltip-when-overflow
+ width="120"
+ sortable="custom"
+ />
+ <el-table-column
+ prop="laborbad_qty"
+ label="宸ュ簾鏁伴噺"
+ width="120"
+ show-tooltip-when-overflow
+ sortable="custom"
+ />
+ <el-table-column
+ prop="materielbad_qty"
+ label="鏂欏簾鏁伴噺"
+ width="120"
+ show-tooltip-when-overflow
+ sortable="custom"
+ />
+
+ <el-table-column
+ label="鎿嶄綔"
+ width="120"
+ fixed="right"
+ >
+ <template slot-scope="{row}">
+ <div class="operationClass">
+ <el-button v-if="activeName==='鐢熶骇鍒楄〃'" v-waves icon="el-icon-thumb" type="text" @click="report(row)">
+ 鎶ュ伐
+ </el-button>
+ <el-button
+ v-if="activeName==='澶栧崗鍙戞枡'"
+ v-waves
+ icon="el-icon-thumb"
+ type="text"
+ @click="sendOut(row)"
+ >鍙戞枡
+ </el-button>
+ <el-button v-if="activeName==='澶栧崗鏀舵枡'" v-waves icon="el-icon-thumb" type="text" @click="takeIn(row)">
+ 鏀舵枡
+ </el-button>
+ <el-button
+ v-if="activeName==='涓嶈壇寰呭鐞�'"
+ v-waves
+ icon="el-icon-thumb"
+ type="text"
+ @click="handleBad(row)"
+ >澶勭悊
+ </el-button>
+ </div>
+ </template>
+ </el-table-column>
+ </el-table>
+ </div>
+ <!--鍒嗛〉-->
+ <pagination
+ :total="total"
+ :page.sync="form.page"
+ :limit.sync="form.rows"
+ align="right"
+ layout="total,prev, pager, next,sizes"
+ popper-class="select_bottom"
+ @pagination="search"
+ />
+ </el-tab-pane>
+
+ </el-tabs>
+
+ </div>
+
+ <!-- 寮�鎶ュ伐銆佸鍗忋�佷笉鑹鐞�-->
+ <el-dialog
+ v-el-drag-dialog
+ :title="dialogTitle"
+ :visible.sync="dialogVisible"
+ width="1160px"
+ :close-on-click-modal="false"
+ :top="activeName==='鐢熶骇鍒楄〃'||activeName==='澶栧崗鏀舵枡'? '6vh':'15vh'"
+ @closed="handleClose"
+ @close="handleClose"
+ >
+ <el-form ref="dialogForm" inline :rules="dialogFormRules" :model="dialogForm" label-width="110px">
+ <!-- <el-divider v-if="activeName==='鐢熶骇鍒楄〃'||activeName==='澶栧崗鏀舵枡'||activeName==='涓嶈壇寰呭鐞�'" content-position="left">鍩烘湰淇℃伅</el-divider>-->
+ <el-divider v-if="activeName==='鐢熶骇鍒楄〃'" content-position="left">鎶ュ伐淇℃伅</el-divider>
+ <el-divider v-if="activeName==='澶栧崗鏀舵枡'" content-position="left">鏀舵枡淇℃伅</el-divider>
+ <el-divider v-if="activeName==='涓嶈壇寰呭鐞�'" content-position="left">寰呭鐞嗕俊鎭�</el-divider>
+ <el-form-item label="宸ュ崟缂栧彿" class="dialogFormItem">
+ <div class="dialogFormItemDiv">{{ dialogForm.wo_code }}</div>
+ </el-form-item>
+ <el-form-item label="浜у搧缂栫爜" class="dialogFormItem">
+ <div class="dialogFormItemDiv">{{ dialogForm.partnumber }}</div>
+ </el-form-item>
+ <el-form-item label="浜у搧鍚嶇О" class="dialogFormItem">
+ <div class="dialogFormItemDiv">{{ dialogForm.partname }}</div>
+ </el-form-item>
+ <el-form-item label="瑙勬牸鍨嬪彿" class="dialogFormItem">
+ <div class="dialogFormItemDiv">{{ dialogForm.partspec ? dialogForm.partspec : '/' }}</div>
+ </el-form-item>
+ <el-form-item label="褰撳墠宸ュ簭" class="dialogFormItem">
+ <div class="dialogFormItemDiv">{{ dialogForm.stepname }}</div>
+ </el-form-item>
+ <el-form-item label="涓嬮亾宸ュ簭" class="dialogFormItem">
+ <div class="dialogFormItemDiv">{{ dialogForm.nextstepname ? dialogForm.nextstepname : '/' }}</div>
+ </el-form-item>
+ <el-form-item label="浠诲姟鏁伴噺" class="dialogFormItem">
+ <div class="dialogFormItemDiv">{{ dialogForm.planqty }}</div>
+ </el-form-item>
+
+ <el-form-item v-if="activeName==='涓嶈壇寰呭鐞�'" label="鍚堟牸鏁伴噺" class="dialogFormItem">
+ <div class="dialogFormItemDiv">{{ dialogForm.noreportqty }}</div>
+ </el-form-item>
+ <el-form-item v-if="activeName==='涓嶈壇寰呭鐞�'" label="涓嶈壇鏁伴噺" class="dialogFormItem">
+ <div class="dialogFormItemDiv">{{ dialogForm.noputqty }}</div>
+ </el-form-item>
+
+ <el-form-item
+ v-if="activeName!=='涓嶈壇寰呭鐞�'"
+ :label="activeName==='鐢熶骇鍒楄〃'? '鏈姤/宸叉姤':(activeName==='澶栧崗鍙戞枡'?'鏈彂/宸插彂':'鏈敹/宸叉敹')"
+ class="dialogFormItem"
+ >
+ <div class="dialogFormItemDiv">{{ dialogForm.noreportqty + '/' + dialogForm.reportqty }}</div>
+ </el-form-item>
+
+ <el-form-item v-if="activeName==='鐢熶骇鍒楄〃'||activeName==='澶栧崗鏀舵枡'" label="涓嶈壇鏁伴噺" class="dialogFormItem">
+ <div class="dialogFormItemDiv" style="color:red;">{{ dialogForm.noputqty }}</div>
+ </el-form-item>
+
+ <el-form-item v-if="activeName==='鐢熶骇鍒楄〃'" label="鎶ュ伐璁惧" class="dialogFormItem">
+ <el-select
+ v-model="dialogForm.eqpcode"
+ style="width:200px"
+ placeholder="璇烽�夋嫨"
+ filterable
+ clearable
+ :popper-append-to-body="false"
+ >
+ <el-option
+ v-for="item in eqpArr"
+ :key="item.code"
+ :label="item.name"
+ :value="item.code"
+ />
+ </el-select>
+ </el-form-item>
+
+ <el-form-item v-if="activeName==='鐢熶骇鍒楄〃'" label="璁′欢鏂瑰紡" class="dialogFormItem">
+ <el-radio-group
+ v-model="dialogForm.reckway"
+ style="width: 200px;"
+ @change="reckwayChange"
+ >
+ <el-radio label="person">涓汉</el-radio>
+ <el-radio label="group">鐝粍</el-radio>
+ </el-radio-group>
+ </el-form-item>
+
+ <el-form-item
+ v-if="activeName==='鐢熶骇鍒楄〃'"
+ :prop="dialogForm.reckway==='group'?'usergroupcode':''"
+ label="鎶ュ伐鐝粍"
+ class="dialogFormItem"
+ >
+ <el-select
+ v-model="dialogForm.usergroupcode"
+ style="width:200px"
+ placeholder="璇烽�夋嫨"
+ filterable
+ :disabled="dialogForm.reckway!=='group'"
+ :popper-append-to-body="false"
+ @change="usergroupChange"
+ >
+ <el-option
+ v-for="item in usergroupArr"
+ :key="item.usergroupcode"
+ :label="item.usergroupname"
+ :value="item.usergroupcode"
+ />
+ </el-select>
+ </el-form-item>
+ <el-form-item v-if="activeName==='鐢熶骇鍒楄〃'" prop="reportuser" label="鎶ュ伐浜哄憳" class="dialogFormItem">
+ <el-select
+ v-model="dialogForm.reportuser"
+ style="width:200px"
+ placeholder="璇烽�夋嫨"
+ filterable
+ multiple
+ collapse-tags
+ :multiple-limit="dialogForm.reckway==='group'?0:1"
+ :disabled="dialogForm.reckway==='group'&&dialogForm.usergroupcode===''"
+ :popper-append-to-body="false"
+ >
+ <el-option
+ v-for="item in reportuserArr"
+ :key="item.usercode"
+ :label="item.username"
+ :value="item.usercode"
+ />
+ </el-select>
+ </el-form-item>
+ <el-form-item v-if="activeName==='鐢熶骇鍒楄〃'" prop="startqty" label="鍚堟牸鏁伴噺" class="dialogFormItem">
+ <el-input v-model="dialogForm.startqty" oninput="value=value.replace(/[^\d]/g,'')" style="width: 200px" />
+ </el-form-item>
+
+ <el-form-item v-if="activeName==='澶栧崗鍙戞枡'||activeName==='澶栧崗鏀舵枡'" prop="wxcode" label="澶栧崗渚涙柟" class="dialogFormItem">
+ <el-select
+ v-model="dialogForm.wxcode"
+ style="width:200px"
+ placeholder="璇烽�夋嫨"
+ filterable
+ :popper-append-to-body="false"
+ >
+ <el-option
+ v-for="item in wxArr"
+ :key="item.code"
+ :label="item.name"
+ :value="item.code"
+ />
+ </el-select>
+ </el-form-item>
+ <el-form-item v-if="activeName==='澶栧崗鍙戞枡'" prop="outuser" label="鍙戞枡浜哄憳" class="dialogFormItem">
+ <el-select
+ v-model="dialogForm.outuser"
+ style="width:200px"
+ placeholder="璇烽�夋嫨"
+ filterable
+ :popper-append-to-body="false"
+ >
+ <el-option
+ v-for="item in reportuserArr"
+ :key="item.usercode"
+ :label="item.username"
+ :value="item.usercode"
+ />
+ </el-select>
+ </el-form-item>
+ <el-form-item v-if="activeName==='澶栧崗鍙戞枡'" prop="fqty" label="鍙戞枡鏁伴噺" class="dialogFormItem">
+ <el-input v-model="dialogForm.fqty" oninput="value=value.replace(/[^\d]/g,'')" style="width: 200px" />
+ </el-form-item>
+
+ <el-form-item v-if="activeName==='澶栧崗鏀舵枡'" prop="inuser" label="鏀舵枡浜哄憳" class="dialogFormItem">
+ <el-select
+ v-model="dialogForm.inuser"
+ style="width:200px"
+ placeholder="璇烽�夋嫨"
+ filterable
+ :popper-append-to-body="false"
+ >
+ <el-option
+ v-for="item in reportuserArr"
+ :key="item.usercode"
+ :label="item.username"
+ :value="item.usercode"
+ />
+ </el-select>
+ </el-form-item>
+ <el-form-item v-if="activeName==='澶栧崗鏀舵枡'" prop="sqty" label="鏀舵枡鏁伴噺" class="dialogFormItem">
+ <el-input v-model="dialogForm.sqty" oninput="value=value.replace(/[^\d]/g,'')" style="width: 200px" />
+ </el-form-item>
+
+ <el-divider v-if="activeName==='鐢熶骇鍒楄〃'||activeName==='澶栧崗鏀舵枡'" content-position="left">涓嶈壇鏄庣粏淇℃伅</el-divider>
+ <el-button
+ v-if="activeName==='鐢熶骇鍒楄〃'||activeName==='澶栧崗鏀舵枡'"
+ v-waves
+ type="primary"
+ icon="el-icon-circle-plus-outline"
+ @click="addDefect"
+ >鏂板
+ </el-button>
+ <el-table
+ v-if="activeName==='鐢熶骇鍒楄〃'||activeName==='澶栧崗鏀舵枡'"
+ ref="defectTableDataRef"
+ key="defectTableDataKey"
+ :data="defectTableData"
+ border
+ row-class-name="custom-row"
+ height="200"
+ style="width: 100%;margin-top: 15px;"
+ highlight-current-row
+ :header-cell-style="this.$headerCellStyle"
+ :cell-style="this.$cellStyle"
+ >
+ <el-table-column
+ type="index"
+ label="搴忓彿"
+ align="center"
+ width="50"
+ />
+ <el-table-column
+ prop="stepcode"
+ label="缂洪櫡缂栫爜/鍚嶇О"
+ align="center"
+ min-width="450"
+ >
+ <template slot-scope="{row}">
+ <el-select
+ v-model="row.code"
+ style="width: 100%"
+ placeholder="璇烽�夋嫨"
+ multiple
+ filterable
+ >
+ <!-- collapse-tags-->
+ <el-option
+ v-for="item in defectArr"
+ :key="item.code"
+ :label="item.name"
+ :value="item.code"
+ />
+ </el-select>
+ </template>
+ </el-table-column>
+
+ <el-table-column
+ prop="badqty"
+ label="涓嶈壇鏁伴噺"
+ align="center"
+ >
+ <template slot-scope="{row}">
+ <el-input
+ v-model="row.badqty"
+ placeholder="璇疯緭鍏ユ暟閲�"
+ oninput="value=value.replace(/[^0-9]/g,'')"
+ style="width: 100%"
+ @click.stop=""
+ @change="badqtyChange"
+ />
+ </template>
+ </el-table-column>
+ <el-table-column
+ label="鎿嶄綔"
+ width="50"
+ align="center"
+ >
+ <template slot-scope="{row}">
+ <div class="operationClass">
+ <el-tooltip v-del-tab-index class="item" effect="dark" content="鍒犻櫎" placement="top">
+ <i
+ class="el-icon-delete"
+ :style="{color:$store.state.settings.theme}"
+ style="margin-left: 7px;"
+ @click="defectDel(row)"
+ />
+ </el-tooltip>
+ </div>
+ </template>
+ </el-table-column>
+ </el-table>
+
+ <el-divider v-if="activeName==='澶栧崗鏀舵枡'" content-position="left">鍙敹鏂欎緵搴斿晢</el-divider>
+ <div
+ v-for="(item,index) in dialogForm.list"
+ v-if="item.fqty>0"
+ :key="item.name"
+ style="display: flex;line-height: 26px;height: 26px;margin-left:30px;align-items: center"
+ >
+ <div
+ style="color: #fff;width: 22px;height: 22px;display: flex;justify-content: center;align-items: center;border-radius: 50%"
+ :style="{backgroundColor:$store.state.settings.theme}"
+ >{{ index + 1 }}
+ </div>
+ <div style="margin-left:30px;width: 160px;" class="ellipsis">
+ {{ item.tp }}
+ </div>
+ <div style="margin-left:30px;">
+ 鍙敹鏁伴噺锛歿{ item.acceptQty }}
+ </div>
+ </div>
+
+ <el-divider v-if="activeName==='涓嶈壇寰呭鐞�'" content-position="left">涓嶈壇淇℃伅鏄庣粏</el-divider>
+ <el-table
+ v-if="activeName==='涓嶈壇寰呭鐞�'"
+ ref="badTableDataDataRef"
+ key="badTableDataDataKey"
+ :data="badTableData"
+ border
+ row-class-name="custom-row"
+ height="300"
+ style="width: 100%;margin-top: 15px;"
+ highlight-current-row
+ :header-cell-style="this.$headerCellStyle"
+ :cell-style="this.$cellStyle"
+ >
+ <el-table-column
+ type="index"
+ label="搴忓彿"
+ align="center"
+ width="50"
+ />
+ <!-- <el-table-column-->
+ <!-- prop="step_code"-->
+ <!-- label="宸ュ簭缂栫爜"-->
+ <!-- show-tooltip-when-overflow-->
+ <!-- align="center"-->
+ <!-- />-->
+ <el-table-column
+ prop="stepname"
+ label="宸ュ簭鍚嶇О"
+ show-tooltip-when-overflow
+ align="center"
+ />
+ <el-table-column
+ prop="plan_qty"
+ label="浠诲姟鏁伴噺"
+ show-tooltip-when-overflow
+ align="center"
+ />
+ <el-table-column
+ prop="report_qty"
+ label="鍚堟牸鏁伴噺"
+ show-tooltip-when-overflow
+ align="center"
+ />
+ <el-table-column
+ prop="ng_qty"
+ label="涓嶈壇鏁伴噺"
+ show-tooltip-when-overflow
+ align="center"
+ />
+ <el-table-column
+ prop="defect_name"
+ label="涓嶈壇鍘熷洜"
+ show-tooltip-when-overflow
+ align="center"
+ />
+ <el-table-column
+ prop="repair_qty"
+ label="缁翠慨鍚堟牸鏁伴噺"
+ align="center"
+ >
+ <template slot-scope="{row}">
+ <el-input
+ v-model="row.repair_qty"
+ placeholder="璇疯緭鍏ユ暟閲�"
+ oninput="value=value.replace(/[^0-9]/g,'')"
+ style="width: 100%"
+ @click.stop=""
+ />
+ </template>
+ </el-table-column>
+ <el-table-column
+ prop="laborbad_qty"
+ label="宸ュ簾鏁伴噺"
+ align="center"
+ >
+ <template slot-scope="{row}">
+ <el-input
+ v-model="row.laborbad_qty"
+ placeholder="璇疯緭鍏ユ暟閲�"
+ oninput="value=value.replace(/[^0-9]/g,'')"
+ style="width: 100%"
+ @click.stop=""
+ />
+ </template>
+ </el-table-column>
+ <el-table-column
+ prop="materielbad_qty"
+ label="鏂欏簾鏁伴噺"
+ align="center"
+ >
+ <template slot-scope="{row}">
+ <el-input
+ v-model="row.materielbad_qty"
+ placeholder="璇疯緭鍏ユ暟閲�"
+ oninput="value=value.replace(/[^0-9]/g,'')"
+ style="width: 100%"
+ @click.stop=""
+ />
+ </template>
+ </el-table-column>
+
+ <!-- <el-table-column-->
+ <!-- prop="badqty"-->
+ <!-- label="涓嶈壇鏁伴噺"-->
+ <!-- show-tooltip-when-overflow-->
+ <!-- align="center"-->
+ <!-- >-->
+ <!-- <template slot-scope="{row}">-->
+ <!-- <el-input-->
+ <!-- v-model="row.badqty"-->
+ <!-- placeholder="璇疯緭鍏ユ暟閲�"-->
+ <!-- oninput="value=value.replace(/[^0-9]/g,'')"-->
+ <!-- style="width: 100%"-->
+ <!-- @click.stop=""-->
+ <!-- @change="badqtyChange"-->
+ <!-- />-->
+ <!-- </template>-->
+ <!-- </el-table-column>-->
+
+ <!-- <el-table-column-->
+ <!-- label="鎿嶄綔"-->
+ <!-- width="50"-->
+ <!-- align="center"-->
+ <!-- >-->
+ <!-- <template slot-scope="{row}">-->
+ <!-- <div class="operationClass">-->
+ <!-- <el-tooltip v-del-tab-index class="item" effect="dark" content="鍒犻櫎" placement="top">-->
+ <!-- <i-->
+ <!-- class="el-icon-delete"-->
+ <!-- :style="{color:$store.state.settings.theme}"-->
+ <!-- style="margin-left: 7px;"-->
+ <!-- @click="defectDel(row)"-->
+ <!-- />-->
+ <!-- </el-tooltip>-->
+ <!-- </div>-->
+ <!-- </template>-->
+ <!-- </el-table-column>-->
+
+ </el-table>
+ </el-form>
+
+ <span slot="footer" class="dialog-footer">
+ <div class="footerButton">
+ <el-button v-waves @click="dialogVisibleCancel">鍙� 娑�</el-button>
+ <el-button
+ v-waves
+ type="primary"
+ :loading="$store.state.app.buttonIsDisabled"
+ :disabled="$store.state.app.buttonIsDisabled"
+ @click="dialogVisibleConfirm"
+ >纭� 瀹�</el-button>
+ </div>
+ </span>
+ </el-dialog>
+
+ <!-- 娴佽浆灏忔爣绛炬墦鍗�-->
+ <!--鎵撳嵃棰勮椤甸潰 灏忔爣绛�-->
+ <el-dialog
+ v-el-drag-dialog
+ title="棰勮"
+ :visible.sync="dialogVisible2"
+ width="1140"
+ top="10vh"
+ :close-on-click-modal="false"
+ @close="dialogVisible2Close"
+ >
+ <!-- 瑕佹墦鍗扮殑鍖哄煙 -->
+ <div id="printMe2" style="padding: 30px;">
+ <div
+ style="display: flex;width: 280px;height: 150px;border: 1px solid #000;text-align: center;font-size: 10px;"
+ >
+
+ <div style="width: 90px;display: flex;flex-direction: column;border-right: 1px solid #000">
+ <div
+ style="display: flex;height: 90px;border-bottom:1px solid #000;
+ justify-content: center;align-items: center;position: relative"
+ >
+ <div id="qrCode2" ref="qrCodeDiv2" style="overflow-y: hidden;height:60px;position: absolute;left: 14px;" />
+ </div>
+ <div
+ style="display: flex;height: 30px;justify-content: flex-start;border-bottom:1px solid #000;align-items: center"
+ >
+ <div style="margin-left: 5px;width: 28px">鏁伴噺:</div>
+ {{ qrForm.startqty }}
+ </div>
+ <div style="display: flex;height: 30px;justify-content: flex-start;align-items: center">
+ <div style="margin-left: 5px;width: 42px">澶勭悊浜�:</div>
+ {{ qrForm.operator }}
+ </div>
+ </div>
+
+ <div style="width:190px;display: flex;flex-direction: column">
+ <div
+ style="display: flex;height: 20%;border-bottom:1px solid #000;justify-content: flex-start;align-items: center;text-align: left"
+ >
+ <div style="width: 60px;margin-left: 5px;">宸ュ崟缂栧彿:</div>
+ <div>{{ qrForm.wo_code }}</div>
+ </div>
+ <div
+ style="display: flex;height: 20%;border-bottom:1px solid #000;justify-content: flex-start;align-items: center ;text-align: left"
+ >
+ <div style="width: 60px;margin-left: 5px;">浜у搧缂栫爜:</div>
+ <div>{{ qrForm.partcode }}</div>
+ </div>
+ <div
+ style="display: flex;height: 20%;border-bottom:1px solid #000 ;justify-content: flex-start;align-items: center;text-align: left"
+ >
+ <div style="width:60px;margin-left: 5px;">浜у搧鍚嶇О:</div>
+ <div>{{ qrForm.partname }}</div>
+ </div>
+ <div
+ style="display: flex;height: 20%;border-bottom:1px solid #000 ;justify-content: flex-start;align-items: center;text-align: left"
+ >
+ <div style="width:60px;margin-left: 5px;">{{ qrForm.nextstepname?'涓嬮亾宸ュ簭':'浜у搧瑙勬牸' }}:</div>
+ <div>{{ qrForm.nextstepname?qrForm.nextstepname:qrForm.partspec?qrForm.partspec:'/' }}</div>
+ </div>
+ <div style="display: flex;height: 20%;justify-content: flex-start;align-items: center;text-align: left">
+ <div style="width: 60px;margin-left: 5px;">澶勭悊鏃堕棿:</div>
+ <div>{{ qrForm.operatorTime }}</div>
+ </div>
+
+ </div>
+
+ </div>
+ </div>
+ <span slot="footer" class="dialog-footer">
+ <div class="footerButton">
+ <el-button v-waves @click="dialogVisible2 = false">鍙� 娑�</el-button>
+ <el-button v-waves v-print="printObj2" type="primary">纭� 瀹�</el-button>
+ </div>
+ </span>
+ </el-dialog>
+
+ </div>
+</template>
+
+<script>
+import Pagination from '@/components/Pagination'
+import $ from 'jquery'
+import elDragDialog from '@/directive/el-drag-dialog'
+import waves from '@/directive/waves'
+import {
+ EditOrderNgStepSeave,
+ MesOrderNgStepSearch,
+ MesOrderNgSubStepSearch,
+ MesOrderStepSearch, MesOrderStepStart,
+ MesOrderWxStepSearch, SavaMesOrderStepIn, SavaMesOrderStepOut, SavaMesOrderStepReport
+} from '@/api/WorkOrder'
+import {
+ CustomerPermissions,
+ DefectPermissions,
+ EqpPermissions,
+ GroupsPermissions,
+ GroupsPersonPermissions,
+ PersonPermissions, PrentOrganizationNoCompany
+} from '@/api/GeneralBasicData'
+import { nanoid } from 'nanoid'
+import { LabelBarCode } from '@/api/systemSetting'
+import { getCookie } from '@/utils/auth'
+import { handleDatetime2 } from '@/utils/global'
+import QRCode from 'qrcodejs2'
+export default {
+ name: 'StepReport2',
+ components: {
+ Pagination
+ },
+ directives: { elDragDialog, waves },
+ data() {
+ return {
+ mainHeight: 0,
+ tableHeight: 0,
+ form: {
+ wkshopcode: '',
+ wocode: '', // 宸ュ崟鍙�
+ partcode: '', // 浜у搧缂栫爜
+ partname: '', // 浜у搧鍚嶇О
+ partspec: '', // 浜у搧瑙勬牸
+ prop: 'lm_date', // 鎺掑簭瀛楁
+ order: 'desc', // 鎺掑簭瀛楁
+ page: 1, // 绗嚑椤�
+ rows: 20 // 姣忛〉澶氬皯鏉�
+ },
+ wkshopcodeArr: [],
+ total: 10,
+ tableData: [],
+ activeName: '鐢熶骇鍒楄〃',
+ elTabsArr: [
+ { code: 'ZZ', name: '鐢熶骇鍒楄〃' },
+ { code: 'OUT', name: '澶栧崗鍙戞枡' },
+ { code: 'IN', name: '澶栧崗鏀舵枡' },
+ { code: 'BAD', name: '涓嶈壇寰呭鐞�' }
+ ],
+
+ radioSelected: '', // 澶氶�夋閫変腑鍊�
+
+ dialogVisible: false,
+ dialogTitle: '', // 瀵硅瘽妗嗗皬鏍囬
+
+ dialogForm: {
+ 'wo_code': '',
+ 'partnumber': '',
+ 'partname': '',
+ 'partspec': '',
+ 'seq': '',
+ 'stepcode': '',
+ 'stepname': '',
+ 'stepprice': '', // 宸ュ簭鍗曚环
+ 'nextstepcode': '',
+ 'nextstepname': '',
+ 'nextstepprice': '',
+ 'stepdesc': '',
+ 'planqty': 0,
+ 'startqty': '', //
+ 'noreportqty': 0, // 鏈姤鏁伴噺
+ 'reportqty': 0, // 宸叉姤鏁伴噺
+ 'noputqty': 0, // 涓嶈壇鏁伴噺
+ 'wkshopcode': '',
+ 'wkshopname': '',
+ 'eqpcode': '',
+ 'eqpname': '',
+
+ remarks: '', // 澶囨敞
+ inbarcode: '', // 鍏ュ簱鏉$爜
+ defectlist: '', // 涓嶈壇姹囨��
+ reckway: 'person', // 璁′欢鏂瑰紡(鐝粍:group銆佷釜浜�:person)
+ usergroupcode: '', // 鐝粍缂栫爜
+ reportuser: [], // 鎶ュ伐浜哄憳
+
+ wxcode: '',
+ outuser: '',
+ fqty: '',
+ inuser: '',
+ sqty: '',
+ list: ''
+
+ },
+ dialogFormRules: {
+ eqpcode: [
+ { required: true, message: '璇烽�夋嫨鎶ュ伐璁惧', trigger: ['blur', 'change'] }
+ ],
+ usergroupcode: [
+ { required: true, message: '璇烽�夋嫨鎶ュ伐鐝粍', trigger: ['blur', 'change'] }
+ ],
+ reportuser: [
+ { required: true, message: '璇烽�夋嫨鎶ュ伐浜哄憳', trigger: ['blur', 'change'] }
+ ],
+ startqty: [
+ { required: true, message: '璇疯緭鍏ュ悎鏍兼暟閲�', trigger: ['blur', 'change'] }
+ ],
+ wxcode: [
+ { required: true, message: '璇烽�夋嫨澶栧崗渚涙柟', trigger: ['blur', 'change'] }
+ ],
+ outuser: [
+ { required: true, message: '璇烽�夋嫨鍙戞枡浜哄憳', trigger: ['blur', 'change'] }
+ ],
+ inuser: [
+ { required: true, message: '璇烽�夋嫨鏀舵枡浜哄憳', trigger: ['blur', 'change'] }
+ ],
+ fqty: [
+ { required: true, message: '璇疯緭鍏ュ彂鏂欐暟閲�', trigger: ['blur', 'change'] }
+ ],
+ sqty: [
+ { required: true, message: '璇疯緭鍏ユ敹鏂欐暟閲�', trigger: ['blur', 'change'] }
+ ]
+
+ },
+ reckwayArr: [// 鎶ュ伐绫诲瀷
+ { code: 'group', name: '鐝粍' },
+ { code: 'person', name: '涓汉' }
+ ],
+ reportuserArr: [], // 鎶ュ伐浜哄憳
+ usergroupArr: [], // 鎶ュ伐鐝粍
+ eqpArr: [], // 鎶ュ伐璁惧
+ defectArr: [], // 涓嶈壇缂洪櫡
+ wxArr: [], // 寰�鏉ュ崟浣嶄笅鎷�
+
+ defectTableData: [],
+ badTableData: [],
+ workOrderCurrentValue: '',
+
+ dialogVisible2: false, //
+ qrForm: { // 鎵撳嵃鍐呭
+ qrvalue: '',
+ startqty: '',
+ wo_code: '',
+ partcode: '',
+ partname: '',
+ partspec: '',
+ nextstepname: '',
+ operator: '', // 鎿嶄綔浜�
+ operatorTime: ''// 鎿嶄綔鏃堕棿
+ },
+ printObj2: {
+ id: 'printMe2',
+ popTitle: '鎵撳嵃妯℃澘',
+ preview: false,
+ extraHead: '<meta http-equiv="Content-Language" content="zh-cn"/>',
+ closeCallback(vue) { // 鍏抽棴鎵撳嵃鐨勫洖璋冧簨浠讹紙鏃犳硶纭畾鐐瑰嚮鐨勬槸纭杩樻槸鍙栨秷锛�
+ console.log('11212', vue)
+ // vue.dialogVisible = false
+ vue.dialogVisible2 = false
+ vue.dialogVisible = false
+ },
+ beforeOpenCallback(vue) {
+ vue.printLoading = true
+ console.log('鎵撳紑涔嬪墠')
+ },
+ openCallback(vue) {
+ vue.printLoading = false
+ console.log('鎵ц浜嗘墦鍗�')
+ }
+ },
+ xx: ''
+ }
+ },
+ activated() {
+ window.addEventListener('resize', this.getHeight)
+ this.getHeight()
+ },
+ created() {
+
+ },
+ mounted() {
+ window.addEventListener('resize', this.getHeight)
+ this.getHeight()
+
+ this.tabClick()
+
+ this.getAllSelectArr()
+ },
+ methods: {
+
+ async getAllSelectArr() {
+ const { data: res1 } = await GroupsPermissions()// 鐝粍
+ this.usergroupArr = res1
+
+ const { data: res2 } = await PersonPermissions() // 浜哄憳
+ this.reportuserArr = res2
+
+ const { data: res3 } = await DefectPermissions() // 缂洪櫡
+ this.defectArr = res3
+
+ const { data: res4 } = await EqpPermissions() // 璁惧
+ this.eqpArr = res4
+
+ const { data: res5 } = await CustomerPermissions() // 寰�鏉ュ崟浣�
+ this.wxArr = res5
+
+ const { data: res6 } = await PrentOrganizationNoCompany()// 鏃犲叕鍙哥殑缁勭粐涓嬫媺
+ this.wkshopcodeArr = res6
+ },
+ tabClick() {
+ let belong
+ switch (this.activeName) {
+ case '鐢熶骇鍒楄〃':
+ belong = 'produceCodeZZ'
+ this.dialogTitle = '鎶ュ伐'
+ break
+ case '澶栧崗鍙戞枡':
+ belong = 'produceCodeOUT'
+ this.dialogTitle = '鍙戞枡'
+ break
+ case '澶栧崗鏀舵枡':
+ belong = 'produceCodeIN'
+ this.dialogTitle = '鏀舵枡'
+ break
+ case '涓嶈壇寰呭鐞�':
+ belong = 'produceCodeBAD'
+ this.dialogTitle = '涓嶈壇澶勭悊'
+ break
+ }
+ this.enterNative(this.form.wocode, belong)
+
+ this.radioSelected = ''
+ },
+ enterNative(val, belong) {
+ if (belong === 'produceCodeZZ') {
+ this.$nextTick(() => {
+ $('input[name=\'produceCodeZZ\']')[0].focus()
+ })
+ }
+ if (belong === 'produceCodeOUT') {
+ this.$nextTick(() => {
+ $('input[name=\'produceCodeOUT\']')[0].focus()
+ })
+ }
+ if (belong === 'produceCodeIN') {
+ this.$nextTick(() => {
+ $('input[name=\'produceCodeIN\']')[0].focus()
+ })
+ }
+ if (belong === 'produceCodeBAD') {
+ this.$nextTick(() => {
+ $('input[name=\'produceCodeBAD\']')[0].focus()
+ })
+ }
+ this.search()
+ },
+ // 鎺掑簭鏀瑰彉鏃�
+ sortChange({ column, prop, order }) {
+ if (order === 'descending') {
+ order = 'desc'
+ } else if (order === 'ascending') {
+ order = 'asc'
+ } else {
+ order = 'desc'
+ }
+ this.form.order = order
+ this.form.prop = prop
+ this.search()
+ },
+ // 鏌ヨ
+ async search() {
+ this.form.wocode = this.workOrderCurrentValue
+ this.workOrderCurrentValue = ''
+ if (this.activeName === '鐢熶骇鍒楄〃') {
+ const res = await MesOrderStepSearch(this.form)
+ this.tableData = res.data
+ this.total = res.count
+ }
+ if (this.activeName === '澶栧崗鍙戞枡' || this.activeName === '澶栧崗鏀舵枡') {
+ const res = await MesOrderWxStepSearch(this.form)
+ this.tableData = res.data
+ this.total = res.count
+ }
+
+ if (this.activeName === '涓嶈壇寰呭鐞�') {
+ const res = await MesOrderNgStepSearch(this.form)
+ this.tableData = res.data
+ this.total = res.count
+ }
+ },
+ // 鎶ュ伐
+ report(row) {
+ if (row) {
+ this.getMesOrderStepStart('ZZ', '', row.wo_code, row.stepcode)
+ } else {
+ const temp = this.tableData.find(i => i.id === this.radioSelected)
+ this.getMesOrderStepStart('ZZ', '', temp.wo_code, temp.stepcode)
+ }
+ },
+ // 鍙戞枡
+ sendOut(row) {
+ if (row) {
+ this.getMesOrderStepStart('WX', 'OUT', row.wo_code, row.stepcode)
+ } else {
+ const temp = this.tableData.find(i => i.id === this.radioSelected)
+ this.getMesOrderStepStart('WX', 'OUT', temp.wo_code, temp.stepcode)
+ }
+ },
+ // 鏀舵枡
+ takeIn(row) {
+ if (row) {
+ this.getMesOrderStepStart('WX', 'IN', row.wo_code, row.stepcode)
+ } else {
+ const temp = this.tableData.find(i => i.id === this.radioSelected)
+ this.getMesOrderStepStart('WX', 'IN', temp.wo_code, temp.stepcode)
+ }
+ },
+ // 涓嶈壇澶勭悊 鐢熶骇寮�鎶ュ伐鎵爜鑾峰彇宸ュ崟瀵瑰簲宸ュ簭浠诲姟(涓嶈壇鏄庣粏)
+ async handleBad(row) {
+ const data = {
+ wocode: row ? row.wo_code : this.tableData.find(i => i.id === this.radioSelected).wo_code,
+ stepcode: row ? row.stepcode : this.tableData.find(i => i.id === this.radioSelected).stepcode
+ }
+ let res = await MesOrderNgSubStepSearch(data)
+ if (res.code === '200') {
+ res = res.data
+ this.dialogForm.wo_code = res.data1.wo_code
+ this.dialogForm.partnumber = res.data1.partnumber
+ this.dialogForm.partname = res.data1.partname
+ this.dialogForm.partspec = res.data1.partspec
+ this.dialogForm.seq = res.data1.seq
+ this.dialogForm.stepcode = res.data1.stepcode
+ this.dialogForm.stepname = res.data1.stepname
+ this.dialogForm.stepprice = res.data1.stepprice
+ this.dialogForm.nextstepcode = res.data1.nextstepcode
+ this.dialogForm.nextstepname = res.data1.nextstepname
+ this.dialogForm.nextstepprice = res.data1.nextstepprice
+ this.dialogForm.stepdesc = res.data1.stepdesc
+ this.dialogForm.planqty = res.data1.planqty
+ this.dialogForm.startqty = res.data1.startqty
+ this.dialogForm.noreportqty = res.data1.noreportqty // 鍚堟牸鏁伴噺
+ this.dialogForm.reportqty = res.data1.reportqty
+ this.dialogForm.noputqty = res.data1.noputqty // 涓嶈壇鏁伴噺
+ this.dialogForm.wkshopcode = res.data1.wkshopcode
+ this.dialogForm.wkshopname = res.data1.wkshopname
+ this.dialogForm.eqpcode = res.data1.eqpcode
+ this.dialogForm.eqpname = res.data1.eqpname
+
+ res.data2.forEach(item => {
+ item.repair_qty = 0
+ item.laborbad_qty = 0
+ item.materielbad_qty = 0
+ })
+
+ this.badTableData = res.data2
+
+ this.dialogVisible = true
+ }
+ },
+ // 鐢熶骇寮�鎶ュ伐锛氭姤宸�/澶栧崗(鍙戞枡/鏀舵枡)鏃舵潯浠跺垽鏂強鏁版嵁杩斿洖鎺ュ彛
+ async getMesOrderStepStart(OperType, SelectType, wocode, stepcode) {
+ const data = {
+ OperType, SelectType, wocode, stepcode
+ }
+ let res = await MesOrderStepStart(data)
+ if (res.code === '200') {
+ res = res.data
+ this.dialogForm.wo_code = res.wo_code
+ this.dialogForm.partnumber = res.partnumber
+ this.dialogForm.partname = res.partname
+ this.dialogForm.partspec = res.partspec
+ this.dialogForm.seq = res.seq
+ this.dialogForm.stepcode = res.stepcode
+ this.dialogForm.stepname = res.stepname
+ this.dialogForm.stepprice = res.stepprice
+ this.dialogForm.nextstepcode = res.nextstepcode
+ this.dialogForm.nextstepname = res.nextstepname
+ this.dialogForm.nextstepprice = res.nextstepprice
+ this.dialogForm.stepdesc = res.stepdesc
+ this.dialogForm.planqty = res.planqty
+ this.dialogForm.startqty = res.startqty === 0 ? '' : res.startqty
+ this.dialogForm.noreportqty = res.noreportqty// 鏈姤鏁伴噺
+ this.dialogForm.reportqty = res.reportqty // 宸叉姤鏁伴噺
+ this.dialogForm.noputqty = res.noputqty
+ this.dialogForm.wkshopcode = res.wkshopcode
+ this.dialogForm.wkshopname = res.wkshopname
+ this.dialogForm.eqpcode = res.eqpcode
+ this.dialogForm.eqpname = res.eqpname
+
+ if (this.activeName === '澶栧崗鏀舵枡') {
+ this.dialogForm.list = []
+ res.list.forEach(i => {
+ i.acceptQty = parseFloat(i.fqty) - parseFloat(i.sqty) - parseFloat(i.ng_qty) - parseFloat(i.laborbad_qty) - parseFloat(i.materielbad_qty)
+ if (i.acceptQty > 0) {
+ this.dialogForm.list.push(i)
+ }
+ })
+ }
+
+ // this.dialogForm.list = res.list
+
+ this.dialogVisible = true
+ }
+ },
+ // 瀵硅瘽妗嗗叧闂簨浠�
+ handleClose() {
+ this.dialogForm = {
+ 'wo_code': '',
+ 'partnumber': '',
+ 'partname': '',
+ 'partspec': '',
+ 'seq': '',
+ 'stepcode': '',
+ 'stepname': '',
+ 'stepprice': '', // 宸ュ簭鍗曚环
+ 'nextstepcode': '',
+ 'nextstepname': '',
+ 'nextstepprice': '',
+ 'stepdesc': '',
+ 'planqty': 0,
+ 'startqty': '', //
+ 'noreportqty': 0, // 鏈姤鏁伴噺
+ 'reportqty': 0, // 宸叉姤鏁伴噺
+ 'noputqty': 0, // 涓嶈壇鏁伴噺
+ 'wkshopcode': '',
+ 'wkshopname': '',
+ 'eqpcode': '',
+ 'eqpname': '',
+
+ wxcode: '',
+ outuser: '',
+ fqty: '',
+ inuser: '',
+ sqty: '',
+ list: '',
+
+ remarks: '', // 澶囨敞
+ inbarcode: '', // 鍏ュ簱鏉$爜
+ defectlist: '', // 涓嶈壇姹囨��
+ reckway: 'person', // 璁′欢鏂瑰紡(鐝粍:group銆佷釜浜�:person)
+ usergroupcode: '', // 鐝粍缂栫爜
+ reportuser: [] // 鎶ュ伐浜哄憳
+
+ }
+
+ this.defectTableData = []
+ this.badTableData = []
+
+ this.$refs.dialogForm.clearValidate()
+ },
+ // 瀵硅瘽妗嗗彇娑�
+ dialogVisibleCancel() {
+ this.dialogVisible = false
+ this.tabClick()
+ },
+ // 瀵硅瘽妗嗙‘璁�
+ dialogVisibleConfirm() {
+ this.$refs.dialogForm.validate(async valid => {
+ if (valid) {
+ if (this.activeName === '鐢熶骇鍒楄〃') {
+ if (this.defectTableData.find(i => i.code.length === 0)) {
+ return this.$message.info('缂洪櫡缂栫爜/鍚嶇О涓嶈兘涓虹┖锛�')
+ }
+ if (this.defectTableData.find(i => i.badqty.toString().trim() === '' || parseFloat(i.badqty) === 0)) {
+ return this.$message.info('涓嶈壇鏁伴噺涓嶈兘涓虹┖鎴栦负闆讹紒')
+ }
+
+ if (parseFloat(this.dialogForm.noreportqty) < parseFloat(this.dialogForm.startqty) + parseFloat(this.dialogForm.noputqty)) {
+ return this.$message.info('鍚堟牸鏁伴噺鍔犱笉鑹暟閲忎笉鑳藉ぇ浜庝簡鏈姤鏁伴噺!')
+ }
+ let inbarcode = ''
+ if (this.tableData.find(i => i.id === this.radioSelected).isend === 'Y') {
+ const data1 = {
+ rightcode: getCookie('ruleCode'),
+ partcode: this.dialogForm.partnumber,
+ qty: this.dialogForm.startqty,
+ onelabqty: this.dialogForm.startqty
+ }
+
+ const res1 = await LabelBarCode(data1)
+ inbarcode = res1.data[0].labcode
+ }
+
+ const defectlist = []
+ this.defectTableData.forEach(i => {
+ defectlist.push({
+ defect_code: i.code.join(','),
+ badqty: i.badqty
+ })
+ })
+ const data = {
+ mesordercode: this.dialogForm.wo_code,
+ partcode: this.dialogForm.partnumber,
+ stepseq: this.dialogForm.seq,
+ stepcode: this.dialogForm.stepcode,
+ stepprice: this.dialogForm.stepprice,
+ eqpcode: this.dialogForm.eqpcode,
+ inbarcode,
+ reckway: this.dialogForm.reckway,
+ usergroupcode: this.dialogForm.usergroupcode,
+ reportuser: this.dialogForm.reportuser.join(','),
+ taskqty: this.dialogForm.planqty,
+ // startqty: this.dialogForm.startqty,
+ // reportqty: this.dialogForm.reportqty,
+
+ startqty: this.dialogForm.startqty,
+ reportqty: this.dialogForm.startqty, // 鎶ュ伐鏁伴噺
+
+ defectlist,
+ remarks: ''
+ }
+ // console.log(JSON.parse(JSON.stringify(this.defectTableData)))
+ // console.log(JSON.parse(JSON.stringify(data)))
+
+ this.$store.state.app.buttonIsDisabled = true
+ const res = await SavaMesOrderStepReport(data)
+ if (res.code === '200') {
+ this.$notify.success('鎶ュ伐鎴愬姛锛�')
+ // await this.search()
+ await this.tabClick()
+ this.$store.state.app.buttonIsDisabled = false
+ this.dialogVisible = false
+
+ // 鑷埗鎶ュ伐鎵撳嵃鏍囩鍙e瓙宸插紑濂�
+ // if (JSON.parse(localStorage.getItem('mesSetting')).every) {
+ // this.dialogVisible2 = true
+ // this.ZZprint2(localStorage.getItem('username'))
+ // }
+ } else {
+ this.$store.state.app.buttonIsDisabled = false
+ this.$notify.error('鎶ュ伐澶辫触锛�')
+ }
+ }
+
+ if (this.activeName === '澶栧崗鍙戞枡') {
+ if (parseFloat(this.dialogForm.fqty) < 1) {
+ return this.$message.info('鍙戞枡鏁伴噺涓嶈兘涓洪浂锛�')
+ }
+ if (parseFloat(this.dialogForm.fqty) > parseFloat(this.dialogForm.noreportqty)) {
+ return this.$message.info('鍙戞枡鏁伴噺涓嶈兘澶т簬鏈彂鏁伴噺!')
+ }
+ const data = {
+ mesordercode: this.dialogForm.wo_code,
+ partcode: this.dialogForm.partnumber,
+ stepseq: this.dialogForm.seq,
+ stepcode: this.dialogForm.stepcode,
+
+ wxcode: this.dialogForm.wxcode,
+ outuser: this.dialogForm.outuser,
+ taskqty: this.dialogForm.planqty,
+ fqty: this.dialogForm.fqty
+ }
+ // console.log(JSON.stringify(data))
+
+ this.$store.state.app.buttonIsDisabled = true
+ const res = await SavaMesOrderStepOut(data)
+ if (res.code === '200') {
+ this.$notify.success('鍙戞枡鎴愬姛锛�')
+ // await this.search()
+ await this.tabClick()
+ this.$store.state.app.buttonIsDisabled = false
+ this.dialogVisible = false
+ } else {
+ this.$store.state.app.buttonIsDisabled = false
+ this.$notify.error('鍙戞枡澶辫触锛�')
+ }
+ }
+
+ if (this.activeName === '澶栧崗鏀舵枡') {
+ if (this.defectTableData.find(i => i.code.length === 0)) {
+ return this.$message.info('缂洪櫡缂栫爜/鍚嶇О涓嶈兘涓虹┖锛�')
+ }
+ if (this.defectTableData.find(i => i.badqty.toString().trim() === '' || parseFloat(i.badqty) === 0)) {
+ return this.$message.info('涓嶈壇鏁伴噺涓嶈兘涓虹┖鎴栦负闆讹紒')
+ }
+
+ if (parseFloat(this.dialogForm.noreportqty) < parseFloat(this.dialogForm.sqty) + parseFloat(this.dialogForm.noputqty)) {
+ return this.$message.info('鏀舵枡鏁伴噺鍔犱笉鑹暟閲忎笉鑳藉ぇ浜庝簡鍙敹鏁伴噺!')
+ }
+
+ if (this.dialogForm.list.find(i => i.Name === this.dialogForm.wxcode)) {
+ if (this.dialogForm.list.find(i => i.Name === this.dialogForm.wxcode).acceptQty < parseFloat(this.dialogForm.sqty) + parseFloat(this.dialogForm.noputqty)) {
+ return this.$message.info('鏀舵枡鏁伴噺鍔犱笉鑹暟閲忎笉鑳藉ぇ浜庤渚涘簲鍟嗗彲鏀舵暟閲�!')
+ }
+ } else {
+ return this.$message.info('姝や緵搴斿晢鏃犲彲鏀舵暟閲�!')
+ }
+
+ let inbarcode = ''
+ if (this.tableData.find(i => i.id === this.radioSelected).isend === 'Y') {
+ const data1 = {
+ rightcode: getCookie('ruleCode'),
+ partcode: this.dialogForm.partnumber,
+ qty: this.dialogForm.startqty,
+ onelabqty: this.dialogForm.startqty
+ }
+
+ const res1 = await LabelBarCode(data1)
+ inbarcode = res1.data[0].labcode
+ }
+ const defectlist = []
+ this.defectTableData.forEach(i => {
+ defectlist.push({
+ defect_code: i.code.join(','),
+ badqty: i.badqty
+ })
+ })
+
+ const data = {
+ mesordercode: this.dialogForm.wo_code,
+ partcode: this.dialogForm.partnumber,
+ stepseq: this.dialogForm.seq,
+ stepcode: this.dialogForm.stepcode,
+
+ wxcode: this.dialogForm.wxcode,
+ inbarcode,
+ inuser: this.dialogForm.inuser,
+ taskqty: this.dialogForm.planqty,
+ sqty: this.dialogForm.sqty,
+ defectlist,
+ remarks: ''
+ }
+ // console.log(JSON.parse(JSON.stringify(data)), 1)
+ this.$store.state.app.buttonIsDisabled = true
+ const res = await SavaMesOrderStepIn(data)
+ if (res.code === '200') {
+ this.$notify.success('鏀舵枡鎴愬姛锛�')
+ // await this.search()
+ await this.tabClick()
+ this.$store.state.app.buttonIsDisabled = false
+ this.dialogVisible = false
+ } else {
+ this.$store.state.app.buttonIsDisabled = false
+ this.$notify.error('鏀舵枡澶辫触锛�')
+ }
+ }
+
+ if (this.activeName === '涓嶈壇寰呭鐞�') {
+ let flag = false
+ this.badTableData.forEach(i => {
+ if (parseFloat(i.repair_qty) + parseFloat(i.laborbad_qty) + parseFloat(i.materielbad_qty) > parseFloat(i.ng_qty)) {
+ flag = true
+ }
+ })
+ if (flag) {
+ return this.$message.info('缁翠慨鍚堟牸鏁伴噺+宸ュ簾鏁伴噺+鏂欏簾鏁伴噺涓嶈兘澶т簬涓嶈壇鏁伴噺锛�')
+ }
+ this.$store.state.app.buttonIsDisabled = true
+ const res = await EditOrderNgStepSeave({ Data: this.badTableData })
+ if (res.code === '200') {
+ this.$notify.success('鎻愪氦鎴愬姛锛�')
+ // await this.search()
+ await this.tabClick()
+ this.$store.state.app.buttonIsDisabled = false
+ this.dialogVisible = false
+ } else {
+ this.$store.state.app.buttonIsDisabled = false
+ this.$notify.error('鎻愪氦澶辫触锛�')
+ }
+ }
+ }
+ })
+ },
+
+ dialogVisible2Close() {
+ this.qrForm.qrvalue = ''
+ this.qrForm.startqty = ''
+ this.qrForm.wo_code = ''
+ this.qrForm.partcode = ''
+ this.qrForm.partname = ''
+ this.qrForm.partspec = ''
+ this.qrForm.nextstepname = ''
+ this.qrForm.operator = ''
+ this.qrForm.operatorTime = ''
+ // this.$refs.qrCodeDiv2 = ''
+ },
+
+ ZZprint2(username) {
+ if (this.dialogForm.nextstepcode !== '') {
+ this.qrForm.qrvalue = this.dialogForm.wo_code + ';' + this.dialogForm.nextstepcode
+ } else {
+ this.qrForm.qrvalue = this.dialogForm.inbarcode
+ }
+
+ this.qrForm.startqty = this.dialogForm.startqty
+ this.qrForm.wo_code = this.dialogForm.wo_code
+ this.qrForm.partcode = this.dialogForm.partnumber
+ this.qrForm.partname = this.dialogForm.partname
+ this.qrForm.nextstepname = this.dialogForm.nextstepname
+ this.qrForm.operator = username
+ this.qrForm.operatorTime = handleDatetime2(new Date())
+ this.$nextTick(() => {
+ this.bindQRCode(this.qrForm.qrvalue)
+ })
+ },
+ // 鐢熸垚浜岀淮鐮�
+ bindQRCode(text) {
+ new QRCode(this.$refs.qrCodeDiv2, {
+ text: text,
+ // width: 50,
+ width: 60,
+ // height: 50,
+ height: 60,
+ colorDark: '#000', // 浜岀淮鐮侀鑹�
+ colorLight: '#ffffff', // 浜岀淮鐮佽儗鏅壊
+ correctLevel: QRCode.CorrectLevel.L// 瀹归敊鐜囷紝L/M/H
+ })
+ },
+ // 缂洪櫡鏂板
+ addDefect() {
+ if (this.defectTableData.find(i => i.code.length === 0)) {
+ return this.$message.info('缂洪櫡缂栫爜/鍚嶇О涓嶈兘涓虹┖锛�')
+ }
+ if (this.defectTableData.find(i => i.badqty.toString().trim() === '' || parseFloat(i.badqty) === 0)) {
+ return this.$message.info('涓嶈壇鏁伴噺涓嶈兘涓虹┖鎴栦负闆讹紒')
+ }
+
+ this.defectTableData.push({
+ uuid: nanoid(), code: [], badqty: ''
+ })
+ },
+ // 缂洪櫡鍒犻櫎
+ defectDel(row) {
+ this.defectTableData = this.defectTableData.filter(i => i.uuid !== row.uuid)
+
+ this.dialogForm.noputqty = 0
+ this.defectTableData.forEach(i => {
+ this.dialogForm.noputqty += parseFloat(i.badqty)
+ })
+ },
+ badqtyChange(val) {
+ this.dialogForm.noputqty = 0
+ this.defectTableData.forEach(i => {
+ this.dialogForm.noputqty += parseFloat(i.badqty)
+ })
+ },
+ reckwayChange(val) {
+ // console.log(val)
+ this.dialogForm.usergroupcode = ''
+ this.dialogForm.reportuser = []
+ },
+ async usergroupChange(val) {
+ const { data: res } = await GroupsPersonPermissions({ groupcode: val })
+ this.dialogForm.reportuser = res[0].usercode_list ? res[0].usercode_list.split(',') : []
+ },
+ rowClick(row, event, column) {
+ this.radioSelected = row.id
+ },
+ // 鑾峰彇椤甸潰楂樺害
+ getHeight() {
+ this.$nextTick(() => {
+ this.mainHeight = window.innerHeight - 85
+ this.tableHeight = this.mainHeight - 275
+ // this.$refs.tableDataRef.doLayout()
+ })
+ },
+ reset() {
+ this.form.wkshopcode = ''
+ this.form.wocode = ''
+ this.form.workOrderCurrentValue = ''
+ this.form.partcode = ''
+ this.form.partname = ''
+ this.form.partspec = ''
+ this.search()
+ },
+
+ headerCellStyle() {
+ return this.$headerCellStyle
+ },
+ cellStyle() {
+ return this.$cellStyle
+ }
+ }
+}
+</script>
+<style lang="scss" scoped>
+
+::v-deep .elTableDiv .el-radio__label {
+ display: none !important;
+}
+
+.dialogFormItem {
+ margin: 0 10px 0 0;
+}
+
+.dialogFormItemDiv {
+ width: 200px;
+}
+
+::v-deep .el-select__caret {
+ display: flex;
+ align-items: center;
+ justify-content: center;
+}
+
+::v-deep .el-dialog .el-form-item__label {
+ font-weight: lighter !important;
+}
+
+::v-deep .el-dialog .el-divider__text {
+ font-weight: bolder !important;
+}
+
+</style>
--
Gitblit v1.9.3