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