2024-04-11 17:58:11 +08:00
|
|
|
|
<template>
|
|
|
|
|
|
<div class="app-container">
|
|
|
|
|
|
<!--工具栏-->
|
|
|
|
|
|
<div class="head-container">
|
2024-04-12 16:03:31 +08:00
|
|
|
|
|
|
|
|
|
|
<el-form ref="form4" :inline="true" :model="form4">
|
|
|
|
|
|
|
|
|
|
|
|
<el-form-item label="送货单ID">
|
|
|
|
|
|
<el-input v-model="query.deliveryHeaderId" clearable placeholder="请输入送货单ID" style="width: 170px;"
|
|
|
|
|
|
class="filter-item"
|
|
|
|
|
|
@keyup.enter.native="crud.toQuery"/>
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
|
|
|
|
|
|
<el-form-item label="Mo票">
|
|
|
|
|
|
<el-input v-model="query.labelNo" clearable placeholder="请输入Mo票" style="width: 170px;"
|
|
|
|
|
|
class="filter-item"
|
|
|
|
|
|
@keyup.enter.native="crud.toQuery"/>
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
|
|
|
|
|
|
<el-form-item label="物料编号">
|
|
|
|
|
|
<el-input v-model="query.itemCode" clearable placeholder="请输入物料编号" style="width: 170px;"
|
|
|
|
|
|
class="filter-item"
|
|
|
|
|
|
@keyup.enter.native="crud.toQuery"/>
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
|
|
|
|
|
|
<label class="el-form-item-label">接收日期</label>
|
|
|
|
|
|
<date-range-picker v-model="query.createTime" class="date-item" style="width: 100px"/>
|
|
|
|
|
|
|
|
|
|
|
|
<rrOperation :crud="crud"/>
|
|
|
|
|
|
<el-button class="filter-item" size="mini" type="warning" icon="el-icon-refresh-left" @click="resetQuery">重置
|
|
|
|
|
|
</el-button>
|
|
|
|
|
|
</el-form>
|
|
|
|
|
|
|
|
|
|
|
|
<div class="statusButton" style="border-bottom: solid lightgray 1px;">
|
|
|
|
|
|
<el-radio-group v-model="radio3" @change="clickChange" size="small">
|
|
|
|
|
|
<el-radio-button label="全部"> 全部</el-radio-button>
|
|
|
|
|
|
<el-radio-button label="PRINTED"> PRINTED</el-radio-button>
|
|
|
|
|
|
<el-radio-button label="STOCKIN"> STOCKIN</el-radio-button>
|
|
|
|
|
|
<el-radio-button label="其他"> 其他状态</el-radio-button>
|
|
|
|
|
|
</el-radio-group>
|
|
|
|
|
|
</div>
|
2024-04-11 17:58:11 +08:00
|
|
|
|
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
|
|
|
|
|
<crudOperation :permission="permission" :tableKey="this.$options.name"/>
|
|
|
|
|
|
<!--表单组件-->
|
2024-04-12 16:03:31 +08:00
|
|
|
|
<el-dialog :close-on-click-modal="false" :before-close="crud.cancelCU" :visible.sync="crud.status.cu > 0"
|
|
|
|
|
|
:title="crud.status.title" width="500px">
|
2024-04-11 17:58:11 +08:00
|
|
|
|
<el-form ref="form" :model="form" :rules="rules" size="small" label-width="80px">
|
2024-04-12 16:03:31 +08:00
|
|
|
|
|
2024-04-11 17:58:11 +08:00
|
|
|
|
</el-form>
|
|
|
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
|
|
|
<el-button type="text" @click="crud.cancelCU">取消</el-button>
|
|
|
|
|
|
<el-button :loading="crud.status.cu === 2" type="primary" @click="crud.submitCU">确认</el-button>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</el-dialog>
|
2024-04-12 16:03:31 +08:00
|
|
|
|
|
|
|
|
|
|
|
2024-04-11 17:58:11 +08:00
|
|
|
|
<!--表格渲染-->
|
2024-04-12 16:03:31 +08:00
|
|
|
|
<el-table ref="table" show-summary height="400" v-loading="crud.loading" :data="crud.data" size="small"
|
|
|
|
|
|
style="width: 100%;"
|
|
|
|
|
|
@selection-change="crud.selectionChangeHandler"
|
|
|
|
|
|
:summary-method="getSummaries"
|
|
|
|
|
|
>
|
|
|
|
|
|
<el-table-column type="selection" width="55"/>
|
|
|
|
|
|
<el-table-column prop="index" align="center" label="序号" :resizable="false" type="index" width="50"/>
|
|
|
|
|
|
<el-table-column prop="deliveryHeaderId" label="送货单头ID" align="center" width="100"/>
|
|
|
|
|
|
<el-table-column prop="labelNo" label="MO票" align="center" width="150"/>
|
|
|
|
|
|
<el-table-column prop="itemCode" label="物料编码" align="center" width="150" :show-overflow-tooltip="true">
|
2024-04-11 17:58:11 +08:00
|
|
|
|
<template slot-scope="scope">
|
2024-04-12 16:03:31 +08:00
|
|
|
|
<div>{{ scope.row.item.code }}</div>
|
2024-04-11 17:58:11 +08:00
|
|
|
|
</template>
|
|
|
|
|
|
</el-table-column>
|
2024-04-12 16:03:31 +08:00
|
|
|
|
<el-table-column prop="itemName" label="物料描述" align="center" width="200" :show-overflow-tooltip="true">
|
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
|
<div>{{ scope.row.item.name }}</div>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
</el-table-column>
|
|
|
|
|
|
<el-table-column prop="qty" label="可用数量" align="center" width="100"/>
|
|
|
|
|
|
<el-table-column prop="labelType" label="标签类型" align="center" width="100"/>
|
|
|
|
|
|
<el-table-column prop="deleteFlag" label="是否有效" align="center" width="100"/>
|
|
|
|
|
|
<el-table-column prop="labelState" label="标签状态" align="center" width="100"/>
|
|
|
|
|
|
<el-table-column prop="checkResult" label="检验状态" align="center" width="100"/>
|
|
|
|
|
|
<el-table-column prop="invCode" label="mls子库" align="center" width="100"/>
|
|
|
|
|
|
|
|
|
|
|
|
<!-- <el-table-column prop="workOrderName" label="工单名称"/>
|
|
|
|
|
|
<el-table-column prop="workOrderId" label="工单Id"/>
|
|
|
|
|
|
<el-table-column prop="selfWorkOrderId" label="自制件工单id"/>
|
|
|
|
|
|
<el-table-column prop="selfWorkOrderName" label="自制件工单编号"/>
|
|
|
|
|
|
-->
|
2024-04-19 10:23:45 +08:00
|
|
|
|
<el-table-column prop="datetimeStockIn" label="mls入库时间" align="center" width="140"/>
|
|
|
|
|
|
<el-table-column prop="mlsUpdateTime" label="mls修改时间" align="center" width="140"/>
|
|
|
|
|
|
<el-table-column prop="mlsCreateTime" label="mls创建时间" align="center" width="140"/>
|
2024-04-12 16:03:31 +08:00
|
|
|
|
<el-table-column prop="createTime" label="wms接收时间" align="center" width="140"/>
|
|
|
|
|
|
<el-table-column prop="updateTime" label="wms修改时间" align="center" width="140"/>
|
|
|
|
|
|
<!-- <el-table-column v-if="checkPer(['admin','mo:edit','mo:del'])" label="操作" width="150px" align="center">
|
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
|
<udOperation
|
|
|
|
|
|
:data="scope.row"
|
|
|
|
|
|
:permission="permission"
|
|
|
|
|
|
/>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
</el-table-column>-->
|
2024-04-11 17:58:11 +08:00
|
|
|
|
</el-table>
|
|
|
|
|
|
<!--分页组件-->
|
2024-04-12 16:03:31 +08:00
|
|
|
|
<div style="float:right">
|
|
|
|
|
|
<pagination/>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
2024-04-11 17:58:11 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
|
import crudMo from '@/api/mo'
|
2024-04-12 16:03:31 +08:00
|
|
|
|
import CRUD, {presenter, header, form, crud} from '@crud/crud'
|
2024-04-11 17:58:11 +08:00
|
|
|
|
import rrOperation from '@crud/RR.operation'
|
|
|
|
|
|
import crudOperation from '@crud/CRUD.operation'
|
|
|
|
|
|
import udOperation from '@crud/UD.operation'
|
|
|
|
|
|
import pagination from '@crud/Pagination'
|
2024-04-12 16:03:31 +08:00
|
|
|
|
import DateRangePicker from "@/components/DateRangePicker/index.vue";
|
2024-04-11 17:58:11 +08:00
|
|
|
|
|
2024-04-12 16:03:31 +08:00
|
|
|
|
const defaultForm = {
|
|
|
|
|
|
id: null,
|
|
|
|
|
|
}
|
2024-04-11 17:58:11 +08:00
|
|
|
|
export default {
|
|
|
|
|
|
name: 'Mo',
|
2024-04-12 16:03:31 +08:00
|
|
|
|
components: {DateRangePicker, pagination, crudOperation, rrOperation, udOperation},
|
2024-04-11 17:58:11 +08:00
|
|
|
|
mixins: [presenter(), header(), form(defaultForm), crud()],
|
|
|
|
|
|
cruds() {
|
2024-04-12 16:03:31 +08:00
|
|
|
|
return CRUD({
|
|
|
|
|
|
title: 'Mo票管理',
|
|
|
|
|
|
url: 'api/mo',
|
|
|
|
|
|
idField: 'id',
|
2024-04-16 17:51:19 +08:00
|
|
|
|
sort: 'labelNo,desc',
|
2024-04-12 16:03:31 +08:00
|
|
|
|
crudMethod: {...crudMo},
|
|
|
|
|
|
optShow: {
|
|
|
|
|
|
add: false,
|
|
|
|
|
|
edit: false,
|
|
|
|
|
|
del: false,
|
|
|
|
|
|
reset: false,
|
|
|
|
|
|
download: true
|
|
|
|
|
|
}
|
|
|
|
|
|
})
|
|
|
|
|
|
|
2024-04-11 17:58:11 +08:00
|
|
|
|
},
|
|
|
|
|
|
data() {
|
|
|
|
|
|
return {
|
2024-04-12 16:03:31 +08:00
|
|
|
|
form4: {},
|
|
|
|
|
|
radio3: '全部',
|
2024-04-11 17:58:11 +08:00
|
|
|
|
permission: {
|
|
|
|
|
|
add: ['admin', 'mo:add'],
|
|
|
|
|
|
edit: ['admin', 'mo:edit'],
|
|
|
|
|
|
del: ['admin', 'mo:del']
|
|
|
|
|
|
},
|
2024-04-12 16:03:31 +08:00
|
|
|
|
rules: {}
|
|
|
|
|
|
}
|
2024-04-11 17:58:11 +08:00
|
|
|
|
},
|
|
|
|
|
|
methods: {
|
|
|
|
|
|
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
|
|
|
|
|
[CRUD.HOOK.beforeRefresh]() {
|
|
|
|
|
|
return true
|
2024-04-12 16:03:31 +08:00
|
|
|
|
},
|
|
|
|
|
|
clickChange(lab) {
|
|
|
|
|
|
if (lab === "全部") {
|
|
|
|
|
|
this.crud.resetQuery();
|
|
|
|
|
|
this.crud.toQuery();
|
|
|
|
|
|
} else if (lab === "PRINTED") {
|
|
|
|
|
|
this.query.labelState = 'PRINTED'
|
|
|
|
|
|
this.crud.toQuery();
|
|
|
|
|
|
}else if (lab === "STOCKIN") {
|
|
|
|
|
|
this.query.labelState = 'STOCKIN'
|
|
|
|
|
|
this.crud.toQuery();
|
|
|
|
|
|
}else {
|
|
|
|
|
|
this.query.labelState = '-'
|
|
|
|
|
|
this.crud.toQuery();
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
resetQuery() {
|
|
|
|
|
|
this.radio3 = '全部';
|
|
|
|
|
|
this.crud.resetQuery()
|
|
|
|
|
|
},
|
|
|
|
|
|
//合计
|
|
|
|
|
|
getSummaries(param) {
|
|
|
|
|
|
const {columns, data} = param;
|
|
|
|
|
|
const sums = [];
|
|
|
|
|
|
columns.forEach((column, index) => {
|
|
|
|
|
|
if (index === 0) {
|
|
|
|
|
|
sums[index] = '合计';
|
|
|
|
|
|
return;
|
|
|
|
|
|
} else if (column.property === 'qty') {
|
|
|
|
|
|
const values = data.map(item => Number(item[column.property]));
|
|
|
|
|
|
if (!values.every(value => isNaN(value))) {
|
|
|
|
|
|
sums[index] = values.reduce((prev, curr) => {
|
|
|
|
|
|
const value = Number(curr);
|
|
|
|
|
|
if (!isNaN(value)) {
|
|
|
|
|
|
return prev + curr;
|
|
|
|
|
|
} else {
|
|
|
|
|
|
return prev;
|
|
|
|
|
|
}
|
|
|
|
|
|
}, 0);
|
|
|
|
|
|
sums[index];
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
return sums;
|
2024-04-11 17:58:11 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
<style scoped>
|
|
|
|
|
|
|
|
|
|
|
|
</style>
|