Merge remote-tracking branch 'origin/0.8.X' into 0.8.X
This commit is contained in:
51
klp-ui/src/api/wms/express.js
Normal file
51
klp-ui/src/api/wms/express.js
Normal file
@@ -0,0 +1,51 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询物流预览列表
|
||||
export function listExpress(query) {
|
||||
return request({
|
||||
url: '/wms/express/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询物流预览详细
|
||||
export function getExpress(expressId) {
|
||||
return request({
|
||||
url: '/wms/express/' + expressId,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
// 查询物流预览详细
|
||||
export function refreshExpress(expressId) {
|
||||
return request({
|
||||
url: '/wms/express/refresh/' + expressId,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增物流预览
|
||||
export function addExpress(data) {
|
||||
return request({
|
||||
url: '/wms/express',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改物流预览
|
||||
export function updateExpress(data) {
|
||||
return request({
|
||||
url: '/wms/express',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除物流预览
|
||||
export function delExpress(expressId) {
|
||||
return request({
|
||||
url: '/wms/express/' + expressId,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
44
klp-ui/src/api/wms/expressQuestion.js
Normal file
44
klp-ui/src/api/wms/expressQuestion.js
Normal file
@@ -0,0 +1,44 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询快递问题列表
|
||||
export function listExpressQuestion(query) {
|
||||
return request({
|
||||
url: '/wms/expressQuestion/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询快递问题详细
|
||||
export function getExpressQuestion(questionId) {
|
||||
return request({
|
||||
url: '/wms/expressQuestion/' + questionId,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增快递问题
|
||||
export function addExpressQuestion(data) {
|
||||
return request({
|
||||
url: '/wms/expressQuestion',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改快递问题
|
||||
export function updateExpressQuestion(data) {
|
||||
return request({
|
||||
url: '/wms/expressQuestion',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除快递问题
|
||||
export function delExpressQuestion(questionId) {
|
||||
return request({
|
||||
url: '/wms/expressQuestion/' + questionId,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
52
klp-ui/src/api/wms/reportDetail.js
Normal file
52
klp-ui/src/api/wms/reportDetail.js
Normal file
@@ -0,0 +1,52 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询设计项目汇报详情列表
|
||||
export async function listReportDetail(query) {
|
||||
return request({
|
||||
url: '/wms/reportDetail/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询设计项目汇报详情详细
|
||||
export function getReportDetail(id) {
|
||||
return request({
|
||||
url: '/wms/reportDetail/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增设计项目汇报详情
|
||||
export function addReportDetail(data) {
|
||||
return request({
|
||||
url: '/wms/reportDetail',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改设计项目汇报详情
|
||||
export function updateReportDetail(data) {
|
||||
return request({
|
||||
url: '/wms/reportDetail',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除设计项目汇报详情
|
||||
export function delReportDetail(id) {
|
||||
return request({
|
||||
url: '/wms/reportDetail/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
export function listReportDetailByProjectId(projectId) {
|
||||
return request({
|
||||
url: '/wms/reportDetail/project/' + projectId,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
44
klp-ui/src/api/wms/reportSummary.js
Normal file
44
klp-ui/src/api/wms/reportSummary.js
Normal file
@@ -0,0 +1,44 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询设计项目汇报概述列表
|
||||
export async function listReportSummary(query) {
|
||||
return request({
|
||||
url: '/wms/reportSummary/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询设计项目汇报概述详细
|
||||
export function getReportSummary(id) {
|
||||
return request({
|
||||
url: '/wms/reportSummary/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增设计项目汇报概述
|
||||
export function addReportSummary(data) {
|
||||
return request({
|
||||
url: '/wms/reportSummary',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改设计项目汇报概述
|
||||
export function updateReportSummary(data) {
|
||||
return request({
|
||||
url: '/wms/reportSummary',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除设计项目汇报概述
|
||||
export function delReportSummary(id) {
|
||||
return request({
|
||||
url: '/wms/reportSummary/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
@@ -48,7 +48,7 @@
|
||||
},
|
||||
_itemId: {
|
||||
get() {
|
||||
return this.itemId;
|
||||
return this.itemId.toString();
|
||||
},
|
||||
set(val) {
|
||||
this.$emit('update:itemId', val);
|
||||
|
||||
@@ -63,9 +63,9 @@ export default {
|
||||
let bomId = this.bomId;
|
||||
if (!bomId) {
|
||||
if (this.itemType === 'product') {
|
||||
bomId = this.productMap[this.itemId].bomId;
|
||||
bomId = this.productMap[this.itemId]?.bomId;
|
||||
} else if (this.itemType === 'raw_material') {
|
||||
bomId = this.rawMaterialMap[this.itemId].bomId;
|
||||
bomId = this.rawMaterialMap[this.itemId]?.bomId;
|
||||
}
|
||||
}
|
||||
if (!bomId) {
|
||||
|
||||
@@ -63,12 +63,13 @@ export default {
|
||||
let bomId = this.bomId;
|
||||
if (!bomId) {
|
||||
if (this.itemType === 'product') {
|
||||
bomId = this.productMap[this.itemId].bomId;
|
||||
bomId = this.productMap[this.itemId]?.bomId;
|
||||
} else if (this.itemType === 'raw_material') {
|
||||
bomId = this.rawMaterialMap[this.itemId].bomId;
|
||||
bomId = this.rawMaterialMap[this.itemId]?.bomId;
|
||||
}
|
||||
}
|
||||
if (!bomId) {
|
||||
this.bomInfo = [];
|
||||
return;
|
||||
}
|
||||
if (bomMap[bomId]) {
|
||||
|
||||
@@ -62,9 +62,9 @@ export default {
|
||||
watch: {
|
||||
productId: {
|
||||
handler(newVal) {
|
||||
this.product = this.productMap && this.productMap[this.productId]
|
||||
? { ...this.productMap[this.productId] }
|
||||
: {};
|
||||
const res = this.productMap[this.productId] ? this.productMap[this.productId] : {};
|
||||
console.log(res)
|
||||
this.product = res;
|
||||
},
|
||||
immediate: true
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<!-- 作用域插槽 -->
|
||||
<span class="material-name" @click="showDetail = true">
|
||||
<slot name="default" :material="material">
|
||||
{{ material.rawMaterialName ? material.rawMaterialName : '--' }}
|
||||
{{ material.rawMaterialName ? material.rawMaterialName : '-' }}
|
||||
</slot>
|
||||
</span>
|
||||
<el-dialog :visible="showDetail" @close="showDetail = false" :title="material.rawMaterialName" width="600px"
|
||||
@@ -47,7 +47,8 @@ export default {
|
||||
watch: {
|
||||
materialId: {
|
||||
handler: function (newVal) {
|
||||
const res = this.materialMap ? this.materialMap[this.materialId] : {};
|
||||
const res = this.materialMap[this.materialId] ? this.materialMap[this.materialId] : {};
|
||||
console.log(res)
|
||||
this.material = res;
|
||||
},
|
||||
immediate: true
|
||||
|
||||
@@ -27,4 +27,11 @@ export const EPurchaseDetailStatus = {
|
||||
export const ITEM_TYPE = {
|
||||
RAW_MATERIAL: 'raw_material', // 原材料
|
||||
PRODUCT: 'product' // 产品
|
||||
};
|
||||
};
|
||||
|
||||
export const EExpressType = {
|
||||
SF: "SF",
|
||||
ZTO: "ZTO",
|
||||
BEST: "Best",
|
||||
STO: "STO",
|
||||
}
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
<template>
|
||||
<span>
|
||||
<el-tag v-if="status === 2" type="success">已完成</el-tag>
|
||||
<el-tag v-else-if="status === 3" type="danger">异常</el-tag>
|
||||
<template v-else>
|
||||
<el-tag v-if="isTimeout" type="danger">超时</el-tag>
|
||||
<el-tag v-else type="info">剩余{{ remainDays }}天</el-tag>
|
||||
</template>
|
||||
</span>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'ExpressRemainTime',
|
||||
props: {
|
||||
planDate: {
|
||||
type: [String, Date],
|
||||
required: false
|
||||
},
|
||||
status: {
|
||||
type: Number,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
remainDays() {
|
||||
if (!this.planDate) return '-';
|
||||
const now = new Date();
|
||||
const plan = new Date(this.planDate);
|
||||
const diff = plan.getTime() - now.getTime();
|
||||
return Math.ceil(diff / (1000 * 60 * 60 * 24));
|
||||
},
|
||||
isTimeout() {
|
||||
if (!this.planDate) return false;
|
||||
const now = new Date();
|
||||
const plan = new Date(this.planDate);
|
||||
return now.getTime() > plan.getTime();
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,95 @@
|
||||
<template>
|
||||
<div>
|
||||
<span v-if="!isCustomExpress" style="color: #606266;">
|
||||
<span>{{ lastUpdateTime || '-' }}</span>
|
||||
<el-tooltip v-if="lastStatus" :content="lastStatus" placement="top">
|
||||
<span class="ellipsis" style="max-width: 200px; display: inline-block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle; font-size: 13px;">
|
||||
{{ lastStatus }}
|
||||
</span>
|
||||
</el-tooltip>
|
||||
<span v-else style="font-size: 13px;">未发货或无法获取</span>
|
||||
</span>
|
||||
<span v-else>
|
||||
<span @click="openDialog" style="cursor:pointer;color:#409EFF;text-decoration:underline;">
|
||||
{{ lastUpdateTime || '点击填写' }}
|
||||
</span>
|
||||
<span @click="openDialog" style="cursor:pointer;color:#409EFF;text-decoration:underline;">
|
||||
{{ lastStatus || '点击填写' }}
|
||||
</span>
|
||||
</span>
|
||||
<el-dialog title="手动填写物流状态" :visible.sync="dialogVisible" width="400px" append-to-body>
|
||||
<el-form :model="form" label-width="100px">
|
||||
<el-form-item label="物流状态">
|
||||
<el-input v-model="form.lastStatus" placeholder="请输入物流状态" />
|
||||
</el-form-item>
|
||||
<el-form-item label="更新时间">
|
||||
<el-date-picker v-model="form.lastUpdateTime" type="datetime" value-format="yyyy-MM-dd HH:mm:ss" placeholder="请选择更新时间" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="handleSave">确 定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { EExpressType } from '@/utils/enums';
|
||||
export default {
|
||||
name: 'ExpressStatusEditor',
|
||||
props: {
|
||||
lastStatus: String,
|
||||
lastUpdateTime: String,
|
||||
expressType: String
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
form: {
|
||||
lastStatus: '',
|
||||
lastUpdateTime: ''
|
||||
},
|
||||
EExpressType
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
isCustomExpress() {
|
||||
console.log(this.EExpressType);
|
||||
if (!this.EExpressType || typeof this.EExpressType !== 'object') {
|
||||
return true;
|
||||
}
|
||||
const expressTypeList = Object.values(this.EExpressType);
|
||||
return !expressTypeList.includes(this.expressType);
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
openDialog() {
|
||||
this.form.lastStatus = this.lastStatus || '';
|
||||
this.form.lastUpdateTime = this.lastUpdateTime || '';
|
||||
this.dialogVisible = true;
|
||||
},
|
||||
handleSave() {
|
||||
if (!this.form.lastStatus || !this.form.lastUpdateTime) {
|
||||
this.$message.error('请填写完整物流状态和更新时间');
|
||||
return;
|
||||
}
|
||||
this.$emit('update:lastStatus', this.form.lastStatus);
|
||||
this.$emit('update:lastUpdateTime', this.form.lastUpdateTime);
|
||||
this.$emit('save', {
|
||||
lastStatus: this.form.lastStatus,
|
||||
lastUpdateTime: this.form.lastUpdateTime
|
||||
});
|
||||
this.dialogVisible = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.ellipsis {
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
</style>
|
||||
770
klp-ui/src/views/wms/express/index.vue
Normal file
770
klp-ui/src/views/wms/express/index.vue
Normal file
@@ -0,0 +1,770 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="96px">
|
||||
<el-form-item label="物流编号" prop="expressCode">
|
||||
<el-input
|
||||
v-model="queryParams.expressCode"
|
||||
placeholder="请输入物流编号"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="对方姓名" prop="supplyName">
|
||||
<el-input
|
||||
v-model="queryParams.supplyName"
|
||||
placeholder="请输入对方姓名"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="对方手机" prop="supplyPhone">
|
||||
<el-input
|
||||
v-model="queryParams.supplyPhone"
|
||||
placeholder="请输入对方联系方式"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="负责人手机号" prop="ownerPhone">
|
||||
<el-input
|
||||
v-model="queryParams.ownerPhone"
|
||||
placeholder="请输入负责人手机号"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="计划到货时间" prop="planDate">
|
||||
<el-date-picker clearable
|
||||
v-model="queryParams.planDate"
|
||||
type="date"
|
||||
value-format="yyyy-MM-dd"
|
||||
placeholder="请选择计划到货时间">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="项目" prop="projectId">
|
||||
<!-- <el-select v-model="queryParams.projectId" placeholder="请选择项目" filterable>
|
||||
<el-option
|
||||
v-for="item in allProject"
|
||||
:key="item.projectId"
|
||||
:label="item.projectName"
|
||||
:value="item.projectId"
|
||||
></el-option>
|
||||
</el-select>-->
|
||||
|
||||
</el-form-item>
|
||||
<el-form-item label="物流公司" prop="expressType">
|
||||
<el-select v-model="queryParams.expressType" placeholder="请选择物流公司标识" clearable>
|
||||
<el-option
|
||||
v-for="dict in dict.type.oa_express_type"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
|
||||
<el-button
|
||||
type="waning"
|
||||
plain
|
||||
size="mini"
|
||||
icon="el-icon-refresh"
|
||||
@click="handleRefresh"
|
||||
>批量更新状态
|
||||
</el-button>
|
||||
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="handleAdd"
|
||||
>新增
|
||||
</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
icon="el-icon-edit"
|
||||
size="mini"
|
||||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
>修改
|
||||
</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="el-icon-delete"
|
||||
size="mini"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
>删除
|
||||
</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
@click="handleExport"
|
||||
>导出
|
||||
</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="expressList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center"/>
|
||||
<el-table-column label="物流编号" align="center" prop="expressCode"/>
|
||||
<el-table-column label="数据状态" align="center" prop="status">
|
||||
<template slot-scope="scope">
|
||||
<el-tag v-if="scope.row.status===0" type="warning">未确认</el-tag>
|
||||
<el-tag v-if="scope.row.status===1" type="primary">进行中</el-tag>
|
||||
<el-tag v-if="scope.row.status===2" type="success">已完成</el-tag>
|
||||
<el-tag v-if="scope.row.status===3" type="danger">异常</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="物流状态" align="center" prop="status" width="200">
|
||||
<template slot-scope="scope">
|
||||
<ExpressStatusEditor
|
||||
:lastStatus.sync="scope.row.lastStatus"
|
||||
:lastUpdateTime.sync="scope.row.lastUpdateTime"
|
||||
:expressType="scope.row.expressType"
|
||||
@save="val => handleStatusSave(scope.row, val)"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="剩余时间" align="center" width="120">
|
||||
<template slot-scope="scope">
|
||||
<ExpressRemainTime :planDate="scope.row.planDate" :status="scope.row.status" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="对方姓名" align="center" prop="supplyName"/>
|
||||
<el-table-column label="负责人" align="center" prop="ownerName"/>
|
||||
<el-table-column label="负责人手机" align="center" prop="ownerPhone"/>
|
||||
<el-table-column label="计划到货时间" align="center" prop="planDate" width="180">
|
||||
<template slot-scope="scope">
|
||||
<span>{{parseTime(scope.row.planDate,'{y}-{m}-{d}')}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="更新时间" align="center" prop="planDate" width="180">
|
||||
<template slot-scope="scope">
|
||||
<span>{{scope.row.updateTime}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="物流公司标识" align="center" prop="expressType">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.oa_express_type" :value="scope.row.expressType"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="备注" align="center" prop="remark"/>
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-check"
|
||||
v-if="scope.row.status===0"
|
||||
@click="handleUpdateStatus(scope.row,1)"
|
||||
>确认
|
||||
</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-check"
|
||||
v-if="scope.row.status===1"
|
||||
@click="handleUpdateStatus(scope.row,2)"
|
||||
>完成
|
||||
</el-button>
|
||||
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-refresh"
|
||||
v-if="scope.row.status===1"
|
||||
@click="handleRefresh(scope.row)"
|
||||
>同步物流状态
|
||||
</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-close"
|
||||
v-if="scope.row.status!==2 && scope.row.status!==3"
|
||||
@click="handleUpdateStatus(scope.row,3)"
|
||||
>异常
|
||||
</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="handleDetail(scope.row)"
|
||||
>详情
|
||||
</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
v-if="scope.row.status!==2"
|
||||
@click="handleUpdate(scope.row)"
|
||||
>修改
|
||||
</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
>删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<!-- 添加或修改物流预览对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
|
||||
<el-form-item label="物流编号" prop="expressCode">
|
||||
<el-input v-model="form.expressCode" placeholder="请输入物流编号"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="对方姓名" prop="supplyName">
|
||||
<el-input v-model="form.supplyName" placeholder="请输入发货方姓名"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="对方联系方式" prop="supplyPhone">
|
||||
<el-input v-model="form.supplyPhone" placeholder="请输入发货方联系方式"/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="负责人" prop="ownerId">
|
||||
<user-select v-model="form.ownerId"></user-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="负责人手机号" prop="ownerPhone">
|
||||
<el-input v-model="form.ownerPhone" placeholder="请输入负责人手机号"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="计划到货时间" prop="planDate">
|
||||
<el-date-picker clearable
|
||||
v-model="form.planDate"
|
||||
type="datetime"
|
||||
value-format="yyyy-MM-dd HH:mm:ss"
|
||||
placeholder="请选择计划到货时间">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="物流公司标识" prop="expressType">
|
||||
<el-select v-model="form.expressType" placeholder="请选择物流公司标识">
|
||||
<el-option
|
||||
v-for="dict in dict.type.oa_express_type"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<!-- <el-form-item label="关联项目" prop="projectId">
|
||||
<el-select v-model="form.projectId" filterable placeholder="请选择项目" @change="getReportSummary">
|
||||
<el-option
|
||||
v-for="item in allProject"
|
||||
:key="item.projectId"
|
||||
:label="item.projectName"
|
||||
:value="item.projectId"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>-->
|
||||
|
||||
<el-form-item label="发货记录" prop="detailId">
|
||||
<el-select v-model="form.detailId" placeholder="请选择发货记录">
|
||||
<el-option
|
||||
v-for="item in reportDetailList"
|
||||
:key="item.detailId"
|
||||
:label="item.reportDetail"
|
||||
:value="item.detailId"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容"/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
<!-- 物流详情弹窗 -->
|
||||
<el-dialog
|
||||
title="物流详情"
|
||||
:visible.sync="detailOpen"
|
||||
width="600px"
|
||||
append-to-body
|
||||
>
|
||||
<el-descriptions :column="2" border>
|
||||
<el-descriptions-item label="物流编号">{{ expressDetail.expressCode || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="数据状态">
|
||||
<el-tag v-if="expressDetail.status===0" type="warning">未确认</el-tag>
|
||||
<el-tag v-else-if="expressDetail.status===1" type="primary">进行中</el-tag>
|
||||
<el-tag v-else-if="expressDetail.status===2" type="success">已完成</el-tag>
|
||||
<el-tag v-else-if="expressDetail.status===3" type="error">异常</el-tag>
|
||||
<span v-else>-</span>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="对方姓名">{{ expressDetail.supplyName || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="对方手机号">{{ expressDetail.supplyPhone || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="负责人">{{ expressDetail.ownerName || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="负责人手机">{{ expressDetail.ownerPhone || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="项目名">{{ expressDetail.projectName || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="细节描述">{{ expressDetail.detailName || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="当前物流状态">{{ expressDetail.lastStatus || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="物流更新时间">{{ expressDetail.lastUpdateTime || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="计划到货时间">{{ expressDetail.planDate || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="更新时间">{{ expressDetail.updateTime || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="物流公司">
|
||||
<dict-tag :options="dict.type.oa_express_type" :value="expressDetail.expressType"/>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="备注" :span="2">{{ expressDetail.remark || '-' }}</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="detailOpen = false">关 闭</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
|
||||
<!-- 异常登记弹窗表单 -->
|
||||
<el-dialog
|
||||
title="异常问题登记"
|
||||
:visible.sync="questionDialogVisible"
|
||||
width="500px"
|
||||
append-to-body
|
||||
>
|
||||
<el-form :model="questionForm" :rules="questionFormRules" ref="questionForm" label-width="100px">
|
||||
<el-form-item label="问题描述" prop="description">
|
||||
<el-input v-model="questionForm.description" type="textarea" placeholder="请输入问题描述"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="汇报时间" prop="reportTime">
|
||||
<el-date-picker v-model="questionForm.reportTime" type="datetime" value-format="yyyy-MM-dd HH:mm:ss" placeholder="请选择汇报时间"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="questionForm.remark" type="textarea" placeholder="请输入备注"/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="questionDialogVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="submitQuestionForm">确 定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
<!-- 手动填写物流状态弹窗 -->
|
||||
<el-dialog title="手动填写物流状态" :visible.sync="customStatusDialogVisible" width="400px" append-to-body>
|
||||
<el-form :model="customStatusForm" label-width="100px">
|
||||
<el-form-item label="物流状态">
|
||||
<el-input v-model="customStatusForm.lastStatus" placeholder="请输入物流状态" />
|
||||
</el-form-item>
|
||||
<el-form-item label="更新时间">
|
||||
<el-date-picker v-model="customStatusForm.lastUpdateTime" type="datetime" value-format="yyyy-MM-dd HH:mm:ss" placeholder="请选择更新时间" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="customStatusDialogVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="submitCustomStatus">确 定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { addExpress, delExpress, getExpress, listExpress, refreshExpress, updateExpress } from "@/api/wms/express";
|
||||
import { addExpressQuestion } from "@/api/wms/expressQuestion";
|
||||
// import { listProject } from "@/api/wms/project";
|
||||
// import { listReportDetailByProjectId } from "@/api/wms/reportDetail";
|
||||
import UserSelect from "@/components/KLPService/UserSelect/index.vue";
|
||||
import { EExpressType } from '@/utils/enums';
|
||||
import ExpressRemainTime from './components/ExpressRemainTime.vue';
|
||||
import ExpressStatusEditor from './components/ExpressStatusEditor.vue';
|
||||
|
||||
export default {
|
||||
name: "Express",
|
||||
components: {UserSelect, ExpressStatusEditor, ExpressRemainTime},
|
||||
dicts: ['oa_express_type'],
|
||||
data() {
|
||||
return {
|
||||
// 按钮loading
|
||||
buttonLoading: false,
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
expressDetail:{},
|
||||
detailOpen:false,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 物流预览表格数据
|
||||
expressList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
expressCode: undefined,
|
||||
status: undefined,
|
||||
supplyName: undefined,
|
||||
supplyPhone: undefined,
|
||||
ownerId: undefined,
|
||||
ownerPhone: undefined,
|
||||
planDate: undefined,
|
||||
expressType: undefined,
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
expressId: [
|
||||
{required: true, message: "主键id不能为空", trigger: "blur"}
|
||||
],
|
||||
expressCode: [
|
||||
{required: true, message: "物流编号不能为空", trigger: "blur"}
|
||||
],
|
||||
status: [
|
||||
{required: true, message: "数据状态0未确认1进行中2已完成不能为空", trigger: "change"}
|
||||
],
|
||||
supplyName: [
|
||||
{required: true, message: "供应商姓名不能为空", trigger: "blur"}
|
||||
],
|
||||
supplyPhone: [
|
||||
{required: true, message: "供应商联系方式不能为空", trigger: "blur"}
|
||||
],
|
||||
ownerId: [
|
||||
{required: true, message: "负责人id不能为空", trigger: "blur"}
|
||||
],
|
||||
ownerPhone: [
|
||||
{required: true, message: "负责人手机号不能为空", trigger: "blur"}
|
||||
],
|
||||
planDate: [
|
||||
{required: true, message: "计划到货时间不能为空", trigger: "blur"}
|
||||
],
|
||||
expressType: [
|
||||
{required: true, message: "物流公司标识不能为空", trigger: "change"}
|
||||
],
|
||||
remark: [
|
||||
{required: true, message: "备注不能为空", trigger: "blur"}
|
||||
]
|
||||
},
|
||||
allProject:[],
|
||||
reportDetailList:[],
|
||||
// 异常登记弹窗
|
||||
questionDialogVisible: false,
|
||||
// 异常登记表单
|
||||
questionForm: {
|
||||
expressId: null,
|
||||
description: '',
|
||||
reportTime: '',
|
||||
status: 0,
|
||||
remark: ''
|
||||
},
|
||||
// 异常登记表单校验
|
||||
questionFormRules: {
|
||||
description: [{ required: true, message: '问题描述不能为空', trigger: 'blur' }],
|
||||
reportTime: [{ required: true, message: '汇报时间不能为空', trigger: 'blur' }]
|
||||
},
|
||||
currentExceptionRow: null,
|
||||
customStatusDialogVisible: false,
|
||||
customStatusForm: {
|
||||
expressId: null,
|
||||
lastStatus: '',
|
||||
lastUpdateTime: ''
|
||||
}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
// this.getAllProject()
|
||||
},
|
||||
methods: {
|
||||
/** 查询物流预览列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listExpress(this.queryParams).then(response => {
|
||||
this.expressList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
|
||||
|
||||
},
|
||||
/*getAllProject() {
|
||||
listProject({pageNum: 1, pageSize: 999999999}).then(response => {
|
||||
this.allProject = response.rows;
|
||||
});
|
||||
},*/
|
||||
|
||||
/*getReportSummary() {
|
||||
listReportDetailByProjectId(this.form.projectId).then(response => {
|
||||
this.reportDetailList = response.data;
|
||||
});
|
||||
},*/
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
|
||||
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
expressId: undefined,
|
||||
expressCode: undefined,
|
||||
status: undefined,
|
||||
supplyName: undefined,
|
||||
supplyPhone: undefined,
|
||||
ownerId: undefined,
|
||||
ownerPhone: undefined,
|
||||
planDate: undefined,
|
||||
expressType: undefined,
|
||||
createBy: undefined,
|
||||
createTime: undefined,
|
||||
updateBy: undefined,
|
||||
updateTime: undefined,
|
||||
delFlag: undefined,
|
||||
remark: undefined
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.expressId)
|
||||
this.single = selection.length !== 1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.title = "添加物流预览";
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.loading = true;
|
||||
this.reset();
|
||||
const expressId = row.expressId || this.ids
|
||||
getExpress(expressId).then(response => {
|
||||
this.loading = false;
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
this.title = "修改物流预览";
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
this.buttonLoading = true;
|
||||
if (this.form.expressId != null) {
|
||||
updateExpress(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
}).finally(() => {
|
||||
this.buttonLoading = false;
|
||||
});
|
||||
} else {
|
||||
addExpress(this.form).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
}).finally(() => {
|
||||
this.buttonLoading = false;
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
handleDetail(row){
|
||||
getExpress(row.expressId).then(response => {
|
||||
this.loading = false;
|
||||
this.expressDetail = response.data;
|
||||
this.detailOpen = true;
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
// 更新状态
|
||||
handleUpdateStatus(row, status) {
|
||||
let str = ""
|
||||
if (status === 1) {
|
||||
str = "是否确认操作,此数据将变化为确认状态"
|
||||
} else if (status === 2) {
|
||||
str = "确认状态已完成?"
|
||||
} else {
|
||||
str = "此物流单是否确认发生异常?操作后数据无法恢复"
|
||||
}
|
||||
if (status === 3) {
|
||||
// 弹出异常登记表单
|
||||
this.questionForm = {
|
||||
expressId: row.expressId,
|
||||
description: '',
|
||||
reportTime: this.parseTime(new Date(), '{y}-{m}-{d} {h}:{i}:{s}'),
|
||||
status: 0,
|
||||
remark: ''
|
||||
};
|
||||
this.currentExceptionRow = row;
|
||||
this.questionDialogVisible = true;
|
||||
return;
|
||||
}
|
||||
this.$modal.confirm(str).then(() => {
|
||||
row.status = status
|
||||
this.loading = true;
|
||||
return updateExpress(row);
|
||||
}).then(() => {
|
||||
this.loading = false;
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("操作成功");
|
||||
}).catch(() => {
|
||||
}).finally(() => {
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
submitQuestionForm() {
|
||||
this.$refs.questionForm.validate(valid => {
|
||||
if (!valid) return;
|
||||
// 新增 expressQuestion
|
||||
addExpressQuestion(this.questionForm).then(() => {
|
||||
// 新增成功后,更新物流单状态为异常
|
||||
const row = this.currentExceptionRow;
|
||||
row.status = 3;
|
||||
this.loading = true;
|
||||
updateExpress(row).then(() => {
|
||||
this.loading = false;
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("异常登记成功,物流单已标记为异常");
|
||||
}).finally(() => {
|
||||
this.loading = false;
|
||||
});
|
||||
this.questionDialogVisible = false;
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
// 同步物流状态
|
||||
handleRefresh(row){
|
||||
const expressIds = row.expressId || this.ids;
|
||||
if (expressIds.length < 1) {
|
||||
this.$modal.msgError("请选择要同步的物流单");
|
||||
return;
|
||||
}
|
||||
refreshExpress(expressIds).then(response => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("同步完成");
|
||||
})
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const expressIds = row.expressId || this.ids;
|
||||
this.$modal.confirm('是否确认删除物流预览编号为"' + expressIds + '"的数据项?').then(() => {
|
||||
this.loading = true;
|
||||
return delExpress(expressIds);
|
||||
}).then(() => {
|
||||
this.loading = false;
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {
|
||||
}).finally(() => {
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('oa/express/export', {
|
||||
...this.queryParams
|
||||
}, `express_${new Date().getTime()}.xlsx`)
|
||||
},
|
||||
// 计算剩余天数
|
||||
getRemainDays(planDate) {
|
||||
if (!planDate) return '-';
|
||||
const now = new Date();
|
||||
const plan = new Date(planDate);
|
||||
const diff = plan.getTime() - now.getTime();
|
||||
return Math.ceil(diff / (1000 * 60 * 60 * 24));
|
||||
},
|
||||
// 判断是否超时
|
||||
isTimeout(planDate) {
|
||||
if (!planDate) return false;
|
||||
const now = new Date();
|
||||
const plan = new Date(planDate);
|
||||
return now.getTime() > plan.getTime();
|
||||
},
|
||||
isCustomExpress(expressType) {
|
||||
const expressTypeList = Object.values(EExpressType);
|
||||
return !expressTypeList.includes(expressType);
|
||||
},
|
||||
openCustomStatusDialog(row) {
|
||||
this.customStatusForm = {
|
||||
expressId: row.expressId,
|
||||
lastStatus: row.lastStatus || '',
|
||||
lastUpdateTime: row.lastUpdateTime || ''
|
||||
};
|
||||
this.customStatusDialogVisible = true;
|
||||
},
|
||||
submitCustomStatus() {
|
||||
if (!this.customStatusForm.lastStatus || !this.customStatusForm.lastUpdateTime) {
|
||||
this.$modal.msgError('请填写完整物流状态和更新时间');
|
||||
return;
|
||||
}
|
||||
// 更新expressList中对应项
|
||||
const row = this.expressList.find(item => item.expressId === this.customStatusForm.expressId);
|
||||
if (row) {
|
||||
row.lastStatus = this.customStatusForm.lastStatus;
|
||||
row.lastUpdateTime = this.customStatusForm.lastUpdateTime;
|
||||
// 可选:直接调用后端接口保存
|
||||
updateExpress(row).then(() => {
|
||||
this.$modal.msgSuccess('保存成功');
|
||||
this.getList();
|
||||
});
|
||||
}
|
||||
this.customStatusDialogVisible = false;
|
||||
},
|
||||
handleStatusSave(row, val) {
|
||||
row.lastStatus = val.lastStatus;
|
||||
row.lastUpdateTime = val.lastUpdateTime;
|
||||
updateExpress(row).then(() => {
|
||||
this.$modal.msgSuccess('保存成功');
|
||||
this.getList();
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
353
klp-ui/src/views/wms/expressQuestion/index.vue
Normal file
353
klp-ui/src/views/wms/expressQuestion/index.vue
Normal file
@@ -0,0 +1,353 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="关联快递" prop="expressId">
|
||||
<el-input
|
||||
v-model="queryParams.expressId"
|
||||
placeholder="请输入关联快递"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="问题描述" prop="description">
|
||||
<el-input
|
||||
v-model="queryParams.description"
|
||||
placeholder="请输入问题描述"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="汇报时间" prop="reportTime">
|
||||
<el-date-picker clearable
|
||||
v-model="queryParams.reportTime"
|
||||
type="date"
|
||||
value-format="yyyy-MM-dd"
|
||||
placeholder="请选择汇报时间">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="汇报人" prop="reportBy">
|
||||
<el-input
|
||||
v-model="queryParams.reportBy"
|
||||
placeholder="请输入汇报人"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="el-icon-check"
|
||||
size="mini"
|
||||
@click="handleUpdateStatus"
|
||||
>修复</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
icon="el-icon-edit"
|
||||
size="mini"
|
||||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
>修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="el-icon-delete"
|
||||
size="mini"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
>删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
@click="handleExport"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="expressQuestionList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="问题编号" align="center" prop="questionId" v-if="true"/>
|
||||
<el-table-column label="快递单号" align="center" prop="expressCode" />
|
||||
<el-table-column label="问题描述" align="center" prop="description" />
|
||||
<el-table-column label="汇报时间" align="center" prop="reportTime" width="180">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.reportTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="汇报人" align="center" prop="reportBy" />
|
||||
<el-table-column label="是否解决" align="center" prop="status">
|
||||
<template slot-scope="scope">
|
||||
<el-tag v-if="scope.row.status===0" type="danger">未解决</el-tag>
|
||||
<el-tag v-if="scope.row.status===1" type="success">完成</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="备注" align="center" prop="remark" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="handleUpdateStatus(scope.row,1)"
|
||||
>问题解决</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
>删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<!-- 添加或修改快递问题对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="问题描述" prop="description">
|
||||
<el-input v-model="form.description" type="textarea" placeholder="请输入内容" />
|
||||
</el-form-item>
|
||||
<el-form-item label="汇报时间" prop="reportTime">
|
||||
<el-date-picker clearable
|
||||
v-model="form.reportTime"
|
||||
type="datetime"
|
||||
value-format="yyyy-MM-dd HH:mm:ss"
|
||||
placeholder="请选择汇报时间">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="汇报人" prop="reportBy">
|
||||
<el-input v-model="form.reportBy" placeholder="请输入汇报人" />
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { updateExpress } from "@/api/wms/express";
|
||||
import { addExpressQuestion, delExpressQuestion, getExpressQuestion, listExpressQuestion, updateExpressQuestion } from "@/api/wms/expressQuestion";
|
||||
|
||||
export default {
|
||||
name: "ExpressQuestion",
|
||||
data() {
|
||||
return {
|
||||
// 按钮loading
|
||||
buttonLoading: false,
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 快递问题表格数据
|
||||
expressQuestionList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
expressId: undefined,
|
||||
description: undefined,
|
||||
reportTime: undefined,
|
||||
reportBy: undefined,
|
||||
status: undefined,
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
questionId: [
|
||||
{ required: true, message: "主键id不能为空", trigger: "blur" }
|
||||
],
|
||||
expressId: [
|
||||
{ required: true, message: "关联快递不能为空", trigger: "blur" }
|
||||
],
|
||||
description: [
|
||||
{ required: true, message: "问题描述不能为空", trigger: "blur" }
|
||||
],
|
||||
reportTime: [
|
||||
{ required: true, message: "汇报时间不能为空", trigger: "blur" }
|
||||
],
|
||||
reportBy: [
|
||||
{ required: true, message: "汇报人不能为空", trigger: "blur" }
|
||||
],
|
||||
status: [
|
||||
{ required: true, message: "0未解决1已解决不能为空", trigger: "change" }
|
||||
],
|
||||
remark: [
|
||||
{ required: true, message: "备注不能为空", trigger: "blur" }
|
||||
]
|
||||
}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
/** 查询快递问题列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listExpressQuestion(this.queryParams).then(response => {
|
||||
this.expressQuestionList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
questionId: undefined,
|
||||
expressId: undefined,
|
||||
description: undefined,
|
||||
reportTime: undefined,
|
||||
reportBy: undefined,
|
||||
status: undefined,
|
||||
createTime: undefined,
|
||||
createBy: undefined,
|
||||
updateTime: undefined,
|
||||
updateBy: undefined,
|
||||
delFlag: undefined,
|
||||
remark: undefined
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.questionId)
|
||||
this.single = selection.length!==1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.title = "添加快递问题";
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.loading = true;
|
||||
this.reset();
|
||||
const questionId = row.questionId || this.ids
|
||||
getExpressQuestion(questionId).then(response => {
|
||||
this.loading = false;
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
this.title = "修改快递问题";
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
this.buttonLoading = true;
|
||||
if (this.form.questionId != null) {
|
||||
updateExpressQuestion(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
}).finally(() => {
|
||||
this.buttonLoading = false;
|
||||
});
|
||||
} else {
|
||||
addExpressQuestion(this.form).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
}).finally(() => {
|
||||
this.buttonLoading = false;
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
handleUpdateStatus(row){
|
||||
row.status = 1
|
||||
updateExpressQuestion(row).then(()=>{
|
||||
this.$modal.msgSuccess("操作成功");
|
||||
})
|
||||
let data = {
|
||||
expressId:row.expressId,
|
||||
status:1
|
||||
}
|
||||
updateExpress(data)
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const questionIds = row.questionId || this.ids;
|
||||
this.$modal.confirm('是否确认删除快递问题编号为"' + questionIds + '"的数据项?').then(() => {
|
||||
this.loading = true;
|
||||
return delExpressQuestion(questionIds);
|
||||
}).then(() => {
|
||||
this.loading = false;
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {
|
||||
}).finally(() => {
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('oa/expressQuestion/export', {
|
||||
...this.queryParams
|
||||
}, `expressQuestion_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
@@ -5,6 +5,7 @@
|
||||
<WarehouseSelect v-model="queryParams.warehouseId" placeholder="请选择仓库/库区/库位" clearable @change="getList" />
|
||||
</el-form-item>
|
||||
<MaterialSelect :itemType.sync="queryParams.itemType" :itemId.sync="queryParams.itemId" @change="getList" />
|
||||
|
||||
<el-form-item label="变动时间" prop="changeTime">
|
||||
<el-date-picker
|
||||
clearable
|
||||
@@ -36,7 +37,7 @@
|
||||
<el-table v-loading="loading" :data="stockLogList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="主键ID" align="center" prop="id" v-if="true"/>
|
||||
<el-table-column label="仓库/库区/库位ID" align="center" prop="warehouseId" />
|
||||
<el-table-column label="存储位置" align="center" prop="warehouseName" />
|
||||
<el-table-column label="物品ID" align="center" prop="itemId">
|
||||
<template slot-scope="scope">
|
||||
<RawMaterialInfo v-if="scope.row.itemType == 'raw_material'" :material-id="scope.row.itemId" />
|
||||
@@ -80,19 +81,20 @@
|
||||
<!-- 添加或修改库存流水对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="仓库/库区/库位ID" prop="warehouseId" disabled>
|
||||
<el-form-item label="存储位置" prop="warehouseId" disabled>
|
||||
<el-input v-model="form.warehouseId" placeholder="请输入仓库/库区/库位ID" disabled />
|
||||
</el-form-item>
|
||||
<el-form-item label="物品ID" prop="itemId" disabled>
|
||||
<el-input v-model="form.itemId" placeholder="请输入物品ID" disabled />
|
||||
<el-form-item label="物品信息" prop="itemId" disabled>
|
||||
<RawMaterialInfo v-if="form.itemType == 'raw_material'" :material-id="form.itemId" />
|
||||
<ProductInfo v-else-if="form.itemType == 'product' || form.itemType == 'semi'" :product-id="form.itemId" />
|
||||
</el-form-item>
|
||||
<el-form-item label="变动数量" prop="changeQty" disabled>
|
||||
<el-input v-model="form.changeQty" placeholder="请输入变动数量" disabled />
|
||||
</el-form-item>
|
||||
<el-form-item label="变动后的库存数量" prop="afterQty" disabled>
|
||||
<el-form-item label="库存数量" prop="afterQty" disabled>
|
||||
<el-input v-model="form.afterQty" placeholder="请输入变动后的库存数量" disabled />
|
||||
</el-form-item>
|
||||
<el-form-item label="实际库存变动时间" prop="changeTime" disabled>
|
||||
<el-form-item label="变动时间" prop="changeTime" disabled>
|
||||
<el-date-picker clearable
|
||||
v-model="form.changeTime"
|
||||
type="datetime"
|
||||
|
||||
595
klp-ui/src/views/wms/rxgood/detail.vue
Normal file
595
klp-ui/src/views/wms/rxgood/detail.vue
Normal file
@@ -0,0 +1,595 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="120px">
|
||||
<!-- <el-form-item label="关联汇报概述ID" prop="summaryId">
|
||||
<el-input
|
||||
v-model="queryParams.summaryId"
|
||||
placeholder="请输入关联汇报概述ID"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item> -->
|
||||
<el-form-item label="货物编号" prop="deviceCode">
|
||||
<el-input
|
||||
v-model="queryParams.deviceCode"
|
||||
placeholder="请输入货物编号"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="货物类别" prop="category">
|
||||
<el-autocomplete
|
||||
v-model="queryParams.category"
|
||||
:fetch-suggestions="categoryQuerySearch"
|
||||
placeholder="请输入货物类别"
|
||||
@select="handleCategorySelect"
|
||||
clearable
|
||||
style="width: 100%"
|
||||
/>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="货物说明" prop="deviceDescription">
|
||||
<el-input
|
||||
v-model="queryParams.deviceDescription"
|
||||
placeholder="请输入货物说明"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item> -->
|
||||
<el-form-item label="收发货详情" prop="reportDetail">
|
||||
<el-input
|
||||
v-model="queryParams.reportDetail"
|
||||
placeholder="请输入收发货详情"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="handleAdd"
|
||||
>新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
icon="el-icon-edit"
|
||||
size="mini"
|
||||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
>修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="el-icon-delete"
|
||||
size="mini"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
>删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
@click="handleExport"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="reportDetailList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="序号" align="center" type="index" v-if="true"/>
|
||||
<!-- <el-table-column label="关联汇报概述ID" align="center" prop="summaryId" /> -->
|
||||
<el-table-column label="货物编号" align="center" prop="deviceCode" />
|
||||
<el-table-column label="货物类别" align="center" prop="category" />
|
||||
<el-table-column label="货物说明" align="center" prop="deviceDescription" />
|
||||
<el-table-column label="收发货详情" align="center" prop="reportDetail" />
|
||||
<el-table-column label="图片概况" align="center" prop="ossIds" width="100">
|
||||
<template slot-scope="scope">
|
||||
<image-preview :src="scope.row.ossIds" :width="50" :height="50"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="备注" align="center" prop="remark" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-view"
|
||||
@click="handleImageDetail(scope.row)"
|
||||
>图片详情</el-button>
|
||||
|
||||
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
>修改</el-button>
|
||||
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="handleAddExpress(scope.row)"
|
||||
>发货</el-button>
|
||||
|
||||
|
||||
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
>删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<!-- 添加或修改设计项目汇报详情对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="50%" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
|
||||
<el-form-item label="货物编号" prop="deviceCode">
|
||||
<el-input v-model="form.deviceCode" placeholder="请输入货物编号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="货物类别" prop="category">
|
||||
<el-autocomplete
|
||||
v-model="form.category"
|
||||
:fetch-suggestions="categoryQuerySearch"
|
||||
placeholder="请输入货物类别"
|
||||
@select="handleCategorySelectForm"
|
||||
style="width: 100%"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="货物说明" prop="deviceDescription">
|
||||
<el-input v-model="form.deviceDescription" type="textarea" placeholder="请输入内容" />
|
||||
</el-form-item>
|
||||
<el-form-item label="收发货详情" prop="reportDetail">
|
||||
<el-input v-model="form.reportDetail" type="textarea" placeholder="请输入内容" />
|
||||
</el-form-item>
|
||||
<el-form-item label="图像" prop="ossIds">
|
||||
<image-upload v-model="form.ossIds"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog :title="title" :visible.sync="expressOpen" width="500px" append-to-body>
|
||||
<el-form ref="form" :model="expressForm" :rules="rules" label-width="120px">
|
||||
<el-form-item label="物流编号" prop="expressCode">
|
||||
<el-input v-model="expressForm.expressCode" placeholder="请输入物流编号"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="对方姓名" prop="supplyName">
|
||||
<el-input v-model="expressForm.supplyName" placeholder="请输入发货方姓名"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="对方联系方式" prop="supplyPhone">
|
||||
<el-input v-model="expressForm.supplyPhone" placeholder="请输入发货方联系方式"/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="负责人" prop="ownerId">
|
||||
<user-select v-model="expressForm.ownerId"></user-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="负责人手机号" prop="ownerPhone">
|
||||
<el-input v-model="expressForm.ownerPhone" placeholder="请输入负责人手机号"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="计划到货时间" prop="planDate">
|
||||
<el-date-picker clearable
|
||||
v-model="expressForm.planDate"
|
||||
type="datetime"
|
||||
value-format="yyyy-MM-dd HH:mm:ss"
|
||||
placeholder="请选择计划到货时间">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="物流公司标识" prop="expressType">
|
||||
<el-select v-model="expressForm.expressType" placeholder="请选择物流公司标识">
|
||||
<el-option
|
||||
v-for="dict in dict.type.oa_express_type"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="expressForm.remark" type="textarea" placeholder="请输入内容"/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button :loading="buttonLoading" type="primary" @click="submitExpress">确 定</el-button>
|
||||
<el-button @click="cancelExpress">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
|
||||
<el-drawer
|
||||
title="图片列表"
|
||||
:visible.sync="imageDrawer"
|
||||
direction="rtl"
|
||||
>
|
||||
<image-preview v-for="img in srcList" :src="img" :width="150" :height="150" />
|
||||
</el-drawer>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { addExpress, updateExpress } from "@/api/wms/express";
|
||||
import { addReportDetail, delReportDetail, getReportDetail, listReportDetail, updateReportDetail } from "@/api/wms/reportDetail";
|
||||
import UserSelect from "@/components/KLPService/UserSelect/index.vue";
|
||||
|
||||
export default {
|
||||
name: "ReportDetail",
|
||||
dicts:['expressType'],
|
||||
components: {UserSelect},
|
||||
data() {
|
||||
return {
|
||||
// 按钮loading
|
||||
buttonLoading: false,
|
||||
expressOpen:false,
|
||||
imageDrawer:false,
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 设计项目汇报详情表格数据
|
||||
reportDetailList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
summaryId: undefined,
|
||||
deviceCode: undefined,
|
||||
category: undefined,
|
||||
deviceDescription: undefined,
|
||||
reportDetail: undefined,
|
||||
},
|
||||
// 表单参数
|
||||
form: {
|
||||
detailId: undefined,
|
||||
summaryId: this.$route.params && this.$route.params.summaryId,
|
||||
deviceCode: undefined,
|
||||
category: undefined,
|
||||
deviceDescription: "发货",
|
||||
reportDetail: undefined,
|
||||
ossIds: undefined,
|
||||
images: '',
|
||||
createBy: undefined,
|
||||
createTime: undefined,
|
||||
updateBy: undefined,
|
||||
updateTime: undefined,
|
||||
delFlag: undefined,
|
||||
remark: undefined,
|
||||
},
|
||||
expressForm:{},
|
||||
// 表单校验
|
||||
rules: {
|
||||
detailId: [
|
||||
{ required: true, message: "主键ID不能为空", trigger: "blur" }
|
||||
],
|
||||
summaryId: [
|
||||
{ required: true, message: "关联汇报概述ID不能为空", trigger: "blur" }
|
||||
],
|
||||
deviceCode: [
|
||||
{ required: true, message: "货物编号不能为空", trigger: "blur" }
|
||||
],
|
||||
category: [
|
||||
{ required: true, message: "货物类别不能为空", trigger: "blur" }
|
||||
],
|
||||
deviceDescription: [
|
||||
{ required: true, message: "货物说明不能为空", trigger: "blur" }
|
||||
],
|
||||
reportDetail: [
|
||||
{ required: true, message: "收发货详情不能为空", trigger: "blur" }
|
||||
],
|
||||
ossIds: [
|
||||
{ required: true, message: "关联图像 OSS ID 列表不能为空", trigger: "blur" }
|
||||
],
|
||||
expressId: [
|
||||
{required: true, message: "主键id不能为空", trigger: "blur"}
|
||||
],
|
||||
expressCode: [
|
||||
{required: true, message: "物流编号不能为空", trigger: "blur"}
|
||||
],
|
||||
status: [
|
||||
{required: true, message: "数据状态0未确认1进行中2已完成不能为空", trigger: "change"}
|
||||
],
|
||||
supplyName: [
|
||||
{required: true, message: "供应商姓名不能为空", trigger: "blur"}
|
||||
],
|
||||
supplyPhone: [
|
||||
{required: true, message: "供应商联系方式不能为空", trigger: "blur"}
|
||||
],
|
||||
ownerId: [
|
||||
{required: true, message: "负责人id不能为空", trigger: "blur"}
|
||||
],
|
||||
ownerPhone: [
|
||||
{required: true, message: "负责人手机号不能为空", trigger: "blur"}
|
||||
],
|
||||
planDate: [
|
||||
{required: true, message: "计划到货时间不能为空", trigger: "blur"}
|
||||
],
|
||||
expressType: [
|
||||
{required: true, message: "物流公司标识不能为空", trigger: "change"}
|
||||
],
|
||||
},
|
||||
categoryList: [], // 货物类别本地缓存
|
||||
imageList:'',
|
||||
srcList:[],
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.queryParams.summaryId = this.$route.params && this.$route.params.summaryId;
|
||||
this.form.summaryId = this.$route.params && this.$route.params.summaryId;
|
||||
this.getList();
|
||||
this.initCategoryList();
|
||||
},
|
||||
|
||||
methods: {
|
||||
/** 查询设计项目汇报详情列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listReportDetail(this.queryParams).then(response => {
|
||||
this.reportDetailList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
// 更新本地类别缓存
|
||||
this.updateCategoryList(response.rows);
|
||||
});
|
||||
},
|
||||
// 初始化货物类别缓存
|
||||
initCategoryList() {
|
||||
listReportDetail({pageSize: 9999}).then(response => {
|
||||
this.updateCategoryList(response.rows);
|
||||
});
|
||||
},
|
||||
|
||||
// 从rows中提取所有category并去重
|
||||
updateCategoryList(rows) {
|
||||
const set = new Set(this.categoryList);
|
||||
rows.forEach(item => {
|
||||
if (item.category) set.add(item.category);
|
||||
});
|
||||
this.categoryList = Array.from(set);
|
||||
},
|
||||
// 自动补全方法
|
||||
categoryQuerySearch(queryString, cb) {
|
||||
const results = queryString
|
||||
? this.categoryList
|
||||
.filter(cat => cat && cat.toLowerCase().includes(queryString.toLowerCase()))
|
||||
.map(cat => ({value: cat}))
|
||||
: this.categoryList.map(cat => ({value: cat}));
|
||||
cb(results);
|
||||
},
|
||||
// 搜索表单选择
|
||||
handleCategorySelect(item) {
|
||||
this.queryParams.category = item.value;
|
||||
},
|
||||
// 弹窗表单选择
|
||||
handleCategorySelectForm(item) {
|
||||
this.form.category = item.value;
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
this.resetExpress()
|
||||
},
|
||||
|
||||
cancelExpress(){
|
||||
this.expressOpen = false;
|
||||
this.reset();
|
||||
this.resetExpress()
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
detailId: undefined,
|
||||
summaryId: this.$route.params && this.$route.params.summaryId,
|
||||
deviceCode: undefined,
|
||||
category: undefined,
|
||||
deviceDescription: "发货",
|
||||
reportDetail: undefined,
|
||||
ossIds: undefined,
|
||||
images: '',
|
||||
createBy: undefined,
|
||||
createTime: undefined,
|
||||
updateBy: undefined,
|
||||
updateTime: undefined,
|
||||
delFlag: undefined,
|
||||
remark: undefined,
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
|
||||
// 表单重置
|
||||
resetExpress() {
|
||||
this.form = {
|
||||
expressId: undefined,
|
||||
expressCode: undefined,
|
||||
status: undefined,
|
||||
supplyName: undefined,
|
||||
supplyPhone: undefined,
|
||||
ownerId: undefined,
|
||||
ownerPhone: undefined,
|
||||
planDate: undefined,
|
||||
expressType: undefined,
|
||||
createBy: undefined,
|
||||
createTime: undefined,
|
||||
updateBy: undefined,
|
||||
updateTime: undefined,
|
||||
delFlag: undefined,
|
||||
remark: undefined
|
||||
};
|
||||
this.resetForm("expressForm");
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.detailId)
|
||||
this.single = selection.length !== 1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.title = "添加设计项目汇报详情";
|
||||
},
|
||||
|
||||
/** 新增按钮操作 */
|
||||
handleAddExpress(row) {
|
||||
this.resetExpress();
|
||||
this.expressOpen = true;
|
||||
this.expressForm = row.detailId;
|
||||
this.title = "新增发货记录";
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.loading = true;
|
||||
this.reset();
|
||||
const detailId = row.detailId || this.ids
|
||||
getReportDetail(detailId).then(response => {
|
||||
this.loading = false;
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
this.title = "修改设计项目汇报详情";
|
||||
});
|
||||
},
|
||||
submitExpress(){
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
this.buttonLoading = true;
|
||||
if (this.expressForm.expressId != null) {
|
||||
updateExpress(this.expressForm).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
}).finally(() => {
|
||||
this.buttonLoading = false;
|
||||
});
|
||||
} else {
|
||||
addExpress(this.expressForm).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
}).finally(() => {
|
||||
this.buttonLoading = false;
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
this.buttonLoading = true;
|
||||
if (this.form.detailId != null) {
|
||||
updateReportDetail(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
}).finally(() => {
|
||||
this.buttonLoading = false;
|
||||
});
|
||||
} else {
|
||||
addReportDetail(this.form).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
}).finally(() => {
|
||||
this.buttonLoading = false;
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const ids = row.detailId || this.ids;
|
||||
this.$modal.confirm('是否确认删除编号为"' + ids + '"的数据项?').then(() => {
|
||||
this.loading = true;
|
||||
return delReportDetail(ids);
|
||||
}).then(() => {
|
||||
this.loading = false;
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {
|
||||
}).finally(() => {
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('system/reportDetail/export', {
|
||||
...this.queryParams
|
||||
}, `reportDetail_${new Date().getTime()}.xlsx`)
|
||||
},
|
||||
/** 查看图片详情 */
|
||||
handleImageDetail(row) {
|
||||
this.imageList = row.ossIds;
|
||||
this.imageDrawer = true;
|
||||
this.getImageList()
|
||||
},
|
||||
getImageList() {
|
||||
let real_src_list = this.imageList.split(",");
|
||||
let srcList = [];
|
||||
real_src_list.forEach(item => {
|
||||
return srcList.push(item);
|
||||
});
|
||||
this.srcList = srcList;
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
||||
378
klp-ui/src/views/wms/rxgood/index.vue
Normal file
378
klp-ui/src/views/wms/rxgood/index.vue
Normal file
@@ -0,0 +1,378 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="100px">
|
||||
<el-form-item label="收发货标题" prop="reportTitle">
|
||||
<el-input
|
||||
v-model="queryParams.reportTitle"
|
||||
placeholder="请输入收发货标题"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="收发货日期" prop="reportDate">
|
||||
<el-date-picker clearable
|
||||
v-model="queryParams.reportDate"
|
||||
type="date"
|
||||
value-format="yyyy-MM-dd"
|
||||
placeholder="请选择收发货日期">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="经办人" prop="reporter">
|
||||
<el-input
|
||||
v-model="queryParams.reporter"
|
||||
placeholder="请输入经办人"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="涉及项目" prop="projectId">
|
||||
<el-select style="width: 100%;" v-model="form.projectId" placeholder="请输入涉及项目">
|
||||
<el-option
|
||||
v-for="item in projectList"
|
||||
:key="item.projectId"
|
||||
:label="item.projectName"
|
||||
:value="item.projectId"
|
||||
>
|
||||
{{ item.projectName }}
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>-->
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="handleAdd"
|
||||
>新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
icon="el-icon-edit"
|
||||
size="mini"
|
||||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
>修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="el-icon-delete"
|
||||
size="mini"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
>删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
@click="handleExport"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="reportSummaryList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="序号" align="center" type="index" v-if="true"/>
|
||||
<el-table-column label="收发货标题" align="center" prop="reportTitle">
|
||||
<template slot-scope="scope">
|
||||
<router-link class="link-type" :to="'/exp/rx/detail/' + scope.row.summaryId">{{ scope.row.reportTitle }}</router-link>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="最近汇报时间" align="center" prop="lastUpdateTime" width="180">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.lastUpdateTime, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="收发货日期" align="center" prop="reportDate" width="180">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.reportDate, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="经办人" align="center" prop="reporter" />
|
||||
<el-table-column label="涉及项目" align="center" prop="projectName" />
|
||||
<el-table-column label="备注" align="center" prop="remark" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
>修改</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
>删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<!-- 添加或修改涉及项目汇报概述对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="50%" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
|
||||
<el-form-item label="收发货标题" prop="reportTitle">
|
||||
<el-input v-model="form.reportTitle" placeholder="请输入收发货标题" />
|
||||
</el-form-item>
|
||||
<el-form-item label="收发货日期" prop="reportDate">
|
||||
<el-date-picker clearable
|
||||
v-model="form.reportDate"
|
||||
type="datetime"
|
||||
value-format="yyyy-MM-dd HH:mm:ss"
|
||||
placeholder="请选择收发货日期"
|
||||
style="width: 100%;">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="经办人" prop="reporter">
|
||||
<el-input v-model="form.reporter" placeholder="请输入经办人" />
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="涉及项目" prop="projectId">
|
||||
<el-select style="width: 100%;" v-model="form.projectId" placeholder="请输入涉及项目">
|
||||
<el-option
|
||||
v-for="item in projectList"
|
||||
:key="item.projectId"
|
||||
:label="item.projectName"
|
||||
:value="item.projectId"
|
||||
>
|
||||
{{ item.projectName }}
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>-->
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
// import { listProject } from "@/api/wms/project";
|
||||
import { addReportSummary, delReportSummary, getReportSummary, listReportSummary, updateReportSummary } from "@/api/wms/reportSummary";
|
||||
|
||||
export default {
|
||||
name: "ReportSummary",
|
||||
data() {
|
||||
return {
|
||||
// projectList: [],
|
||||
// 按钮loading
|
||||
buttonLoading: false,
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 涉及项目汇报概述表格数据
|
||||
reportSummaryList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
reportTitle: undefined,
|
||||
reportDate: undefined,
|
||||
reporter: undefined,
|
||||
projectId: undefined,
|
||||
type: 2
|
||||
},
|
||||
// 表单参数
|
||||
form: {
|
||||
summaryId: undefined,
|
||||
reportTitle: undefined,
|
||||
reportDate: undefined,
|
||||
reporter: undefined,
|
||||
projectId: undefined,
|
||||
createBy: undefined,
|
||||
createTime: undefined,
|
||||
updateBy: undefined,
|
||||
updateTime: undefined,
|
||||
delFlag: undefined,
|
||||
remark: undefined,
|
||||
type: 2
|
||||
},
|
||||
// 表单校验
|
||||
rules: {
|
||||
summaryId: [
|
||||
{ required: true, message: "主键ID不能为空", trigger: "blur" }
|
||||
],
|
||||
reportTitle: [
|
||||
{ required: true, message: "收发货标题不能为空", trigger: "blur" }
|
||||
],
|
||||
reportDate: [
|
||||
{ required: true, message: "收发货日期不能为空", trigger: "blur" }
|
||||
],
|
||||
reporter: [
|
||||
{ required: true, message: "经办人不能为空", trigger: "blur" }
|
||||
],
|
||||
projectId: [
|
||||
{ required: true, message: "涉及项目不能为空", trigger: "blur" }
|
||||
],
|
||||
remark: [
|
||||
{ required: true, message: "备注不能为空", trigger: "blur" }
|
||||
]
|
||||
}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
// this.getProjectList()
|
||||
},
|
||||
methods: {
|
||||
/** 查询涉及项目汇报概述列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listReportSummary(this.queryParams).then(response => {
|
||||
this.reportSummaryList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
/*getProjectList() {
|
||||
listProject({ pageSize: 999 }).then(({ rows }) => {
|
||||
this.projectList = rows;
|
||||
})
|
||||
},*/
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
summaryId: undefined,
|
||||
reportTitle: undefined,
|
||||
reportDate: undefined,
|
||||
reporter: undefined,
|
||||
projectId: undefined,
|
||||
createBy: undefined,
|
||||
createTime: undefined,
|
||||
updateBy: undefined,
|
||||
updateTime: undefined,
|
||||
delFlag: undefined,
|
||||
remark: undefined,
|
||||
type: 2
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.summaryId)
|
||||
this.single = selection.length!==1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.title = "添加涉及项目汇报概述";
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.loading = true;
|
||||
this.reset();
|
||||
const summaryId = row.summaryId || this.ids
|
||||
getReportSummary(summaryId).then(response => {
|
||||
this.loading = false;
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
this.title = "修改涉及项目汇报概述";
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
this.buttonLoading = true;
|
||||
if (this.form.summaryId != null) {
|
||||
updateReportSummary(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
}).finally(() => {
|
||||
this.buttonLoading = false;
|
||||
});
|
||||
} else {
|
||||
addReportSummary(this.form).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
}).finally(() => {
|
||||
this.buttonLoading = false;
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const ids = row.summaryId || this.ids;
|
||||
this.$modal.confirm('是否确认删除涉及项目汇报概述编号为"' + ids + '"的数据项?').then(() => {
|
||||
this.loading = true;
|
||||
return delReportSummary(ids);
|
||||
}).then(() => {
|
||||
this.loading = false;
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {
|
||||
}).finally(() => {
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('system/reportSummary/export', {
|
||||
...this.queryParams
|
||||
}, `reportSummary_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<StockIoPage ioType="move" />
|
||||
<StockIoPage ioType="transfer" />
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
package com.klp.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.klp.domain.WmsStock;
|
||||
import com.klp.domain.WmsStockLog;
|
||||
import com.klp.domain.vo.WmsStockLogVo;
|
||||
import com.klp.common.core.mapper.BaseMapperPlus;
|
||||
|
||||
@@ -8,6 +8,8 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.klp.common.utils.StringUtils;
|
||||
import com.klp.domain.WmsWarehouse;
|
||||
import com.klp.mapper.WmsWarehouseMapper;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.klp.domain.bo.WmsStockLogBo;
|
||||
@@ -16,6 +18,8 @@ import com.klp.domain.WmsStockLog;
|
||||
import com.klp.mapper.WmsStockLogMapper;
|
||||
import com.klp.service.IWmsStockLogService;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
@@ -31,6 +35,8 @@ import java.util.Collection;
|
||||
public class WmsStockLogServiceImpl implements IWmsStockLogService {
|
||||
|
||||
private final WmsStockLogMapper baseMapper;
|
||||
@Resource
|
||||
private WmsWarehouseMapper warehouseMapper;
|
||||
|
||||
/**
|
||||
* 查询库存流水
|
||||
@@ -62,7 +68,15 @@ public class WmsStockLogServiceImpl implements IWmsStockLogService {
|
||||
private QueryWrapper<WmsStockLog> buildQueryWrapperPlus(WmsStockLogBo bo) {
|
||||
QueryWrapper<WmsStockLog> lqw = Wrappers.query();
|
||||
lqw.eq("sl.del_flag", 0);
|
||||
lqw.eq(bo.getWarehouseId() != null, "sl.warehouse_id", bo.getWarehouseId());
|
||||
// 处理仓库ID查询,支持递归查询子节点
|
||||
if (bo.getWarehouseId() != null) {
|
||||
List<Long> warehouseIds = getWarehouseIdsWithChildren(bo.getWarehouseId());
|
||||
if (warehouseIds.size() == 1) {
|
||||
lqw.eq("sl.warehouse_id", warehouseIds.get(0));
|
||||
} else {
|
||||
lqw.in("sl.warehouse_id", warehouseIds);
|
||||
}
|
||||
}
|
||||
lqw.eq(bo.getItemId() != null, "sl.item_id", bo.getItemId());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getItemType()), "sl.item_type", bo.getItemType());
|
||||
lqw.eq(bo.getChangeQty() != null, "sl.change_qty", bo.getChangeQty());
|
||||
@@ -83,8 +97,6 @@ public class WmsStockLogServiceImpl implements IWmsStockLogService {
|
||||
lqw.eq(bo.getChangeQty() != null, WmsStockLog::getChangeQty, bo.getChangeQty());
|
||||
lqw.eq(bo.getAfterQty() != null, WmsStockLog::getAfterQty, bo.getAfterQty());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getChangeType()), WmsStockLog::getChangeType, bo.getChangeType());
|
||||
// lqw.eq(bo.getChangeTime() != null, WmsStockLog::getChangeTime, bo.getChangeTime());
|
||||
|
||||
// 根据时间区间查询
|
||||
lqw.ge(bo.getStartTime() != null, WmsStockLog::getChangeTime, bo.getStartTime());
|
||||
lqw.le(bo.getEndTime() != null, WmsStockLog::getChangeTime, bo.getEndTime());
|
||||
@@ -132,4 +144,38 @@ public class WmsStockLogServiceImpl implements IWmsStockLogService {
|
||||
}
|
||||
return baseMapper.deleteBatchIds(ids) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取指定仓库ID及其所有子仓库ID
|
||||
* @param warehouseId 仓库ID
|
||||
* @return 包含当前仓库ID和所有子仓库ID的列表
|
||||
*/
|
||||
private List<Long> getWarehouseIdsWithChildren(Long warehouseId) {
|
||||
List<Long> warehouseIds = new ArrayList<>();
|
||||
warehouseIds.add(warehouseId); // 添加当前仓库ID
|
||||
|
||||
// 递归获取所有子仓库ID
|
||||
getChildWarehouseIds(warehouseId, warehouseIds);
|
||||
|
||||
return warehouseIds;
|
||||
}
|
||||
|
||||
/**
|
||||
* 递归获取子仓库ID
|
||||
* @param parentId 父仓库ID
|
||||
* @param warehouseIds 仓库ID列表(用于收集结果)
|
||||
*/
|
||||
private void getChildWarehouseIds(Long parentId, List<Long> warehouseIds) {
|
||||
// 查询直接子仓库
|
||||
List<WmsWarehouse> children = warehouseMapper.selectList(
|
||||
Wrappers.<WmsWarehouse>lambdaQuery()
|
||||
.eq(WmsWarehouse::getParentId, parentId)
|
||||
.eq(WmsWarehouse::getDelFlag, 0)
|
||||
);
|
||||
// 递归处理每个子仓库
|
||||
for (WmsWarehouse child : children) {
|
||||
warehouseIds.add(child.getWarehouseId());
|
||||
getChildWarehouseIds(child.getWarehouseId(), warehouseIds);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user