新增业务单据,新增扫码单据
parent
4d6044f480
commit
eaf2ecf3a1
@ -0,0 +1,33 @@
|
|||||||
|
import axios from '@/utils/request'
|
||||||
|
|
||||||
|
//--------------获取领用单据-------------------
|
||||||
|
export function getReceiveOrder(query) {
|
||||||
|
return axios({
|
||||||
|
url: "/udiwms/receive/order/filter",
|
||||||
|
method: "get",
|
||||||
|
params: query
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
export function addDetail(query) {
|
||||||
|
return axios({
|
||||||
|
url: "/udiwms/receive/detail/add",
|
||||||
|
method: "post",
|
||||||
|
data: query
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
export function getOrderDetail(query) {
|
||||||
|
return axios({
|
||||||
|
url: "/udiwms/receive/order/detail",
|
||||||
|
method: "get",
|
||||||
|
params: query
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,231 @@
|
|||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<el-card>
|
||||||
|
<el-form :inline="true" :model="filterQuery" class="query-form" size="mini">
|
||||||
|
<el-row>
|
||||||
|
<el-form-item class="query-form-item">
|
||||||
|
<el-input v-model="filterQuery.nameCode" placeholder="产品标识DI"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item class="query-form-item">
|
||||||
|
<el-input v-model="filterQuery.cpmctymc" placeholder="产品名称"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item class="query-form-item">
|
||||||
|
<el-input v-model="filterQuery.batchNo" placeholder="批次号"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
|
<el-button-group>
|
||||||
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
icon="el-icon-refresh"
|
||||||
|
@click="onReset"
|
||||||
|
></el-button>
|
||||||
|
<el-button type="primary" icon="search" @click="onSubmit"
|
||||||
|
>查询
|
||||||
|
</el-button
|
||||||
|
>
|
||||||
|
<el-button type="primary" icon="search" @click="combine">确定</el-button>
|
||||||
|
</el-button-group>
|
||||||
|
</el-form-item>
|
||||||
|
</el-row>
|
||||||
|
</el-form>
|
||||||
|
<el-table v-loading="loading" :data="list" style="width: 100%"
|
||||||
|
highlight-current-row="false"
|
||||||
|
ref="multipleTable">
|
||||||
|
<el-table-column
|
||||||
|
type="selection"
|
||||||
|
width="55">
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="序号" type="index"></el-table-column>
|
||||||
|
<el-table-column label="产品标识" prop="nameCode"></el-table-column>
|
||||||
|
<el-table-column label="产品名称" prop="cpmctymc">
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="规格型号" prop="ggxh"></el-table-column>
|
||||||
|
<el-table-column label="批次号" prop="batchNo"></el-table-column>
|
||||||
|
<el-table-column label="生产日期" prop="productionDate"></el-table-column>
|
||||||
|
<el-table-column label="失效日期" prop="expireDate"></el-table-column>
|
||||||
|
<el-table-column label="入库数量" prop="inCount"></el-table-column>
|
||||||
|
<el-table-column label="出库数量" prop="outCount"></el-table-column>
|
||||||
|
<el-table-column label="结余数量" prop="reCount"></el-table-column>
|
||||||
|
</el-table>
|
||||||
|
</el-card>
|
||||||
|
|
||||||
|
<el-pagination
|
||||||
|
:page-size="filterQuery.limit"
|
||||||
|
@current-change="handleCurrentChange"
|
||||||
|
layout="prev, pager, next"
|
||||||
|
:total="total"
|
||||||
|
:current-page="filterQuery.page"
|
||||||
|
></el-pagination>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import {
|
||||||
|
getInvProduct,
|
||||||
|
} from "@/api/inventory/invPorduct";
|
||||||
|
import {addDetail} from "@/api/inout/receiveOrder";
|
||||||
|
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: "DialogInvProduct",
|
||||||
|
props: {
|
||||||
|
closeDialog: {
|
||||||
|
type: Function,
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
invQueryData: {
|
||||||
|
type: Object,
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
type: {
|
||||||
|
type: Object,
|
||||||
|
required: true,
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
filterQuery: {
|
||||||
|
cpmctymc: null,
|
||||||
|
nameCode: null,
|
||||||
|
relIdFk: null,
|
||||||
|
batchNo: null,
|
||||||
|
page: 1,
|
||||||
|
limit: 10,
|
||||||
|
customerId: null,
|
||||||
|
supId: null,
|
||||||
|
unitFk: null,
|
||||||
|
invCode: this.invQueryData.invCode,
|
||||||
|
},
|
||||||
|
detailQuery: {
|
||||||
|
code: null,
|
||||||
|
productIdFk: null,
|
||||||
|
page: 1,
|
||||||
|
limit: 20,
|
||||||
|
},
|
||||||
|
list: [],
|
||||||
|
total: 0,
|
||||||
|
loading: true,
|
||||||
|
index: null,
|
||||||
|
dialogTableVisible: false,
|
||||||
|
formLoading: false,
|
||||||
|
dialogVisible: false,
|
||||||
|
deleteLoading: false,
|
||||||
|
busTypes: [],
|
||||||
|
idQuery: null,
|
||||||
|
showSup: false,
|
||||||
|
fromOptions: [],
|
||||||
|
};
|
||||||
|
},
|
||||||
|
components: {},
|
||||||
|
methods: {
|
||||||
|
onReset() {
|
||||||
|
|
||||||
|
this.$router.push({
|
||||||
|
path: "",
|
||||||
|
});
|
||||||
|
this.filterQuery = {
|
||||||
|
cpmctymc: null,
|
||||||
|
nameCode: null,
|
||||||
|
relIdFk: null,
|
||||||
|
batchNo: null,
|
||||||
|
customerId: null,
|
||||||
|
unitFk: null,
|
||||||
|
supId: null,
|
||||||
|
page: 1,
|
||||||
|
limit: 10,
|
||||||
|
invCode: this.invQueryData.targetInvCode,
|
||||||
|
};
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
onSubmit() {
|
||||||
|
this.loading = true;
|
||||||
|
this.filterQuery.page = 1;
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
handleSizeChange(val) {
|
||||||
|
this.filterQuery.limit = val;
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
handleCurrentChange(val) {
|
||||||
|
this.filterQuery.page = val;
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
closeDetailDialog(val) {
|
||||||
|
this.codeDetailVisible = false;
|
||||||
|
},
|
||||||
|
|
||||||
|
getList() {
|
||||||
|
this.loading = true;
|
||||||
|
getInvProduct(this.filterQuery)
|
||||||
|
.then((response) => {
|
||||||
|
this.showSup = response.data.showSup;
|
||||||
|
this.loading = false;
|
||||||
|
this.list = response.data.list || [];
|
||||||
|
this.total = response.data.total || 0;
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
this.loading = false;
|
||||||
|
this.list = [];
|
||||||
|
this.total = 0;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
combine() {
|
||||||
|
let selection = this.$refs.multipleTable.selection;
|
||||||
|
if (selection.length < 1) {
|
||||||
|
this.$message.error('未选择产品');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
let ids = [];
|
||||||
|
selection.forEach((obj, index) => {
|
||||||
|
let data = {
|
||||||
|
relId: obj.relIdFk,
|
||||||
|
batchNo: obj.batchNo,
|
||||||
|
productDate: obj.productionDate,
|
||||||
|
expireDate: obj.expireDate,
|
||||||
|
}
|
||||||
|
ids.push(data);
|
||||||
|
});
|
||||||
|
|
||||||
|
this.loading = true;
|
||||||
|
let tQuery = {
|
||||||
|
datas: ids,
|
||||||
|
purReceiveEntity: this.invQueryData,
|
||||||
|
};
|
||||||
|
addDetail(tQuery).then((response) => {
|
||||||
|
this.loading = false;
|
||||||
|
if (response.code === 20000) {
|
||||||
|
this.closeDialog(response.data);
|
||||||
|
} else {
|
||||||
|
this.$message.error(response.message);
|
||||||
|
}
|
||||||
|
}).catch(() => {
|
||||||
|
this.loading = false;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
},
|
||||||
|
filters: {
|
||||||
|
statusFilterType(status) {
|
||||||
|
const statusMap = {
|
||||||
|
false: "success",
|
||||||
|
true: "danger",
|
||||||
|
};
|
||||||
|
return statusMap[status];
|
||||||
|
},
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
document.body.ondrop = function (event) {
|
||||||
|
event.preventDefault();
|
||||||
|
event.stopPropagation();
|
||||||
|
};
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.filterQuery.invCode = this.invQueryData.targetInvCode;
|
||||||
|
// 加载表格数据
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style type="text/scss" lang="scss">
|
||||||
|
</style>
|
@ -0,0 +1,482 @@
|
|||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<el-card class="el-card">
|
||||||
|
<el-form :model="filterQuery" class="query-form" size="mini" label-width="100px" v-show="showSearch">
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="6">
|
||||||
|
<el-form-item class="query-form-item" label="单号:">
|
||||||
|
<el-input v-model="filterQuery.billNo" placeholder="单号"
|
||||||
|
style="width: 90%"
|
||||||
|
clearable="true"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="6">
|
||||||
|
<el-form-item class="query-form-item" label="出入库类型:">
|
||||||
|
<el-select v-model="filterQuery.mainAction" placeholder="请选择出入库类型" style="width: 90%">
|
||||||
|
<el-option label="全部" value=""></el-option>
|
||||||
|
<el-option label="入库" value="WareHouseIn"></el-option>
|
||||||
|
<el-option label="出库" value="WareHouseOut"></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="6">
|
||||||
|
<el-form-item class="query-form-item" label="单据类型:">
|
||||||
|
<el-select v-model="filterQuery.action" placeholder="请选择单据类型"
|
||||||
|
style="width: 90%"
|
||||||
|
clearable>
|
||||||
|
<el-option
|
||||||
|
v-for="item in busTypes"
|
||||||
|
:key="item.name"
|
||||||
|
:label="item.name"
|
||||||
|
:value="item.action">
|
||||||
|
<span style="float: left">{{ item.name }}</span>
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="6">
|
||||||
|
<el-form-item class="query-form-item" label="所属仓库:">
|
||||||
|
<el-select v-model="filterQuery.invCode" placeholder="请选择所属仓库" clearable="true"
|
||||||
|
style="width: 90%"
|
||||||
|
@change="invChange"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in invList"
|
||||||
|
:key="item.name"
|
||||||
|
:label="item.name"
|
||||||
|
:value="item.code">
|
||||||
|
<span style="float: left">{{ item.name }}</span>
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="6">
|
||||||
|
<el-form-item class="query-form-item" label="创建时间:">
|
||||||
|
<el-date-picker
|
||||||
|
:picker-options="pickerOptions"
|
||||||
|
v-model="actDateRange"
|
||||||
|
type="daterange"
|
||||||
|
format="yyyy 年 MM 月 dd 日"
|
||||||
|
value-format="yyyy-MM-dd"
|
||||||
|
range-separator="至"
|
||||||
|
start-placeholder="开始日期"
|
||||||
|
end-placeholder="结束日期"
|
||||||
|
style="width: 90%"
|
||||||
|
>
|
||||||
|
</el-date-picker>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-form>
|
||||||
|
<div class="top-right-btn">
|
||||||
|
<el-button-group>
|
||||||
|
<el-button icon="el-icon-view" type="primary" @click="hideSearch">显示/隐藏搜索栏</el-button>
|
||||||
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
icon="el-icon-refresh"
|
||||||
|
@click="onReset"
|
||||||
|
>重置
|
||||||
|
</el-button>
|
||||||
|
<el-button type="primary" icon="el-icon-search" @click="onSubmit"
|
||||||
|
>查询
|
||||||
|
</el-button
|
||||||
|
>
|
||||||
|
<el-button type="primary" icon="el-icon-plus" @click="addOrders">新增单据</el-button>
|
||||||
|
</el-button-group>
|
||||||
|
</div>
|
||||||
|
<el-divider style="margin: 15px"></el-divider>
|
||||||
|
<el-table v-loading="loading" :data="list" style="width: 100%" highlight-current-row
|
||||||
|
border
|
||||||
|
>
|
||||||
|
<el-table-column type="selection" width="55"></el-table-column>
|
||||||
|
<el-table-column label="序号" type="index"></el-table-column>
|
||||||
|
<el-table-column label="扫码单据类型" prop="billTypeName">
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="订单号" prop="billNo" show-overflow-tooltip></el-table-column>
|
||||||
|
<el-table-column label="来源订单号" prop="corpOrderId" show-overflow-tooltip></el-table-column>
|
||||||
|
<el-table-column label="来源" prop="fromType">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span>{{ fromTypeMap[scope.row.fromType] }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="往来单位" prop="fromCorpName" width="220">
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="当前仓库" prop="invName" width="120">
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="所属科室" prop="deptName" width="120" v-if="enableDept">
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="创建时间" prop="createTime" show-overflow-tooltip>
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<i class="el-icon-time"></i>
|
||||||
|
<span>{{ scope.row.createTime }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="校验状态" prop="status" width="100">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-tag :type="statusFilterType(scope.row.status)">{{
|
||||||
|
checkStatus[scope.row.status]
|
||||||
|
}}
|
||||||
|
</el-tag>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="操作" width="150">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-button
|
||||||
|
type="text"
|
||||||
|
size="small"
|
||||||
|
@click.native.stop="editOrder(scope.row)"
|
||||||
|
>编辑
|
||||||
|
</el-button
|
||||||
|
>
|
||||||
|
<el-button
|
||||||
|
type="text"
|
||||||
|
size="small"
|
||||||
|
@click.native.stop="deleteDialog(scope.row.billNo)"
|
||||||
|
>删除
|
||||||
|
</el-button
|
||||||
|
>
|
||||||
|
<el-button
|
||||||
|
type="text"
|
||||||
|
size="small"
|
||||||
|
v-if="scope.row.status == 1"
|
||||||
|
@click.native.stop="onUpload(scope.row.billNo)"
|
||||||
|
>立即提交
|
||||||
|
</el-button
|
||||||
|
>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<el-dialog
|
||||||
|
:title="titleMap[title]"
|
||||||
|
:visible.sync="addOrderVisible"
|
||||||
|
width="85%"
|
||||||
|
append-to-body
|
||||||
|
:close-on-click-modal="false"
|
||||||
|
:close-on-press-escape="false"
|
||||||
|
v-if="addOrderVisible"
|
||||||
|
@close='closeDialog'
|
||||||
|
>
|
||||||
|
<addOrder
|
||||||
|
:closeDialog="closeDialog"
|
||||||
|
:orderQuery="idQuery"
|
||||||
|
:viewType="viewType"
|
||||||
|
></addOrder>
|
||||||
|
</el-dialog>
|
||||||
|
<pagination
|
||||||
|
v-show="total>0"
|
||||||
|
:total="total"
|
||||||
|
:page.sync="filterQuery.page"
|
||||||
|
:limit.sync="filterQuery.limit"
|
||||||
|
@pagination="getList"
|
||||||
|
/>
|
||||||
|
</el-card>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import {
|
||||||
|
deleteByOrderId,
|
||||||
|
submitOrderWeb,
|
||||||
|
getOrderList
|
||||||
|
} from "../../api/inout/order";
|
||||||
|
import addOrder from "./IoCreateOrder";
|
||||||
|
import {getInvListByUser} from "@/api/system/invWarehouse";
|
||||||
|
import {getLocalJoinByUser} from "@/api/basic/busType";
|
||||||
|
import {selectSysParamByKey} from "@/api/param/systemParamConfig";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: "IoCreateBusOrder",
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
showSearch: true,
|
||||||
|
titleMap: {
|
||||||
|
add: "新增单据",
|
||||||
|
edit: "编辑单据",
|
||||||
|
},
|
||||||
|
title: "add",
|
||||||
|
|
||||||
|
filterQuery: {
|
||||||
|
id: "",
|
||||||
|
billNo: null,
|
||||||
|
mainAction: null,
|
||||||
|
action: null,
|
||||||
|
statusType: "newOrder",
|
||||||
|
page: 1,
|
||||||
|
limit: 10,
|
||||||
|
startTime: null,
|
||||||
|
endTime: null,
|
||||||
|
invCode: this.$store.getters.locInvCode,
|
||||||
|
},
|
||||||
|
checkStatus: {
|
||||||
|
1: "草稿",
|
||||||
|
2: "等待处理",
|
||||||
|
3: "等待校验",
|
||||||
|
4: "处理异常",
|
||||||
|
5: "校验成功",
|
||||||
|
6: "校验异常",
|
||||||
|
7: "审核通过",
|
||||||
|
8: "审核拒绝",
|
||||||
|
9: "正在处理"
|
||||||
|
},
|
||||||
|
curIndex: "",
|
||||||
|
idQuery: {},
|
||||||
|
storageList: [],
|
||||||
|
invList: [],
|
||||||
|
list: [],
|
||||||
|
addOrderVisible: false,
|
||||||
|
total: 0,
|
||||||
|
loading: false,
|
||||||
|
index: null,
|
||||||
|
formName: null,
|
||||||
|
errorDetail: "",
|
||||||
|
formMap: {
|
||||||
|
add: "新增",
|
||||||
|
edit: "编辑",
|
||||||
|
},
|
||||||
|
enableDept: false,
|
||||||
|
fromTypeMap: {
|
||||||
|
"1": "UDIMS平台",
|
||||||
|
"2": "网页新增",
|
||||||
|
"3": "pda即时校验",
|
||||||
|
"4": "pda未校验",
|
||||||
|
"5": "pc端扫码精灵",
|
||||||
|
"6": "缺量补录单据",
|
||||||
|
"7": "UDI供应商平台",
|
||||||
|
"8": "平衡补录单据",
|
||||||
|
"10": "手动补单",
|
||||||
|
"11": "仓库盘点"
|
||||||
|
},
|
||||||
|
deleteData: {
|
||||||
|
billNo: "",
|
||||||
|
status: 10,
|
||||||
|
},
|
||||||
|
dialogTableVisible: false,
|
||||||
|
formLoading: false,
|
||||||
|
deleteLoading: false,
|
||||||
|
busTypes: [],
|
||||||
|
actDateRange: [],
|
||||||
|
pickerOptions: {
|
||||||
|
shortcuts: [
|
||||||
|
{
|
||||||
|
text: "最近一周",
|
||||||
|
onClick(picker) {
|
||||||
|
const end = new Date();
|
||||||
|
const start = new Date();
|
||||||
|
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
|
||||||
|
picker.$emit("pick", [start, end]);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: "最近一个月",
|
||||||
|
onClick(picker) {
|
||||||
|
const end = new Date();
|
||||||
|
const start = new Date();
|
||||||
|
start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
|
||||||
|
picker.$emit("pick", [start, end]);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: "最近三个月",
|
||||||
|
onClick(picker) {
|
||||||
|
const end = new Date();
|
||||||
|
const start = new Date();
|
||||||
|
start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
|
||||||
|
picker.$emit("pick", [start, end]);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
viewType: 2,
|
||||||
|
};
|
||||||
|
},
|
||||||
|
|
||||||
|
components: {
|
||||||
|
addOrder,
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
onReset() {
|
||||||
|
this.filterQuery = {
|
||||||
|
id: "",
|
||||||
|
billNo: null,
|
||||||
|
mainAction: null,
|
||||||
|
action: null,
|
||||||
|
statusType: "newOrder",
|
||||||
|
page: 1,
|
||||||
|
limit: 10,
|
||||||
|
startTime: null,
|
||||||
|
endTime: null,
|
||||||
|
invCode: this.$store.getters.locInvCode,
|
||||||
|
};
|
||||||
|
this.actDateRange = [];
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
onSubmit() {
|
||||||
|
if (this.actDateRange !== null) {
|
||||||
|
this.filterQuery.startTime = this.actDateRange[0];
|
||||||
|
this.filterQuery.endTime = this.actDateRange[1];
|
||||||
|
} else {
|
||||||
|
this.filterQuery.startTime = null;
|
||||||
|
this.filterQuery.endTime = null;
|
||||||
|
}
|
||||||
|
this.filterQuery.page = 1;
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
hideSearch() {
|
||||||
|
this.showSearch = !this.showSearch;
|
||||||
|
},
|
||||||
|
getBusType() {
|
||||||
|
let query = {
|
||||||
|
code: this.filterQuery.invCode,
|
||||||
|
enabled: true,
|
||||||
|
};
|
||||||
|
getLocalJoinByUser(query)
|
||||||
|
.then((response) => {
|
||||||
|
this.busTypes = response.data.list || [];
|
||||||
|
this.filterQuery.action = this.busTypes[0].action;
|
||||||
|
this.getList();
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
});
|
||||||
|
},
|
||||||
|
addOrders() {
|
||||||
|
this.idQuery = {};
|
||||||
|
this.title = "add";
|
||||||
|
this.addOrderVisible = true;
|
||||||
|
},
|
||||||
|
|
||||||
|
editOrder(row) {
|
||||||
|
this.idQuery = row;
|
||||||
|
this.title = "edit";
|
||||||
|
this.addOrderVisible = true;
|
||||||
|
},
|
||||||
|
|
||||||
|
closeDialog() {
|
||||||
|
this.addOrderVisible = false;
|
||||||
|
this.addHosOrderVisible = false;
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
|
||||||
|
//获取订单列表
|
||||||
|
getList() {
|
||||||
|
this.loading = true;
|
||||||
|
getOrderList(this.filterQuery)
|
||||||
|
.then((response) => {
|
||||||
|
this.loading = false;
|
||||||
|
if (response.code === 20000) {
|
||||||
|
this.list = response.data.list || [];
|
||||||
|
this.total = response.data.total || 0;
|
||||||
|
} else {
|
||||||
|
this.$message.error(response.message);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch((error) => {
|
||||||
|
this.$message.error(error.message)
|
||||||
|
this.loading = false;
|
||||||
|
this.list = [];
|
||||||
|
this.total = 0;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
deleteOrders(data) {
|
||||||
|
this.loading = true;
|
||||||
|
this.deleteData.billNo = data;
|
||||||
|
deleteByOrderId(this.deleteData)
|
||||||
|
.then((response) => {
|
||||||
|
|
||||||
|
if (response.code == 20000) {
|
||||||
|
this.getList();
|
||||||
|
this.$message({
|
||||||
|
type: "success",
|
||||||
|
message: "删除成功!",
|
||||||
|
});
|
||||||
|
} else if (response.code == 520) {
|
||||||
|
this.$message.error("新增扫码单据列表已不存在该扫码单据!");
|
||||||
|
this.getList();
|
||||||
|
}
|
||||||
|
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
});
|
||||||
|
},
|
||||||
|
deleteDialog(rowId) {
|
||||||
|
this.$confirm("此操作将永久删除该订单, 是否继续?", "提示", {
|
||||||
|
confirmButtonText: "确定",
|
||||||
|
cancelButtonText: "取消",
|
||||||
|
type: "warning",
|
||||||
|
})
|
||||||
|
.then(() => {
|
||||||
|
this.deleteOrders(rowId);
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
});
|
||||||
|
},
|
||||||
|
onUpload(data) {
|
||||||
|
this.loading = true;
|
||||||
|
var idQuery = {
|
||||||
|
billNo: "",
|
||||||
|
};
|
||||||
|
idQuery.billNo = data;
|
||||||
|
submitOrderWeb(idQuery)
|
||||||
|
.then((response) => {
|
||||||
|
this.loading = false;
|
||||||
|
if (response.code === 20000) {
|
||||||
|
this.$message.success("提交成功");
|
||||||
|
} else {
|
||||||
|
this.$message.error(response.message);
|
||||||
|
}
|
||||||
|
this.loading = false;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
getInvList() {
|
||||||
|
getInvListByUser()
|
||||||
|
.then((response) => {
|
||||||
|
this.invList = response.data || [];
|
||||||
|
this.getList();
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
});
|
||||||
|
},
|
||||||
|
invChange() {
|
||||||
|
this.filterQuery.action = null;
|
||||||
|
this.getBusType();
|
||||||
|
},
|
||||||
|
|
||||||
|
statusFilterType(status) {
|
||||||
|
const statusMap = {
|
||||||
|
2: "warning",
|
||||||
|
1: "warning",
|
||||||
|
4: "danger",
|
||||||
|
3: "success",
|
||||||
|
};
|
||||||
|
return statusMap[status];
|
||||||
|
},
|
||||||
|
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
document.body.ondrop = function (event) {
|
||||||
|
event.preventDefault();
|
||||||
|
event.stopPropagation();
|
||||||
|
};
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.getInvList();
|
||||||
|
this.getBusType();
|
||||||
|
let query = this.$route.query;
|
||||||
|
this.filterQuery = Object.assign(this.filterQuery, query);
|
||||||
|
this.filterQuery.limit = parseInt(this.filterQuery.limit);
|
||||||
|
selectSysParamByKey({paramKey: "muti_inv_mode"}).then((res) => {
|
||||||
|
if (res.code === 20000) {
|
||||||
|
if (res.data.paramValue === "0") {
|
||||||
|
this.enableDept = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style type="text/scss" lang="scss">
|
||||||
|
</style>
|
||||||
|
|
@ -0,0 +1,482 @@
|
|||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<el-card class="el-card">
|
||||||
|
<el-form :model="filterQuery" class="query-form" size="mini" label-width="100px" v-show="showSearch">
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="6">
|
||||||
|
<el-form-item class="query-form-item" label="单号:">
|
||||||
|
<el-input v-model="filterQuery.billNo" placeholder="单号"
|
||||||
|
style="width: 90%"
|
||||||
|
clearable="true"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="6">
|
||||||
|
<el-form-item class="query-form-item" label="出入库类型:">
|
||||||
|
<el-select v-model="filterQuery.mainAction" placeholder="请选择出入库类型" style="width: 90%">
|
||||||
|
<el-option label="全部" value=""></el-option>
|
||||||
|
<el-option label="入库" value="WareHouseIn"></el-option>
|
||||||
|
<el-option label="出库" value="WareHouseOut"></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="6">
|
||||||
|
<el-form-item class="query-form-item" label="单据类型:">
|
||||||
|
<el-select v-model="filterQuery.action" placeholder="请选择单据类型"
|
||||||
|
style="width: 90%"
|
||||||
|
clearable>
|
||||||
|
<el-option
|
||||||
|
v-for="item in busTypes"
|
||||||
|
:key="item.name"
|
||||||
|
:label="item.name"
|
||||||
|
:value="item.action">
|
||||||
|
<span style="float: left">{{ item.name }}</span>
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="6">
|
||||||
|
<el-form-item class="query-form-item" label="所属仓库:">
|
||||||
|
<el-select v-model="filterQuery.invCode" placeholder="请选择所属仓库" clearable="true"
|
||||||
|
style="width: 90%"
|
||||||
|
@change="invChange"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in invList"
|
||||||
|
:key="item.name"
|
||||||
|
:label="item.name"
|
||||||
|
:value="item.code">
|
||||||
|
<span style="float: left">{{ item.name }}</span>
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="6">
|
||||||
|
<el-form-item class="query-form-item" label="创建时间:">
|
||||||
|
<el-date-picker
|
||||||
|
:picker-options="pickerOptions"
|
||||||
|
v-model="actDateRange"
|
||||||
|
type="daterange"
|
||||||
|
format="yyyy 年 MM 月 dd 日"
|
||||||
|
value-format="yyyy-MM-dd"
|
||||||
|
range-separator="至"
|
||||||
|
start-placeholder="开始日期"
|
||||||
|
end-placeholder="结束日期"
|
||||||
|
style="width: 90%"
|
||||||
|
>
|
||||||
|
</el-date-picker>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-form>
|
||||||
|
<div class="top-right-btn">
|
||||||
|
<el-button-group>
|
||||||
|
<el-button icon="el-icon-view" type="primary" @click="hideSearch">显示/隐藏搜索栏</el-button>
|
||||||
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
icon="el-icon-refresh"
|
||||||
|
@click="onReset"
|
||||||
|
>重置
|
||||||
|
</el-button>
|
||||||
|
<el-button type="primary" icon="el-icon-search" @click="onSubmit"
|
||||||
|
>查询
|
||||||
|
</el-button
|
||||||
|
>
|
||||||
|
<el-button type="primary" icon="el-icon-plus" @click="addOrders">新增单据</el-button>
|
||||||
|
</el-button-group>
|
||||||
|
</div>
|
||||||
|
<el-divider style="margin: 15px"></el-divider>
|
||||||
|
<el-table v-loading="loading" :data="list" style="width: 100%" highlight-current-row
|
||||||
|
border
|
||||||
|
>
|
||||||
|
<el-table-column type="selection" width="55"></el-table-column>
|
||||||
|
<el-table-column label="序号" type="index"></el-table-column>
|
||||||
|
<el-table-column label="扫码单据类型" prop="billTypeName">
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="订单号" prop="billNo" show-overflow-tooltip></el-table-column>
|
||||||
|
<el-table-column label="来源订单号" prop="corpOrderId" show-overflow-tooltip></el-table-column>
|
||||||
|
<el-table-column label="来源" prop="fromType">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span>{{ fromTypeMap[scope.row.fromType] }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="往来单位" prop="fromCorpName" width="220">
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="当前仓库" prop="invName" width="120">
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="所属科室" prop="deptName" width="120" v-if="enableDept">
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="创建时间" prop="createTime" show-overflow-tooltip>
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<i class="el-icon-time"></i>
|
||||||
|
<span>{{ scope.row.createTime }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="校验状态" prop="status" width="100">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-tag :type="statusFilterType(scope.row.status)">{{
|
||||||
|
checkStatus[scope.row.status]
|
||||||
|
}}
|
||||||
|
</el-tag>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="操作" width="150">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-button
|
||||||
|
type="text"
|
||||||
|
size="small"
|
||||||
|
@click.native.stop="editOrder(scope.row)"
|
||||||
|
>编辑
|
||||||
|
</el-button
|
||||||
|
>
|
||||||
|
<el-button
|
||||||
|
type="text"
|
||||||
|
size="small"
|
||||||
|
@click.native.stop="deleteDialog(scope.row.billNo)"
|
||||||
|
>删除
|
||||||
|
</el-button
|
||||||
|
>
|
||||||
|
<el-button
|
||||||
|
type="text"
|
||||||
|
size="small"
|
||||||
|
v-if="scope.row.status == 1"
|
||||||
|
@click.native.stop="onUpload(scope.row.billNo)"
|
||||||
|
>立即提交
|
||||||
|
</el-button
|
||||||
|
>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<el-dialog
|
||||||
|
:title="titleMap[title]"
|
||||||
|
:visible.sync="addOrderVisible"
|
||||||
|
width="85%"
|
||||||
|
append-to-body
|
||||||
|
:close-on-click-modal="false"
|
||||||
|
:close-on-press-escape="false"
|
||||||
|
v-if="addOrderVisible"
|
||||||
|
@close='closeDialog'
|
||||||
|
>
|
||||||
|
<addOrder
|
||||||
|
:closeDialog="closeDialog"
|
||||||
|
:orderQuery="idQuery"
|
||||||
|
:viewType="viewType"
|
||||||
|
></addOrder>
|
||||||
|
</el-dialog>
|
||||||
|
<pagination
|
||||||
|
v-show="total>0"
|
||||||
|
:total="total"
|
||||||
|
:page.sync="filterQuery.page"
|
||||||
|
:limit.sync="filterQuery.limit"
|
||||||
|
@pagination="getList"
|
||||||
|
/>
|
||||||
|
</el-card>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import {
|
||||||
|
deleteByOrderId,
|
||||||
|
submitOrderWeb,
|
||||||
|
getOrderList
|
||||||
|
} from "../../api/inout/order";
|
||||||
|
import addOrder from "./IoCreateOrder";
|
||||||
|
import {getInvListByUser} from "@/api/system/invWarehouse";
|
||||||
|
import {getLocalJoinByUser} from "@/api/basic/busType";
|
||||||
|
import {selectSysParamByKey} from "@/api/param/systemParamConfig";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: "IoCreateScanOrder",
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
showSearch: true,
|
||||||
|
titleMap: {
|
||||||
|
add: "新增单据",
|
||||||
|
edit: "编辑单据",
|
||||||
|
},
|
||||||
|
title: "add",
|
||||||
|
|
||||||
|
filterQuery: {
|
||||||
|
id: "",
|
||||||
|
billNo: null,
|
||||||
|
mainAction: null,
|
||||||
|
action: null,
|
||||||
|
statusType: "newOrder",
|
||||||
|
page: 1,
|
||||||
|
limit: 10,
|
||||||
|
startTime: null,
|
||||||
|
endTime: null,
|
||||||
|
invCode: this.$store.getters.locInvCode,
|
||||||
|
},
|
||||||
|
checkStatus: {
|
||||||
|
1: "草稿",
|
||||||
|
2: "等待处理",
|
||||||
|
3: "等待校验",
|
||||||
|
4: "处理异常",
|
||||||
|
5: "校验成功",
|
||||||
|
6: "校验异常",
|
||||||
|
7: "审核通过",
|
||||||
|
8: "审核拒绝",
|
||||||
|
9: "正在处理"
|
||||||
|
},
|
||||||
|
curIndex: "",
|
||||||
|
idQuery: {},
|
||||||
|
storageList: [],
|
||||||
|
invList: [],
|
||||||
|
list: [],
|
||||||
|
addOrderVisible: false,
|
||||||
|
total: 0,
|
||||||
|
loading: false,
|
||||||
|
index: null,
|
||||||
|
formName: null,
|
||||||
|
errorDetail: "",
|
||||||
|
formMap: {
|
||||||
|
add: "新增",
|
||||||
|
edit: "编辑",
|
||||||
|
},
|
||||||
|
enableDept: false,
|
||||||
|
fromTypeMap: {
|
||||||
|
"1": "UDIMS平台",
|
||||||
|
"2": "网页新增",
|
||||||
|
"3": "pda即时校验",
|
||||||
|
"4": "pda未校验",
|
||||||
|
"5": "pc端扫码精灵",
|
||||||
|
"6": "缺量补录单据",
|
||||||
|
"7": "UDI供应商平台",
|
||||||
|
"8": "平衡补录单据",
|
||||||
|
"10": "手动补单",
|
||||||
|
"11": "仓库盘点"
|
||||||
|
},
|
||||||
|
deleteData: {
|
||||||
|
billNo: "",
|
||||||
|
status: 10,
|
||||||
|
},
|
||||||
|
dialogTableVisible: false,
|
||||||
|
formLoading: false,
|
||||||
|
deleteLoading: false,
|
||||||
|
busTypes: [],
|
||||||
|
actDateRange: [],
|
||||||
|
pickerOptions: {
|
||||||
|
shortcuts: [
|
||||||
|
{
|
||||||
|
text: "最近一周",
|
||||||
|
onClick(picker) {
|
||||||
|
const end = new Date();
|
||||||
|
const start = new Date();
|
||||||
|
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
|
||||||
|
picker.$emit("pick", [start, end]);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: "最近一个月",
|
||||||
|
onClick(picker) {
|
||||||
|
const end = new Date();
|
||||||
|
const start = new Date();
|
||||||
|
start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
|
||||||
|
picker.$emit("pick", [start, end]);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: "最近三个月",
|
||||||
|
onClick(picker) {
|
||||||
|
const end = new Date();
|
||||||
|
const start = new Date();
|
||||||
|
start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
|
||||||
|
picker.$emit("pick", [start, end]);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
viewType: 1,
|
||||||
|
};
|
||||||
|
},
|
||||||
|
|
||||||
|
components: {
|
||||||
|
addOrder,
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
onReset() {
|
||||||
|
this.filterQuery = {
|
||||||
|
id: "",
|
||||||
|
billNo: null,
|
||||||
|
mainAction: null,
|
||||||
|
action: null,
|
||||||
|
statusType: "newOrder",
|
||||||
|
page: 1,
|
||||||
|
limit: 10,
|
||||||
|
startTime: null,
|
||||||
|
endTime: null,
|
||||||
|
invCode: this.$store.getters.locInvCode,
|
||||||
|
};
|
||||||
|
this.actDateRange = [];
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
onSubmit() {
|
||||||
|
if (this.actDateRange !== null) {
|
||||||
|
this.filterQuery.startTime = this.actDateRange[0];
|
||||||
|
this.filterQuery.endTime = this.actDateRange[1];
|
||||||
|
} else {
|
||||||
|
this.filterQuery.startTime = null;
|
||||||
|
this.filterQuery.endTime = null;
|
||||||
|
}
|
||||||
|
this.filterQuery.page = 1;
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
hideSearch() {
|
||||||
|
this.showSearch = !this.showSearch;
|
||||||
|
},
|
||||||
|
getBusType() {
|
||||||
|
let query = {
|
||||||
|
code: this.filterQuery.invCode,
|
||||||
|
enabled: true,
|
||||||
|
};
|
||||||
|
getLocalJoinByUser(query)
|
||||||
|
.then((response) => {
|
||||||
|
this.busTypes = response.data.list || [];
|
||||||
|
this.filterQuery.action = this.busTypes[0].action;
|
||||||
|
this.getList();
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
});
|
||||||
|
},
|
||||||
|
addOrders() {
|
||||||
|
this.idQuery = {};
|
||||||
|
this.title = "add";
|
||||||
|
this.addOrderVisible = true;
|
||||||
|
},
|
||||||
|
|
||||||
|
editOrder(row) {
|
||||||
|
this.idQuery = row;
|
||||||
|
this.title = "edit";
|
||||||
|
this.addOrderVisible = true;
|
||||||
|
},
|
||||||
|
|
||||||
|
closeDialog() {
|
||||||
|
this.addOrderVisible = false;
|
||||||
|
this.addHosOrderVisible = false;
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
|
||||||
|
//获取订单列表
|
||||||
|
getList() {
|
||||||
|
this.loading = true;
|
||||||
|
getOrderList(this.filterQuery)
|
||||||
|
.then((response) => {
|
||||||
|
this.loading = false;
|
||||||
|
if (response.code === 20000) {
|
||||||
|
this.list = response.data.list || [];
|
||||||
|
this.total = response.data.total || 0;
|
||||||
|
} else {
|
||||||
|
this.$message.error(response.message);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch((error) => {
|
||||||
|
this.$message.error(error.message)
|
||||||
|
this.loading = false;
|
||||||
|
this.list = [];
|
||||||
|
this.total = 0;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
deleteOrders(data) {
|
||||||
|
this.loading = true;
|
||||||
|
this.deleteData.billNo = data;
|
||||||
|
deleteByOrderId(this.deleteData)
|
||||||
|
.then((response) => {
|
||||||
|
|
||||||
|
if (response.code == 20000) {
|
||||||
|
this.getList();
|
||||||
|
this.$message({
|
||||||
|
type: "success",
|
||||||
|
message: "删除成功!",
|
||||||
|
});
|
||||||
|
} else if (response.code == 520) {
|
||||||
|
this.$message.error("新增扫码单据列表已不存在该扫码单据!");
|
||||||
|
this.getList();
|
||||||
|
}
|
||||||
|
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
});
|
||||||
|
},
|
||||||
|
deleteDialog(rowId) {
|
||||||
|
this.$confirm("此操作将永久删除该订单, 是否继续?", "提示", {
|
||||||
|
confirmButtonText: "确定",
|
||||||
|
cancelButtonText: "取消",
|
||||||
|
type: "warning",
|
||||||
|
})
|
||||||
|
.then(() => {
|
||||||
|
this.deleteOrders(rowId);
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
});
|
||||||
|
},
|
||||||
|
onUpload(data) {
|
||||||
|
this.loading = true;
|
||||||
|
var idQuery = {
|
||||||
|
billNo: "",
|
||||||
|
};
|
||||||
|
idQuery.billNo = data;
|
||||||
|
submitOrderWeb(idQuery)
|
||||||
|
.then((response) => {
|
||||||
|
this.loading = false;
|
||||||
|
if (response.code === 20000) {
|
||||||
|
this.$message.success("提交成功");
|
||||||
|
} else {
|
||||||
|
this.$message.error(response.message);
|
||||||
|
}
|
||||||
|
this.loading = false;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
getInvList() {
|
||||||
|
getInvListByUser()
|
||||||
|
.then((response) => {
|
||||||
|
this.invList = response.data || [];
|
||||||
|
this.getList();
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
});
|
||||||
|
},
|
||||||
|
invChange() {
|
||||||
|
this.filterQuery.action = null;
|
||||||
|
this.getBusType();
|
||||||
|
},
|
||||||
|
|
||||||
|
statusFilterType(status) {
|
||||||
|
const statusMap = {
|
||||||
|
2: "warning",
|
||||||
|
1: "warning",
|
||||||
|
4: "danger",
|
||||||
|
3: "success",
|
||||||
|
};
|
||||||
|
return statusMap[status];
|
||||||
|
},
|
||||||
|
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
document.body.ondrop = function (event) {
|
||||||
|
event.preventDefault();
|
||||||
|
event.stopPropagation();
|
||||||
|
};
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.getInvList();
|
||||||
|
this.getBusType();
|
||||||
|
let query = this.$route.query;
|
||||||
|
this.filterQuery = Object.assign(this.filterQuery, query);
|
||||||
|
this.filterQuery.limit = parseInt(this.filterQuery.limit);
|
||||||
|
selectSysParamByKey({paramKey: "muti_inv_mode"}).then((res) => {
|
||||||
|
if (res.code === 20000) {
|
||||||
|
if (res.data.paramValue === "0") {
|
||||||
|
this.enableDept = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style type="text/scss" lang="scss">
|
||||||
|
</style>
|
||||||
|
|
@ -0,0 +1,474 @@
|
|||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<el-card class="el-card">
|
||||||
|
<el-form :inline="true" :model="filterQuery"
|
||||||
|
class="query-form" size="mini">
|
||||||
|
<el-row>
|
||||||
|
<el-form-item class="query-form-item">
|
||||||
|
<el-input
|
||||||
|
v-model="filterQuery.billNo"
|
||||||
|
placeholder="单据号"
|
||||||
|
clearable
|
||||||
|
></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item class="query-form-item">
|
||||||
|
<el-input
|
||||||
|
v-model="filterQuery.corpName"
|
||||||
|
placeholder="往来信息"
|
||||||
|
clearable
|
||||||
|
></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item class="query-form-item">
|
||||||
|
<el-select v-model="filterQuery.billAction" placeholder="领用类型" clearable="true">
|
||||||
|
<el-option
|
||||||
|
v-for="item in originTypes"
|
||||||
|
:key="item.name"
|
||||||
|
:label="item.name"
|
||||||
|
:value="item.action">
|
||||||
|
<span style="float: left;font-size: 13px">{{ item.name }}</span>
|
||||||
|
<span style="float: right; color: #8492a6; font-size: 13px;margin-left: 10px">{{
|
||||||
|
item.thirdSysName
|
||||||
|
}}</span>
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item class="query-form-item">
|
||||||
|
<span style="color: #000; margin-left: 10px; margin-right: 6px">单据日期:</span>
|
||||||
|
<el-date-picker
|
||||||
|
:picker-options="pickerOptions"
|
||||||
|
v-model="actDateRange"
|
||||||
|
type="daterange"
|
||||||
|
format="yyyy 年 MM 月 dd 日"
|
||||||
|
value-format="yyyy-MM-dd"
|
||||||
|
range-separator="至"
|
||||||
|
start-placeholder="开始日期"
|
||||||
|
end-placeholder="结束日期"
|
||||||
|
>
|
||||||
|
</el-date-picker>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
|
<el-button-group style="display:flex;">
|
||||||
|
<el-button type="primary" icon="el-icon-refresh" @click="onReset"></el-button>
|
||||||
|
<el-button type="primary" icon="search" @click="onSubmitFind">查询</el-button>
|
||||||
|
<el-button type="primary" icon="search" @click="newDistributionForm()" :loading="loading">
|
||||||
|
新增单据
|
||||||
|
</el-button>
|
||||||
|
</el-button-group>
|
||||||
|
</el-form-item>
|
||||||
|
</el-row>
|
||||||
|
</el-form>
|
||||||
|
<el-table v-loading="loading" :data="list" style="width: 100%" highlight-current-row="true"
|
||||||
|
border
|
||||||
|
@current-change="handleDetail">
|
||||||
|
<el-table-column label="序号" type="index" width="60"></el-table-column>
|
||||||
|
<el-table-column label="领用类型" prop="billType"></el-table-column>
|
||||||
|
<el-table-column label="单据号" prop="billNo"></el-table-column>
|
||||||
|
<el-table-column label="领用仓库" prop="invName"></el-table-column>
|
||||||
|
<el-table-column label="往来信息" prop="targetInvName"
|
||||||
|
show-overflow-tooltip="true"></el-table-column>
|
||||||
|
<el-table-column label="单据日期" prop="billDate"></el-table-column>
|
||||||
|
<el-table-column label="操作">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-button
|
||||||
|
type="text"
|
||||||
|
size="small"
|
||||||
|
@click.native="newDistributionForm(scope.$index, scope.row)"
|
||||||
|
>编辑
|
||||||
|
</el-button
|
||||||
|
>
|
||||||
|
<el-button type="text" size="small" @click.native.stop="deleteDialog(scope.row)"
|
||||||
|
>删除
|
||||||
|
</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<el-pagination
|
||||||
|
:page-size="filterQuery.limit"
|
||||||
|
@current-change="handleCurrentChange"
|
||||||
|
layout="prev, pager, next"
|
||||||
|
:total="total"
|
||||||
|
:current-page="filterQuery.page"
|
||||||
|
></el-pagination>
|
||||||
|
</el-card>
|
||||||
|
<el-card class="el-card">
|
||||||
|
<el-table v-loading="loading" :data="detailList" style="width: 100%" border>
|
||||||
|
<el-table-column label="序号" type="index" width="120"></el-table-column>
|
||||||
|
<el-table-column label="产品编码" prop="productId"></el-table-column>
|
||||||
|
<el-table-column label="产品通用名" prop="productName" show-overflow-tooltip="true"></el-table-column>
|
||||||
|
<el-table-column label="规格型号" prop="spec" show-overflow-tooltip="true"></el-table-column>
|
||||||
|
<el-table-column label="批次号" prop="batchNo"></el-table-column>
|
||||||
|
<el-table-column label="生产日期" prop="productDate"></el-table-column>
|
||||||
|
<el-table-column label="失效日期" prop="expireDate"></el-table-column>
|
||||||
|
<el-table-column label="单据数量" prop="count"></el-table-column>
|
||||||
|
</el-table>
|
||||||
|
</el-card>
|
||||||
|
<el-dialog
|
||||||
|
:title="formMap[formName]"
|
||||||
|
:visible.sync="newSpDistributionVisible"
|
||||||
|
width="80%"
|
||||||
|
v-if="newSpDistributionVisible"
|
||||||
|
@close='closeDialog'
|
||||||
|
:close-on-click-modal="false"
|
||||||
|
:close-on-press-escape="false"
|
||||||
|
>
|
||||||
|
<thrOrderNew
|
||||||
|
:closeDialog="closeDialog"
|
||||||
|
:idQuery="idQuery"
|
||||||
|
:closeConfirmFunction="closeConfirmFunction"
|
||||||
|
:editType="formName"
|
||||||
|
></thrOrderNew>
|
||||||
|
</el-dialog>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
import {
|
||||||
|
delThrOrders, delAll, downloadAll
|
||||||
|
} from "@/api/thrsys/thrOrder";
|
||||||
|
import {getLocalJoinByUser} from "@/api/basic/busType";
|
||||||
|
import {getOriginBusType} from "@/api/basic/busOriginType";
|
||||||
|
|
||||||
|
import {filterDetailByKey} from "@/api/basic/basicThirdSys";
|
||||||
|
import {selectIp} from "@/api/param/systemParamConfig";
|
||||||
|
import thrOrderNew from "./thrOrderNew";
|
||||||
|
import {getReceiveOrder} from "@/api/inout/receiveOrder";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
filterQuery: {
|
||||||
|
billType: null,
|
||||||
|
billNo: "",
|
||||||
|
page: 1,
|
||||||
|
limit: 10,
|
||||||
|
type: 1,
|
||||||
|
editStatus: 1,
|
||||||
|
thirdPartyDate: 2,
|
||||||
|
},
|
||||||
|
formName: null,
|
||||||
|
formMap: {
|
||||||
|
add: "新增领用单据",
|
||||||
|
update: "编辑领用单据",
|
||||||
|
},
|
||||||
|
|
||||||
|
idQuery: {},
|
||||||
|
total: 0,
|
||||||
|
thirdSys: [],
|
||||||
|
thirdSysDetail: null,
|
||||||
|
busTypes: [],
|
||||||
|
originTypes: [],
|
||||||
|
list: [],
|
||||||
|
detailList: [],
|
||||||
|
uploadFileUrl: null,
|
||||||
|
fileList: [],
|
||||||
|
uploadData: {
|
||||||
|
thirdSys: "thirdId",
|
||||||
|
},
|
||||||
|
closeConfirm: false,
|
||||||
|
loading: false,
|
||||||
|
actDateRange: [],
|
||||||
|
newSpDistributionVisible: false,
|
||||||
|
pickerOptions: {
|
||||||
|
shortcuts: [
|
||||||
|
{
|
||||||
|
text: "最近一周",
|
||||||
|
onClick(picker) {
|
||||||
|
const end = new Date();
|
||||||
|
const start = new Date();
|
||||||
|
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
|
||||||
|
picker.$emit("pick", [start, end]);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: "最近一个月",
|
||||||
|
onClick(picker) {
|
||||||
|
const end = new Date();
|
||||||
|
const start = new Date();
|
||||||
|
start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
|
||||||
|
picker.$emit("pick", [start, end]);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: "最近三个月",
|
||||||
|
onClick(picker) {
|
||||||
|
const end = new Date();
|
||||||
|
const start = new Date();
|
||||||
|
start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
|
||||||
|
picker.$emit("pick", [start, end]);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
};
|
||||||
|
},
|
||||||
|
|
||||||
|
methods: {
|
||||||
|
onReset() {
|
||||||
|
this.$router.push({
|
||||||
|
path: "",
|
||||||
|
});
|
||||||
|
this.filterQuery = {
|
||||||
|
billNo: "",
|
||||||
|
thirdSysFk: "",
|
||||||
|
billFlag: null,
|
||||||
|
billAction: null,
|
||||||
|
startDate: null,
|
||||||
|
endDate: null,
|
||||||
|
page: 1,
|
||||||
|
limit: 10,
|
||||||
|
corpName: null,
|
||||||
|
type: 1,
|
||||||
|
editStatus: 1,
|
||||||
|
thirdPartyDate: 2,
|
||||||
|
};
|
||||||
|
this.actDateRange = [];
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
|
||||||
|
onSubmitFind() {
|
||||||
|
this.filterQuery.page = 1;
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
|
||||||
|
getList() {
|
||||||
|
if (this.actDateRange != null) {
|
||||||
|
this.filterQuery.startDate = this.actDateRange[0];
|
||||||
|
this.filterQuery.endDate = this.actDateRange[1];
|
||||||
|
} else {
|
||||||
|
this.filterQuery.startDate = null;
|
||||||
|
this.filterQuery.endDate = null;
|
||||||
|
}
|
||||||
|
this.loading = true;
|
||||||
|
getReceiveOrder(this.filterQuery)
|
||||||
|
.then((response) => {
|
||||||
|
if (response.code == 20000) {
|
||||||
|
this.list = response.data.list || [];
|
||||||
|
this.total = response.data.total || 0;
|
||||||
|
} else {
|
||||||
|
this.$message.error(response.message);
|
||||||
|
}
|
||||||
|
this.loading = false;
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
this.loading = false;
|
||||||
|
this.list = [];
|
||||||
|
this.total = 0;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
handleDetail(row) {
|
||||||
|
this.detailList = row.subErpOrders;
|
||||||
|
},
|
||||||
|
deleteDialog(row) {
|
||||||
|
this.$confirm("此操作将永久删除该单据, 是否继续?", "提示", {
|
||||||
|
confirmButtonText: "确定",
|
||||||
|
cancelButtonText: "取消",
|
||||||
|
type: "warning",
|
||||||
|
})
|
||||||
|
.then(() => {
|
||||||
|
let dQuery = {
|
||||||
|
id: row.id,
|
||||||
|
};
|
||||||
|
delThrOrders(dQuery)
|
||||||
|
.then((response) => {
|
||||||
|
this.loading = false;
|
||||||
|
if (response.code == 20000) {
|
||||||
|
this.$message.success("删除成功");
|
||||||
|
this.getList();
|
||||||
|
} else {
|
||||||
|
this.$message.error(response.message);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
this.loading = false;
|
||||||
|
});
|
||||||
|
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
});
|
||||||
|
},
|
||||||
|
clearAll() {
|
||||||
|
this.$confirm("此操作将清空所有单据, 是否继续?", "提示", {
|
||||||
|
confirmButtonText: "确定",
|
||||||
|
cancelButtonText: "取消",
|
||||||
|
type: "warning",
|
||||||
|
})
|
||||||
|
.then(() => {
|
||||||
|
delAll()
|
||||||
|
.then((response) => {
|
||||||
|
this.loading = false;
|
||||||
|
if (response.code == 20000) {
|
||||||
|
this.$message.success("删除成功");
|
||||||
|
this.getList();
|
||||||
|
} else {
|
||||||
|
this.$message.success(response.message);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
this.loading = false;
|
||||||
|
});
|
||||||
|
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
});
|
||||||
|
},
|
||||||
|
handleCurrentChange(val) {
|
||||||
|
this.filterQuery.page = val;
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
handleChange(response, files, fileList) {
|
||||||
|
console.log(response);
|
||||||
|
if (response.code != 20000) {
|
||||||
|
this.$message.error(response.message);
|
||||||
|
} else {
|
||||||
|
console.log(files[0] + "\n" + this.fileList[0] + "\n" + fileList[0]);
|
||||||
|
this.$message.success("文件上传成功,请稍后刷新查看!");
|
||||||
|
}
|
||||||
|
},
|
||||||
|
selectSysParam() {
|
||||||
|
let query = {
|
||||||
|
key: "thirdIpUrl",
|
||||||
|
thirdSysFk: this.filterQuery.thirdSysFk
|
||||||
|
};
|
||||||
|
selectIp(query).then((response) => {
|
||||||
|
if (response.code == 20000) {
|
||||||
|
this.uploadFileUrl = response.data.thridUrl + "/udiwms/erp/pi/upload";
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
thirdSysChange() {
|
||||||
|
this.uploadData.thirdSys = this.filterQuery.thirdSysFk;
|
||||||
|
this.getThirdSysDetail();
|
||||||
|
},
|
||||||
|
getThirdSysDetail() {
|
||||||
|
let query = {
|
||||||
|
thirdSysFk: this.filterQuery.thirdSysFk,
|
||||||
|
key: "orderQueryUrl",
|
||||||
|
};
|
||||||
|
filterDetailByKey(query)
|
||||||
|
.then((response) => {
|
||||||
|
this.thirdSysDetail = response.data;
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
this.loading = false;
|
||||||
|
this.list = [];
|
||||||
|
});
|
||||||
|
|
||||||
|
},
|
||||||
|
downloadDatas() {
|
||||||
|
let query = {
|
||||||
|
billAction: this.filterQuery.billAction
|
||||||
|
};
|
||||||
|
downloadAll(query).then((response) => {
|
||||||
|
if (response.code == 20000) {
|
||||||
|
this.$message.success(response.data);
|
||||||
|
} else {
|
||||||
|
this.$message.error(response.message);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
},
|
||||||
|
getActionName(action) {
|
||||||
|
for (let i = 0; i < this.busTypes.length; i++) {
|
||||||
|
if (this.busTypes[i].action === action) {
|
||||||
|
return this.busTypes[i].name;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
closeConfirmFunction(type) {
|
||||||
|
if (this.$isNotBlank(type) && type) {
|
||||||
|
this.closeConfirm = type;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
getlocalName(action) {
|
||||||
|
for (let i = 0; i < this.busTypes.length; i++) {
|
||||||
|
if (this.busTypes[i].action === action) {
|
||||||
|
return this.busTypes[i].localName;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
getBusType() {
|
||||||
|
let query = {
|
||||||
|
enabled: true,
|
||||||
|
corpType: 1,
|
||||||
|
};
|
||||||
|
getLocalJoinByUser(query)
|
||||||
|
.then((response) => {
|
||||||
|
this.busTypes = response.data.list || [];
|
||||||
|
// this.getList();
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
});
|
||||||
|
getOriginBusType(query)
|
||||||
|
.then((response) => {
|
||||||
|
this.originTypes = response.data.list || [];
|
||||||
|
// this.filterQuery.originType = this.originTypes[0].action;
|
||||||
|
// this.getList();
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
closeDialog() {
|
||||||
|
this.newSpDistributionVisible = false;
|
||||||
|
this.getList();
|
||||||
|
this.detailList = [];
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
newDistributionForm(index, row) {
|
||||||
|
this.idQuery.id = '';
|
||||||
|
if (this.$isNotBlank(row) && this.$isNotBlank(row.id)) {
|
||||||
|
this.idQuery.id = row.id;
|
||||||
|
this.idQuery.formData = row;
|
||||||
|
this.formName = "update";
|
||||||
|
} else
|
||||||
|
this.formName = "add";
|
||||||
|
this.newSpDistributionVisible = true;
|
||||||
|
},
|
||||||
|
|
||||||
|
},
|
||||||
|
components: {
|
||||||
|
thrOrderNew,
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
let end = new Date();
|
||||||
|
let start = new Date();
|
||||||
|
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
|
||||||
|
this.actDateRange = [start, end];
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
<style scoped>
|
||||||
|
.itemTag {
|
||||||
|
float: left;
|
||||||
|
text-align: left;
|
||||||
|
margin-top: 10px;
|
||||||
|
width: 25%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.text {
|
||||||
|
font-size: 13px;
|
||||||
|
font-family: "Microsoft YaHei";
|
||||||
|
}
|
||||||
|
|
||||||
|
.query-form-item {
|
||||||
|
display: block !important;
|
||||||
|
margin-right: 10px;
|
||||||
|
margin-bottom: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-row {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-col {
|
||||||
|
border-radius: 4px;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
@ -0,0 +1,435 @@
|
|||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<el-card class="el-card">
|
||||||
|
<el-form :inline="true" :model="filterQuery"
|
||||||
|
class="query-form" size="mini">
|
||||||
|
<el-row>
|
||||||
|
<el-form-item class="query-form-item">
|
||||||
|
<el-input
|
||||||
|
v-model="filterQuery.billNo"
|
||||||
|
placeholder="单据号"
|
||||||
|
clearable
|
||||||
|
></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item class="query-form-item">
|
||||||
|
<el-input
|
||||||
|
v-model="filterQuery.corpName"
|
||||||
|
placeholder="往来单位"
|
||||||
|
clearable
|
||||||
|
></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item class="query-form-item">
|
||||||
|
|
||||||
|
<el-select v-model="filterQuery.billAction" placeholder="请选择第三方系统单据类型" clearable="true">
|
||||||
|
<el-option
|
||||||
|
v-for="item in originTypes"
|
||||||
|
:key="item.name"
|
||||||
|
:label="item.name"
|
||||||
|
:value="item.action">
|
||||||
|
<span style="float: left;font-size: 13px">{{ item.name }}</span>
|
||||||
|
<span style="float: right; color: #8492a6; font-size: 13px;margin-left: 10px">{{
|
||||||
|
item.thirdSysName
|
||||||
|
}}</span>
|
||||||
|
</el-option>
|
||||||
|
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item class="query-form-item">
|
||||||
|
<span style="color: #000; margin-left: 10px; margin-right: 6px">单据日期:</span>
|
||||||
|
<el-date-picker
|
||||||
|
:picker-options="pickerOptions"
|
||||||
|
v-model="actDateRange"
|
||||||
|
type="daterange"
|
||||||
|
format="yyyy 年 MM 月 dd 日"
|
||||||
|
value-format="yyyy-MM-dd"
|
||||||
|
range-separator="至"
|
||||||
|
start-placeholder="开始日期"
|
||||||
|
end-placeholder="结束日期"
|
||||||
|
>
|
||||||
|
</el-date-picker>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
|
<el-button-group style="display:flex;">
|
||||||
|
<el-button type="primary" icon="el-icon-refresh" @click="onReset"></el-button>
|
||||||
|
<el-button type="primary" icon="search" @click="onSubmitFind">查询</el-button>
|
||||||
|
</el-button-group>
|
||||||
|
</el-form-item>
|
||||||
|
</el-row>
|
||||||
|
</el-form>
|
||||||
|
|
||||||
|
<el-table v-loading="loading" :data="list" style="width: 100%" highlight-current-row="true"
|
||||||
|
@current-change="handleDetail">
|
||||||
|
<el-table-column label="序号" type="index" width="60"></el-table-column>
|
||||||
|
<el-table-column label="单据类型" prop="billTypeName"></el-table-column>
|
||||||
|
<el-table-column label="单据号" prop="billNo"></el-table-column>
|
||||||
|
<el-table-column label="往来信息" prop="corpName"
|
||||||
|
show-overflow-tooltip="true"></el-table-column>
|
||||||
|
<el-table-column label="单据日期" prop="billdate"></el-table-column>
|
||||||
|
<el-table-column label="操作" fixed="right">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-button type="text" size="small" @click.native.stop="deleteDialog(scope.row)"
|
||||||
|
>删除
|
||||||
|
</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<el-pagination
|
||||||
|
:page-size="filterQuery.limit"
|
||||||
|
@current-change="handleCurrentChange"
|
||||||
|
layout="prev, pager, next"
|
||||||
|
:total="total"
|
||||||
|
:current-page="filterQuery.page"
|
||||||
|
></el-pagination>
|
||||||
|
</el-card>
|
||||||
|
<el-card class="el-card">
|
||||||
|
<el-table v-loading="loading" :data="detailList" style="width: 100%">
|
||||||
|
<el-table-column label="序号" type="index" width="120"></el-table-column>
|
||||||
|
<el-table-column label="产品编码" prop="productId"></el-table-column>
|
||||||
|
<el-table-column label="产品通用名" prop="productName" show-overflow-tooltip="true"></el-table-column>
|
||||||
|
<el-table-column label="规格型号" prop="spec" show-overflow-tooltip="true"></el-table-column>
|
||||||
|
<el-table-column label="批次号" prop="batchNo"></el-table-column>
|
||||||
|
<el-table-column label="生产日期" prop="productDate"></el-table-column>
|
||||||
|
<el-table-column label="失效日期" prop="expireDate"></el-table-column>
|
||||||
|
<el-table-column label="单据数量" prop="reCount"></el-table-column>
|
||||||
|
<el-table-column label="实际数量" prop="count"></el-table-column>
|
||||||
|
</el-table>
|
||||||
|
</el-card>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
import {
|
||||||
|
delThrOrders, delAll, downloadAll
|
||||||
|
} from "@/api/thrsys/thrOrder";
|
||||||
|
import {getLocalJoinByUser} from "@/api/basic/busType";
|
||||||
|
import {getOriginBusType} from "@/api/basic/busOriginType";
|
||||||
|
|
||||||
|
import {getBasicThirdSys, filterDetailByKey} from "@/api/basic/basicThirdSys";
|
||||||
|
import {selectIp} from "@/api/param/systemParamConfig";
|
||||||
|
import {getReceiveOrder} from "@/api/inout/receiveOrder";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
filterQuery: {
|
||||||
|
billAction: null,
|
||||||
|
billNo: "",
|
||||||
|
originType: null,
|
||||||
|
thirdSysFk: "",
|
||||||
|
page: 1,
|
||||||
|
limit: 10,
|
||||||
|
corpName: null,
|
||||||
|
type: 1,
|
||||||
|
editStatus: 2,
|
||||||
|
},
|
||||||
|
total: 0,
|
||||||
|
thirdSys: [],
|
||||||
|
thirdSysDetail: null,
|
||||||
|
busTypes: [],
|
||||||
|
originTypes: [],
|
||||||
|
list: [],
|
||||||
|
detailList: [],
|
||||||
|
uploadFileUrl: null,
|
||||||
|
fileList: [],
|
||||||
|
uploadData: {
|
||||||
|
thirdSys: "thirdId",
|
||||||
|
},
|
||||||
|
loading: false,
|
||||||
|
actDateRange: [],
|
||||||
|
pickerOptions: {
|
||||||
|
shortcuts: [
|
||||||
|
{
|
||||||
|
text: "最近一周",
|
||||||
|
onClick(picker) {
|
||||||
|
const end = new Date();
|
||||||
|
const start = new Date();
|
||||||
|
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
|
||||||
|
picker.$emit("pick", [start, end]);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: "最近一个月",
|
||||||
|
onClick(picker) {
|
||||||
|
const end = new Date();
|
||||||
|
const start = new Date();
|
||||||
|
start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
|
||||||
|
picker.$emit("pick", [start, end]);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: "最近三个月",
|
||||||
|
onClick(picker) {
|
||||||
|
const end = new Date();
|
||||||
|
const start = new Date();
|
||||||
|
start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
|
||||||
|
picker.$emit("pick", [start, end]);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
};
|
||||||
|
},
|
||||||
|
|
||||||
|
methods: {
|
||||||
|
onReset() {
|
||||||
|
this.$router.push({
|
||||||
|
path: "",
|
||||||
|
});
|
||||||
|
this.filterQuery = {
|
||||||
|
billNo: "",
|
||||||
|
thirdSysFk: "",
|
||||||
|
billFlag: null,
|
||||||
|
billAction: null,
|
||||||
|
startDate: null,
|
||||||
|
endDate: null,
|
||||||
|
page: 1,
|
||||||
|
limit: 10,
|
||||||
|
corpName: null,
|
||||||
|
type: 1,
|
||||||
|
editStatus: 2,
|
||||||
|
};
|
||||||
|
this.actDateRange = [];
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
onSubmitFind() {
|
||||||
|
this.filterQuery.page = 1;
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
|
||||||
|
getList() {
|
||||||
|
if (this.filterQuery.thirdSysFk == null) {
|
||||||
|
this.$message.warning("请先选择第三方系统!")
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (this.actDateRange != null) {
|
||||||
|
this.filterQuery.startDate = this.actDateRange[0];
|
||||||
|
this.filterQuery.endDate = this.actDateRange[1];
|
||||||
|
} else {
|
||||||
|
this.filterQuery.startDate = null;
|
||||||
|
this.filterQuery.endDate = null;
|
||||||
|
}
|
||||||
|
this.loading = true;
|
||||||
|
getReceiveOrder(this.filterQuery)
|
||||||
|
.then((response) => {
|
||||||
|
if (response.code == 20000) {
|
||||||
|
this.list = response.data.list || [];
|
||||||
|
this.total = response.data.total || 0;
|
||||||
|
} else {
|
||||||
|
this.$message.error(response.message);
|
||||||
|
}
|
||||||
|
this.loading = false;
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
this.loading = false;
|
||||||
|
this.list = [];
|
||||||
|
this.total = 0;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
handleDetail(row) {
|
||||||
|
this.detailList = row.subErpOrders;
|
||||||
|
},
|
||||||
|
deleteDialog(row) {
|
||||||
|
this.$confirm("此操作将永久删除该单据, 是否继续?", "提示", {
|
||||||
|
confirmButtonText: "确定",
|
||||||
|
cancelButtonText: "取消",
|
||||||
|
type: "warning",
|
||||||
|
})
|
||||||
|
.then(() => {
|
||||||
|
let dQuery = {
|
||||||
|
id: row.id,
|
||||||
|
};
|
||||||
|
delThrOrders(dQuery)
|
||||||
|
.then((response) => {
|
||||||
|
this.loading = false;
|
||||||
|
if (response.code == 20000) {
|
||||||
|
this.$message.success("删除成功");
|
||||||
|
this.getList();
|
||||||
|
} else {
|
||||||
|
this.$message.error(response.message);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
this.loading = false;
|
||||||
|
});
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
});
|
||||||
|
}
|
||||||
|
,
|
||||||
|
clearAll() {
|
||||||
|
this.$confirm("此操作将清空所有单据, 是否继续?", "提示", {
|
||||||
|
confirmButtonText: "确定",
|
||||||
|
cancelButtonText: "取消",
|
||||||
|
type: "warning",
|
||||||
|
})
|
||||||
|
.then(() => {
|
||||||
|
delAll()
|
||||||
|
.then((response) => {
|
||||||
|
this.loading = false;
|
||||||
|
if (response.code == 20000) {
|
||||||
|
this.$message.success("删除成功");
|
||||||
|
this.getList();
|
||||||
|
} else {
|
||||||
|
this.$message.success(response.message);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
this.loading = false;
|
||||||
|
});
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
});
|
||||||
|
}
|
||||||
|
,
|
||||||
|
getBasicThirdSys() {
|
||||||
|
let query = {
|
||||||
|
enabled: true,
|
||||||
|
};
|
||||||
|
getBasicThirdSys(query)
|
||||||
|
.then((response) => {
|
||||||
|
this.thirdSys = response.data.list || [];
|
||||||
|
this.filterQuery.thirdSysFk = this.thirdSys[0].thirdId;
|
||||||
|
this.uploadData.thirdSys = this.filterQuery.thirdSysFk;
|
||||||
|
this.selectSysParam();
|
||||||
|
this.getThirdSysDetail();
|
||||||
|
this.getBusType();
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
this.loading = false;
|
||||||
|
this.list = [];
|
||||||
|
});
|
||||||
|
}
|
||||||
|
,
|
||||||
|
handleCurrentChange(val) {
|
||||||
|
this.filterQuery.page = val;
|
||||||
|
this.getList();
|
||||||
|
}
|
||||||
|
,
|
||||||
|
handleChange(response, files, fileList) {
|
||||||
|
console.log(response);
|
||||||
|
if (response.code != 20000) {
|
||||||
|
this.$message.error(response.message);
|
||||||
|
} else {
|
||||||
|
console.log(files[0] + "\n" + this.fileList[0] + "\n" + fileList[0]);
|
||||||
|
this.$message.success("文件上传成功,请稍后刷新查看!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
,
|
||||||
|
selectSysParam() {
|
||||||
|
let query = {
|
||||||
|
key: "thirdIpUrl",
|
||||||
|
thirdSysFk: this.filterQuery.thirdSysFk
|
||||||
|
};
|
||||||
|
selectIp(query).then((response) => {
|
||||||
|
if (response.code == 20000) {
|
||||||
|
this.uploadFileUrl = response.data.thridUrl + "/udiwms/erp/pi/upload";
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
thirdSysChange() {
|
||||||
|
this.uploadData.thirdSys = this.filterQuery.thirdSysFk;
|
||||||
|
this.getThirdSysDetail();
|
||||||
|
},
|
||||||
|
getThirdSysDetail() {
|
||||||
|
let query = {
|
||||||
|
thirdSysFk: this.filterQuery.thirdSysFk,
|
||||||
|
key: "orderQueryUrl",
|
||||||
|
};
|
||||||
|
filterDetailByKey(query)
|
||||||
|
.then((response) => {
|
||||||
|
this.thirdSysDetail = response.data;
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
this.loading = false;
|
||||||
|
this.list = [];
|
||||||
|
});
|
||||||
|
},
|
||||||
|
downloadDatas() {
|
||||||
|
let query = {
|
||||||
|
billAction: this.filterQuery.billAction
|
||||||
|
};
|
||||||
|
downloadAll(query).then((response) => {
|
||||||
|
if (response.code == 20000) {
|
||||||
|
this.$message.success(response.data);
|
||||||
|
} else {
|
||||||
|
this.$message.error(response.message);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
getActionName(action) {
|
||||||
|
for (let i = 0; i < this.busTypes.length; i++) {
|
||||||
|
if (this.busTypes[i].action === action) {
|
||||||
|
return this.busTypes[i].name;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
getlocalName(action) {
|
||||||
|
for (let i = 0; i < this.busTypes.length; i++) {
|
||||||
|
if (this.busTypes[i].action === action) {
|
||||||
|
return this.busTypes[i].localName;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
getBusType() {
|
||||||
|
let query = {
|
||||||
|
enabled: true,
|
||||||
|
};
|
||||||
|
getLocalJoinByUser(query)
|
||||||
|
.then((response) => {
|
||||||
|
this.busTypes = response.data.list || [];
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
});
|
||||||
|
getOriginBusType(query)
|
||||||
|
.then((response) => {
|
||||||
|
this.originTypes = response.data.list || [];
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
});
|
||||||
|
},
|
||||||
|
},
|
||||||
|
components: {},
|
||||||
|
mounted() {
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.getBasicThirdSys();
|
||||||
|
let end = new Date();
|
||||||
|
let start = new Date();
|
||||||
|
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
|
||||||
|
this.actDateRange = [start, end];
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
<style scoped>
|
||||||
|
.itemTag {
|
||||||
|
float: left;
|
||||||
|
text-align: left;
|
||||||
|
margin-top: 10px;
|
||||||
|
width: 25%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.text {
|
||||||
|
font-size: 13px;
|
||||||
|
font-family: "Microsoft YaHei";
|
||||||
|
}
|
||||||
|
|
||||||
|
.query-form-item {
|
||||||
|
display: block !important;
|
||||||
|
margin-right: 10px;
|
||||||
|
margin-bottom: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-row {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-col {
|
||||||
|
border-radius: 4px;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
@ -0,0 +1,657 @@
|
|||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<el-form :model="formData" :rules="formRules" ref="dataForm" label-width="100px">
|
||||||
|
<el-row type="flex" justify="end">
|
||||||
|
<el-button-group style="display: flex;margin-bottom: 15px; margin-right: 50px;margin-top: -5px">
|
||||||
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
@click.native="saveOrder('1')"
|
||||||
|
:loading="loading"
|
||||||
|
>草稿保存
|
||||||
|
</el-button
|
||||||
|
>
|
||||||
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
@click.native="saveOrder('2')"
|
||||||
|
:loading="loading"
|
||||||
|
>提交单据
|
||||||
|
</el-button
|
||||||
|
>
|
||||||
|
</el-button-group>
|
||||||
|
</el-row>
|
||||||
|
<el-card style="margin-top: -5px;">
|
||||||
|
<el-row :gutter="20">
|
||||||
|
<el-col :span="11">
|
||||||
|
<el-form-item prop="billNo" label="单据号:">
|
||||||
|
<el-input v-model="formData.billNo" auto-complete="off" :disabled="true"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="11">
|
||||||
|
<el-form-item prop="billDate" label="单据日期:">
|
||||||
|
<el-date-picker
|
||||||
|
v-model="formData.billDate"
|
||||||
|
type="datetime"
|
||||||
|
placeholder="选择日期"
|
||||||
|
style="width: 100%"
|
||||||
|
:clearable="false"
|
||||||
|
value-format="yyyy-MM-dd HH:mm:ss"
|
||||||
|
>
|
||||||
|
</el-date-picker>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
<el-row :gutter="20">
|
||||||
|
<el-col :span="11">
|
||||||
|
<el-form-item prop="invCode" label="当前仓库:">
|
||||||
|
<el-select v-model="formData.invCode" @change="subStorageChange" placeholder="当前仓库信息"
|
||||||
|
style="width: 100%;"
|
||||||
|
clearable>
|
||||||
|
<el-option
|
||||||
|
v-for="item in invList"
|
||||||
|
:key="item.name"
|
||||||
|
:label="item.name"
|
||||||
|
:value="item.code">
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="11">
|
||||||
|
<el-form-item class="query-form-item" prop="targetInvCode" label="往来信息:">
|
||||||
|
<el-select v-model="formData.targetInvCode" placeholder="请选择仓库"
|
||||||
|
clearable="true"
|
||||||
|
style="width: 100%"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in fromOptions"
|
||||||
|
:key="item.code"
|
||||||
|
:label="item.name"
|
||||||
|
:value="item.code">
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
</el-row>
|
||||||
|
<el-row :gutter="20">
|
||||||
|
<el-col :span="11">
|
||||||
|
<el-form-item prop="billType" label="领用类型:">
|
||||||
|
<el-select v-model="formData.billType" placeholder="请选择领用类型" style="width: 100%"
|
||||||
|
clearable>
|
||||||
|
<el-option
|
||||||
|
v-for="item in busTypes"
|
||||||
|
:key="item.originAction"
|
||||||
|
:label="item.originName"
|
||||||
|
:value="item.originAction">
|
||||||
|
<span style="float: left">{{ item.originName }}</span>
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="11">
|
||||||
|
<el-form-item prop="remark" label="备注:">
|
||||||
|
<el-input v-model="formData.remark" auto-complete="off"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-card>
|
||||||
|
<el-card>
|
||||||
|
<el-button-group style="display: flex">
|
||||||
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
@click.native.stop="selectProductFunction()"
|
||||||
|
style="margin: 0px 60px 10px auto; height: 35px"
|
||||||
|
:loading="loading"
|
||||||
|
>产品录入
|
||||||
|
</el-button
|
||||||
|
>
|
||||||
|
</el-button-group>
|
||||||
|
<el-table v-loading="loading" :data="codeArray" style="width: 100%;"
|
||||||
|
:row-class-name="tableRowClassName"
|
||||||
|
border
|
||||||
|
max-height="300" height="300" ref="multipleTable">
|
||||||
|
<el-table-column label="序号" type="index" width="50"></el-table-column>
|
||||||
|
<el-table-column width="150"
|
||||||
|
label="产品通用名"
|
||||||
|
prop="cpmctymc"
|
||||||
|
show-overflow-tooltip
|
||||||
|
></el-table-column>
|
||||||
|
<el-table-column width="150"
|
||||||
|
label="规格型号"
|
||||||
|
prop="ggxh"
|
||||||
|
show-overflow-tooltip
|
||||||
|
></el-table-column>
|
||||||
|
<el-table-column width="150" label="单据数量">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-input v-model="scope.row.count"
|
||||||
|
placeholder="请输入数量" style="width: 80%"
|
||||||
|
type='number'
|
||||||
|
@change="tableCountChange(scope.row)"
|
||||||
|
:disabled="scope.row.index !== selectedIndex"
|
||||||
|
oninput="value=value.replace(/[^\d]/g,'')"></el-input>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
<el-table-column width="150"
|
||||||
|
label="注册/备案凭证号"
|
||||||
|
prop="zczbhhzbapzbh"
|
||||||
|
show-overflow-tooltip
|
||||||
|
></el-table-column>
|
||||||
|
<el-table-column width="150"
|
||||||
|
label="生产厂家"
|
||||||
|
prop="ylqxzcrbarmc"
|
||||||
|
show-overflow-tooltip
|
||||||
|
></el-table-column>
|
||||||
|
<el-table-column label="操作" width="150">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-button
|
||||||
|
type="text"
|
||||||
|
size="small"
|
||||||
|
:disabled="scope.row.index === selectedIndex"
|
||||||
|
@click.stop="true"
|
||||||
|
@click.native="rowChange(scope.row)"
|
||||||
|
>编辑
|
||||||
|
</el-button
|
||||||
|
>
|
||||||
|
<el-button
|
||||||
|
type="text"
|
||||||
|
size="small"
|
||||||
|
@click.stop="true"
|
||||||
|
@click.native="deleteCodeArray(scope.$index, scope.row)"
|
||||||
|
>删除
|
||||||
|
</el-button
|
||||||
|
>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
</el-card>
|
||||||
|
</el-form>
|
||||||
|
|
||||||
|
|
||||||
|
<el-dialog
|
||||||
|
title="库存产品录入"
|
||||||
|
:visible.sync="selectInvProductVisible"
|
||||||
|
:close-on-click-modal="false"
|
||||||
|
:close-on-press-escape="false"
|
||||||
|
width="85%"
|
||||||
|
v-if="selectInvProductVisible"
|
||||||
|
:append-to-body='true'
|
||||||
|
>
|
||||||
|
<dialogInvProduct
|
||||||
|
:closeDialog="closeDialogC2"
|
||||||
|
:invQueryData="formData"
|
||||||
|
:type="1"
|
||||||
|
></dialogInvProduct>
|
||||||
|
</el-dialog>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import {
|
||||||
|
uploadStockOrderDetail,
|
||||||
|
} from "@/api/inout/stockOrder";
|
||||||
|
import {getBusChange} from "@/api/basic/busTypeChange";
|
||||||
|
import {inserThrOrderWeb, updateReceive} from "@/api/thrsys/thrOrderReceive";
|
||||||
|
import {getThrOrderDetails, delThrOrders, delOrderDetail} from "@/api/thrsys/thrOrder";
|
||||||
|
import {filterSubByInv, findByFrom, findInvByUser} from "@/api/system/invSubWarehouse";
|
||||||
|
import dialogInvProduct from "../DialogSelectInvProduct";
|
||||||
|
import {getOrderDetail} from "@/api/inout/receiveOrder";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: "idQuery",
|
||||||
|
props: {
|
||||||
|
closeDialog: {
|
||||||
|
type: Function,
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
idQuery: {
|
||||||
|
type: Object,
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
closeConfirmFunction: {
|
||||||
|
type: Function,
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
editType: {
|
||||||
|
type: Object,
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
code: "",
|
||||||
|
query: {
|
||||||
|
orderIdFk: "",
|
||||||
|
page: 1,
|
||||||
|
limit: 10,
|
||||||
|
},
|
||||||
|
formData: {
|
||||||
|
invCode: null,
|
||||||
|
targetInvCode: null,
|
||||||
|
billNo: null,
|
||||||
|
billDate: "",
|
||||||
|
billType: "",
|
||||||
|
},
|
||||||
|
formRules: {
|
||||||
|
billDate: [
|
||||||
|
{required: true, message: "请输入单据日期", trigger: "blur"}
|
||||||
|
],
|
||||||
|
billType: [
|
||||||
|
{required: true, message: "请选择业务类型", trigger: "blur"}
|
||||||
|
],
|
||||||
|
invCode: [
|
||||||
|
{required: true, message: "请选择当前仓库", trigger: "blur"}
|
||||||
|
],
|
||||||
|
targetInvCode: [
|
||||||
|
{required: true, message: "请选择往来仓库", trigger: "blur"}
|
||||||
|
],
|
||||||
|
},
|
||||||
|
codeArray: [],
|
||||||
|
invList: [],
|
||||||
|
fromStorageOptions: [],
|
||||||
|
fromOptions: [],
|
||||||
|
total: 0,
|
||||||
|
loading: false,
|
||||||
|
index: null,
|
||||||
|
formLoading: false,
|
||||||
|
formVisible: false,
|
||||||
|
deleteLoading: false,
|
||||||
|
orderNo: null,
|
||||||
|
statusMap: {
|
||||||
|
1: "草稿",
|
||||||
|
2: "未审核",
|
||||||
|
3: "已审核",
|
||||||
|
},
|
||||||
|
orderEditor: true,
|
||||||
|
iCount: 0,
|
||||||
|
sOptions: [],
|
||||||
|
sValue: [],
|
||||||
|
sList: [],
|
||||||
|
sLoading: false,
|
||||||
|
busTypes: [],
|
||||||
|
currentRow: {},
|
||||||
|
selectedIndex: "",
|
||||||
|
selectInvProductVisible: false,
|
||||||
|
thisData: {},
|
||||||
|
storageList: [],
|
||||||
|
invQueryData: {},
|
||||||
|
type: 1,
|
||||||
|
|
||||||
|
};
|
||||||
|
},
|
||||||
|
components: {
|
||||||
|
dialogInvProduct
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
//当前分库
|
||||||
|
finCurInv() {
|
||||||
|
this.invList = [];
|
||||||
|
let query = {
|
||||||
|
filter: 3
|
||||||
|
};
|
||||||
|
findInvByUser(query)
|
||||||
|
.then((response) => {
|
||||||
|
this.invList = response.data || [];
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//往来分库
|
||||||
|
findFromInv() {
|
||||||
|
let cQuery = {
|
||||||
|
locInvCode: this.formData.invCode,
|
||||||
|
};
|
||||||
|
findByFrom(cQuery)
|
||||||
|
.then((response) => {
|
||||||
|
this.fromOptions = response.data || [];
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//领用类型
|
||||||
|
getBusType() {
|
||||||
|
let query = {
|
||||||
|
enable: false,
|
||||||
|
type: 1,
|
||||||
|
};
|
||||||
|
getBusChange(query)
|
||||||
|
.then((response) => {
|
||||||
|
this.busTypes = response.data.list || [];
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
saveOrder(status) {
|
||||||
|
this.code = "";
|
||||||
|
this.$refs.multipleTable.setCurrentRow();
|
||||||
|
this.currentRow = {};
|
||||||
|
this.selectedIndex = "";
|
||||||
|
this.iCount = 0;
|
||||||
|
this.$refs["dataForm"].validate(valid => {
|
||||||
|
if (valid) {
|
||||||
|
if (this.codeArray.length < 1) {
|
||||||
|
this.$message.warning('未添加产品');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (let i = 0; i < this.codeArray.length; i++) {
|
||||||
|
if (!this.$isBlank(this.codeArray[i].productDate) && this.codeArray[i].productDate.length != 6) {
|
||||||
|
return this.$message.error('生产日期格式错误');
|
||||||
|
}
|
||||||
|
if (!this.$isBlank(this.codeArray[i].expireDate) && this.codeArray[i].expireDate.length != 6) {
|
||||||
|
return this.$message.error('失效日期格式错误');
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if (status === '2') {
|
||||||
|
for (let i = 0; i < this.codeArray.length; i++) {
|
||||||
|
if (this.$isBlank(this.codeArray[i].count) || this.codeArray[i].count == "0") {
|
||||||
|
return this.$message.error('单据数量不能为0');
|
||||||
|
}
|
||||||
|
if (this.$isBlank(this.codeArray[i].batchNo)) {
|
||||||
|
return this.$message.error('批次号不能为空');
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (status === '0') {
|
||||||
|
for (let i = 0; i < this.codeArray.length; i++) {
|
||||||
|
if (this.$isBlank(this.codeArray[i].count) || this.codeArray[i].count == "0") {
|
||||||
|
return this.$message.error('单据数量不能为0');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (status == "1") {
|
||||||
|
this.submitFunction(status);
|
||||||
|
} else {
|
||||||
|
let tip = "是否确定提交订单?";
|
||||||
|
this.$confirm(tip, "提示", {
|
||||||
|
confirmButtonText: "确定",
|
||||||
|
cancelButtonText: "取消",
|
||||||
|
type: "warning",
|
||||||
|
}).then(() => {
|
||||||
|
this.submitFunction(status);
|
||||||
|
}).catch(() => {
|
||||||
|
this.loading = false;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
submitFunction(status) {
|
||||||
|
let tMessage = status === '501' ? '保存' : '提交';
|
||||||
|
this.loading = true;
|
||||||
|
let tQuery = this.formData;
|
||||||
|
tQuery.editStatus = status;
|
||||||
|
tQuery.subErpOrders = this.codeArray;
|
||||||
|
tQuery.thirdPartyDate = 2;
|
||||||
|
if (this.editType === "add") {
|
||||||
|
inserThrOrderWeb(tQuery)
|
||||||
|
.then(response => {
|
||||||
|
this.loading = false;
|
||||||
|
if (response.code === 20000) {
|
||||||
|
this.$message.success(tMessage + "成功");
|
||||||
|
this.closeDialog(true);
|
||||||
|
} else {
|
||||||
|
this.$message.error(response.message);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
this.loading = false;
|
||||||
|
})
|
||||||
|
} else if (this.editType === "update") {
|
||||||
|
updateReceive(tQuery)
|
||||||
|
.then(response => {
|
||||||
|
this.loading = false;
|
||||||
|
if (response.code === 20000) {
|
||||||
|
this.$message.success(tMessage + "成功");
|
||||||
|
this.closeDialog(true);
|
||||||
|
} else {
|
||||||
|
this.$message.error(response.message);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
this.loading = false;
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
},
|
||||||
|
selectProductFunction(event) {
|
||||||
|
if (this.$isBlank(event)) {
|
||||||
|
this.selectInvProductVisible = true;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
closeDialogC2(rData) {
|
||||||
|
this.selectInvProductVisible = false;
|
||||||
|
},
|
||||||
|
rowChange(val) {
|
||||||
|
this.currentRow = val;
|
||||||
|
this.selectedIndex = val.index;
|
||||||
|
this.iCount = val.count;
|
||||||
|
this.focusNext('iCount');
|
||||||
|
|
||||||
|
},
|
||||||
|
tableCountChange(row) {
|
||||||
|
if (this.$isNotBlank(row)) {
|
||||||
|
// row.count = row.reCount;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
tableRowClassName({row, rowIndex}) {
|
||||||
|
row.index = rowIndex;
|
||||||
|
},
|
||||||
|
focusNext(nextRef) {
|
||||||
|
this.$refs[nextRef].focus()
|
||||||
|
},
|
||||||
|
// 刷新表单
|
||||||
|
resetForm() {
|
||||||
|
if (this.$refs["dataForm"]) {
|
||||||
|
// 清空验证信息表单
|
||||||
|
this.$refs["dataForm"].clearValidate();
|
||||||
|
// 刷新表单
|
||||||
|
this.$refs["dataForm"].resetFields();
|
||||||
|
this.getList();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
saveCodeArray(index, row) {
|
||||||
|
if (this.$isBlank(row.batchNo)) {
|
||||||
|
return this.$message.error('批次号不能为空');
|
||||||
|
}
|
||||||
|
this.$refs.multipleTable.setCurrentRow();
|
||||||
|
this.currentRow = {};
|
||||||
|
this.selectedIndex = "";
|
||||||
|
this.iCount = 0;
|
||||||
|
|
||||||
|
this.detailLoading = true;
|
||||||
|
// row.count = row.reCount;
|
||||||
|
let tQuery = row;
|
||||||
|
uploadStockOrderDetail(tQuery).then((response) => {
|
||||||
|
this.detailLoading = false;
|
||||||
|
if (response.code === 20000) {
|
||||||
|
this.$message.success("修改完成");
|
||||||
|
this.getStockOrderDetailList();
|
||||||
|
this.$refs.inputRef.focus();
|
||||||
|
} else {
|
||||||
|
this.$message.error(response.message);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
deleteCodeArray(index, row) {
|
||||||
|
this.$confirm("此操作将永久删除该数据, 是否继续?", "提示", {
|
||||||
|
confirmButtonText: "确定",
|
||||||
|
cancelButtonText: "取消",
|
||||||
|
type: "warning",
|
||||||
|
}).then(() => {
|
||||||
|
this.$refs.multipleTable.setCurrentRow();
|
||||||
|
this.currentRow = {};
|
||||||
|
this.selectedIndex = "";
|
||||||
|
this.iCount = 0;
|
||||||
|
|
||||||
|
if (this.orderEditor) {
|
||||||
|
this.detailLoading = true;
|
||||||
|
if (this.$isNotBlank(row.id)) {
|
||||||
|
delOrderDetail({id: row.id})
|
||||||
|
.then(response => {
|
||||||
|
this.detailLoading = false;
|
||||||
|
if (response.code === 20000) {
|
||||||
|
this.$message.success(response.data);
|
||||||
|
// this.getStockOrderDetailList();
|
||||||
|
this.codeArray.splice(index, 1);
|
||||||
|
} else {
|
||||||
|
this.$message.error(response.message);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
this.detailLoading = false;
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
this.$message.success('删除成功');
|
||||||
|
this.codeArray.splice(index, 1);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.$message.success('删除成功');
|
||||||
|
this.codeArray.splice(index, 1);
|
||||||
|
}
|
||||||
|
}).catch(() => {
|
||||||
|
|
||||||
|
});
|
||||||
|
},
|
||||||
|
subStorageChange(item) {
|
||||||
|
this.getBusType();
|
||||||
|
this.findFromInv();
|
||||||
|
},
|
||||||
|
copyDetail(row) {
|
||||||
|
this.$confirm("是否复制该记录?", "提示", {
|
||||||
|
confirmButtonText: "确定",
|
||||||
|
cancelButtonText: "取消",
|
||||||
|
type: "warning",
|
||||||
|
}).then(() => {
|
||||||
|
let rData = JSON.parse(JSON.stringify(row));
|
||||||
|
rData.id = null;
|
||||||
|
if (this.codeArray.length === 0) {
|
||||||
|
this.codeArray.push(rData);
|
||||||
|
this.$refs.multipleTable.setCurrentRow(this.codeArray[0]);
|
||||||
|
this.currentRow = this.codeArray[0];
|
||||||
|
this.selectedIndex = 0;
|
||||||
|
} else {
|
||||||
|
this.codeArray.unshift(rData);
|
||||||
|
this.$refs.multipleTable.setCurrentRow(this.codeArray[0]);
|
||||||
|
this.currentRow = this.codeArray[0];
|
||||||
|
this.selectedIndex = 0;
|
||||||
|
}
|
||||||
|
this.$message.success("复制成功");
|
||||||
|
this.iCount = this.currentRow.count;
|
||||||
|
this.focusNext('iCount');
|
||||||
|
}).catch(() => {
|
||||||
|
});
|
||||||
|
},
|
||||||
|
getInputFocus(event) {
|
||||||
|
event.currentTarget.select();
|
||||||
|
},
|
||||||
|
tableSelection() {
|
||||||
|
this.$refs.multipleTable.clearSelection();
|
||||||
|
this.$refs.multipleTable.toggleAllSelection();
|
||||||
|
},
|
||||||
|
handleSizeChange(val) {
|
||||||
|
this.query.limit = val;
|
||||||
|
this.getStockOrderDetailList();
|
||||||
|
},
|
||||||
|
handleCurrentChange(val) {
|
||||||
|
this.query.page = val;
|
||||||
|
this.getStockOrderDetailList();
|
||||||
|
},
|
||||||
|
getStockOrderDetailList() {
|
||||||
|
this.loading = true;
|
||||||
|
this.query.orderIdFk = this.formData.billNo;
|
||||||
|
getOrderDetail(this.query) //查找该单号下的所有条码
|
||||||
|
.then((response) => {
|
||||||
|
this.codeArray = response.data.list || [];
|
||||||
|
this.total = response.data.total || 0;
|
||||||
|
this.loading = false;
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
this.loading = false;
|
||||||
|
this.list = [];
|
||||||
|
this.total = 0;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
intentBack() {
|
||||||
|
this.$router.go(-1);
|
||||||
|
},
|
||||||
|
|
||||||
|
selectOne(event) {
|
||||||
|
this.formData.corpName = event.name;
|
||||||
|
this.formData.corpId = event.erpId;
|
||||||
|
this.formData.unitIdFk = event.erpId;
|
||||||
|
},
|
||||||
|
getActionItem(action) {
|
||||||
|
for (let i = 0; i < this.busTypes.length; i++) {
|
||||||
|
if (this.busTypes[i].thirdAction === action) {
|
||||||
|
return this.busTypes[i];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
locInChange(item) {
|
||||||
|
if (this.formData.invWarehouseCode != null) {
|
||||||
|
this.formData.invWarehouseCode = "";
|
||||||
|
}
|
||||||
|
this.formData.locStorageCode = item;
|
||||||
|
this.$forceUpdate();
|
||||||
|
this.finCurInv();
|
||||||
|
},
|
||||||
|
},
|
||||||
|
filters: {},
|
||||||
|
mounted() {
|
||||||
|
document.body.ondrop = function (event) {
|
||||||
|
event.preventDefault();
|
||||||
|
event.stopPropagation();
|
||||||
|
};
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
if (this.$isNotBlank(this.idQuery.id)) {
|
||||||
|
this.query.limit = 100;
|
||||||
|
this.query.orderIdFk = this.idQuery.id;
|
||||||
|
this.formData = this.idQuery.formData;
|
||||||
|
this.orderEditor = true;
|
||||||
|
this.sValue = this.formData.corpName;
|
||||||
|
this.getStockOrderDetailList();
|
||||||
|
} else {
|
||||||
|
this.formData = {
|
||||||
|
invCode: null,
|
||||||
|
targetInvCode: null,
|
||||||
|
billNo: null,
|
||||||
|
billDate: "",
|
||||||
|
billType: "",
|
||||||
|
};
|
||||||
|
this.orderEditor = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.getBusType();
|
||||||
|
this.finCurInv();
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
<style>
|
||||||
|
|
||||||
|
.ao-text {
|
||||||
|
width: 100%;
|
||||||
|
font-size: 13px;
|
||||||
|
font-family: "Microsoft YaHei";
|
||||||
|
float: right;
|
||||||
|
text-align: right;
|
||||||
|
margin-top: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
</style>
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue