1.医院在web端新增业务单据,新增扫码单据修改;

2.仓库信息加入
master
anthonyywj2 3 years ago
parent 49523db144
commit 10bea3a4e2

@ -0,0 +1,43 @@
import axios from "../../utils/axios";
// 权限管理
// 获取列表
export function filterList(query) {
return axios({
url: "/spms/inv/warehouse/filter",
method: "get",
params: query
});
}
export function filterAll(query) {
return axios({
url: "/spms/inv/warehouse/filterAll",
method: "get",
params: query
});
}
// 保存
export function saveWarehouse(data, formName, method = "post") {
let url =
formName !== "edit"
? "/spms/inv/warehouse/save"
: "/spms/inv/warehouse/edit";
return axios({
url: url,
method: method,
data: data
});
}
// 删除
export function deleteWarehouse(data) {
return axios({
url: "/spms/inv/warehouse/delete",
method: "post",
data: data
});
}

@ -22,6 +22,7 @@ import thirdSysApiDownload from "../views/userManage/param/ThirdSysApiDownload.v
import showText from "../views/other/showText"; import showText from "../views/other/showText";
//基础数据维护 //基础数据维护
import invWarehouse from "../views/basic/invWarehouse"
import BussinessType from "../views/basic/BussinessType.vue"; import BussinessType from "../views/basic/BussinessType.vue";
import BussinessTypeLocl from "../views/basic/BussinessTypeLocl.vue"; import BussinessTypeLocl from "../views/basic/BussinessTypeLocl.vue";
import bussinessTypeThird from "../views/basic/BussinessTypeThird.vue"; import bussinessTypeThird from "../views/basic/BussinessTypeThird.vue";
@ -510,6 +511,15 @@ export const asyncRouterMap = [
authRule: ["basic"] authRule: ["basic"]
}, },
children: [ children: [
{
path: "invWarehouse",
component: invWarehouse,
name: "仓库信息",
icon: "",
meta: {
authRule: ["basicProduct/invWarehouse"]
}
},
{ {
path: "/udiinfo", path: "/udiinfo",
redirect: "/udiinfo/udiinfomg", redirect: "/udiinfo/udiinfomg",

@ -0,0 +1,569 @@
<template>
<div>
<el-card>
<el-form :inline="true" :model="query" class="query-form" size="mini">
<el-form-item class="query-form-item">
<el-input
v-model="query.name"
clearable
placeholder="仓库名称"
style="width: 400px"
></el-input>
</el-form-item>
<el-form-item class="query-form-item">
<el-select v-model="query.advanceType" placeholder="请选择仓库类型" clearable>
<el-option label="全部" value=""></el-option>
<el-option label="寄售" value=true></el-option>
<el-option label="仓库" value=false></el-option>
</el-select>
</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="getList"></el-button>
<el-button type="primary" @click.native="handleForm(null, null,'addTop')"
>添加仓库
</el-button
>
</el-button-group>
</el-form-item>
</el-form>
<el-table
:data="mergeList"
style="width: 100%;margin-bottom: 20px;"
row-key="id"
border
default-expand-all
:tree-props="{children: 'children', hasChildren: 'hasChildren'}">
<el-table-column
prop="code"
label="仓库编码"
>
</el-table-column>
<el-table-column
prop="name"
label="仓库名称"
>
</el-table-column>
<el-table-column
prop="advanceType"
label="仓库类型">
<template slot-scope="scope">
<span>{{ enableMap[scope.row.advanceType] }}</span>
</template>
</el-table-column>
<!-- <el-table-column-->
<!-- prop="isDefault"-->
<!-- label="是否默认库存">-->
<!-- <template slot-scope="scope">-->
<!-- <span>{{ enableMap[scope.row.isDefault] }}</span>-->
<!-- </template>-->
<!-- </el-table-column>-->
<el-table-column label="操作" fixed="right">
<template slot-scope="scope">
<el-button
type="text"
size="small"
:disabled="scope.row.pid!=0"
@click.native.stop="handleSubForm(node, scope.row, 'add')"
>添加货位
</el-button
>
<el-button
type="text"
size="small"
@click.native.stop="handleForm(node, scope.row, 'edit')"
>编辑
</el-button
>
<el-button
type="text"
size="small"
:disabled="scope.row.code==1000 ||scope.row.code==1001"
@click.native.stop="handleDel(node,scope.row)"
>删除
</el-button
>
</template>
</el-table-column>
</el-table>
<!-- <el-tree-->
<!-- :data="mergeList"-->
<!-- :props="defaultProps"-->
<!-- node-key="id"-->
<!-- style="width: 50%"-->
<!-- default-expand-all-->
<!-- :expand-on-click-node="false"-->
<!-- :render-content="renderContent"-->
<!-- >-->
<!-- </el-tree>-->
</el-card>
<!--表单界面-->
<el-dialog
:title="formMap[formName]"
:close-on-click-modal="false"
:close-on-press-escape="false"
:visible.sync="subFormVisible"
:before-close="hideForm"
width="60%"
top="5vh"
>
<el-form :model="formData" :rules="formRules" ref="dataForm">
<el-form-item label="本企业仓库" prop="pid">
<el-select v-model="formData.pid" placeholder="顶级" disabled>
<el-option
v-for="item in mergeList"
:key="item.id"
:label="item.name"
:value="item.id"
>
<span style="float: left"
><span v-html="item.html"></span>{{ item.name }}</span
>
</el-option>
</el-select>
</el-form-item>
<el-form-item label="仓库编码" prop="title" class="query-form-item">
<el-input
v-model="formData.code" style="width: 80%"
auto-complete="off"
></el-input>
</el-form-item>
<el-form-item label="仓库名称" prop="name" class="query-form-item">
<el-input
v-model="formData.name" style="width: 80%"
auto-complete="off"
></el-input>
</el-form-item>
<el-form-item class="query-form-item" label="仓库类型:">
<el-select v-model="formData.advanceType" placeholder="仓库类型" clearable>
<el-option label="寄售" :value=true></el-option>
<el-option label="仓库" :value=false></el-option>
</el-select>
</el-form-item>
<el-form-item label="状态:" prop="status" class="query-form-item">
<el-radio-group v-model="formData.status">
<el-radio :label="0">禁用</el-radio>
<el-radio :label="1">正常</el-radio>
</el-radio-group>
</el-form-item>
<!-- <el-form-item v-if="formData.pid == 0">-->
<!-- <el-row :gutter="20" class="el-row" type="flex">-->
<!-- <el-col :span="4" class="el-col">-->
<!-- <div class="text item">-->
<!-- <el-checkbox v-model="formData.advanceType"></el-checkbox>-->
<!-- </div>-->
<!-- </el-col>-->
<!-- <el-col :span="4" class="el-col">-->
<!-- <div class="text item">-->
<!-- <el-checkbox v-model="formData.isDefault"></el-checkbox>-->
<!-- </div>-->
<!-- </el-col>-->
<!-- </el-row>-->
<!-- </el-form-item>-->
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click.native="hideForm">取消</el-button>
<el-button
type="primary"
@click.native="formSubmit()"
:loading="formLoading"
>提交
</el-button
>
</div>
</el-dialog>
<el-dialog
:title="formMap[formName]"
:close-on-click-modal="false"
:close-on-press-escape="false"
:visible.sync="formVisible"
:before-close="hideForm"
width="60%"
top="5vh"
>
<el-form :model="formData" :rules="formRules" ref="dataForm">
<el-form-item label="仓库编码" prop="title" class="query-form-item">
<el-input
v-model="formData.code" style="width: 80%"
auto-complete="off"
></el-input>
</el-form-item>
<el-form-item label="仓库名称" prop="name" class="query-form-item">
<el-input
v-model="formData.name" style="width: 80%"
auto-complete="off"
></el-input>
</el-form-item>
<el-form-item class="query-form-item" label="仓库类型:">
<el-select v-model="formData.advanceType" placeholder="仓库类型" clearable>
<el-option label="寄售" :value='true'></el-option>
<el-option label="仓库" :value='false'></el-option>
</el-select>
</el-form-item>
<el-form-item label="状态:" prop="status" class="query-form-item">
<el-radio-group v-model="formData.status">
<el-radio :label="0">禁用</el-radio>
<el-radio :label="1">正常</el-radio>
</el-radio-group>
</el-form-item>
<!-- <el-form-item v-if="formData.pid == 0">-->
<!-- <el-row :gutter="20" class="el-row" type="flex">-->
<!-- <el-col :span="4" class="el-col">-->
<!-- <div class="text item">-->
<!-- <el-checkbox v-model="formData.advanceType"></el-checkbox>-->
<!-- </div>-->
<!-- </el-col>-->
<!-- <el-col :span="4" class="el-col">-->
<!-- <div class="text item">-->
<!-- <el-checkbox v-model="formData.isDefault"></el-checkbox>-->
<!-- </div>-->
<!-- </el-col>-->
<!-- </el-row>-->
<!-- </el-form-item>-->
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click.native="hideForm">取消</el-button>
<el-button
type="primary"
@click.native="formSubmit()"
:loading="formLoading"
>提交
</el-button
>
</div>
</el-dialog>
</div>
</template>
<script>
import {
filterList,
saveWarehouse,
deleteWarehouse
} from "../../api/basic/invWarehouse";
const formJson = {
id: null,
pid: null,
name: null,
code: null,
status: 1,
advanceType: false,
isDefault: false
};
export default {
data() {
return {
query: {
id: null,
pid: null,
name: null,
code: null,
status: null,
advanceType: null,
isDefault: null
},
mergeList: [],
node: null,
defaultProps: {
children: "children",
label: "name"
},
treeList: [],
loading: true,
index: null,
formName: null,
formMap: {
addTop: "添加仓库",
add: "添加货位",
edit: "编辑"
},
enableMap: {
true: "寄售",
false: "仓库",
},
formLoading: false,
subFormVisible: false,
formVisible: false,
formData: formJson,
formRules: {
name: [
{required: true, message: "请输入仓库货位名", trigger: "blur"}
],
code: [
{required: true, message: "请输入仓库货位代码", trigger: "blur"}
]
},
pidData: {}
,
deleteLoading: false
}
;
},
methods: {
/*eslint-disable */
renderContent(h, {node, data, store}) {
return (
<span
style="flex: 1; display: flex; align-items: center; justify-content: space-between; font-size: 14px; padding-right: 8px;">
<span>
<span title={data.name} style="margin-left:8px">{node.label}</span>
<span style="margin-left:18px">(编码{data.code})</span>
</span>
<span>
<el-button
style="font-size: 12px;"
type="text"
on-click={() => this.handleSubForm(node, data, "add")}
>
添加货位
</el-button>
<el-button
style="font-size: 12px;"
type="text"
on-click={() => this.handleForm(node, data, "edit")}
>
编辑
</el-button>
<el-button
style="font-size: 12px;"
type="text"
on-click={() => this.handleDel(node, data)}
>
删除
</el-button>
</span>
</span>
);
},
onReset() {
this.$router.push({
path: "",
});
this.query = {
name: "",
status: "",
};
this.getList();
},
onSubmit() {
this.getList();
},
getList() {
this.loading = true;
filterList(this.query)
.then((response) => {
this.loading = false;
this.mergeList = response.data.list || [];
this.treeList = response.data.tree_list || [];
})
.catch(() => {
this.loading = false;
this.mergeList = [];
this.treeList = [];
});
},
//
resetForm() {
if (this.$refs["dataForm"]) {
//
this.$refs["dataForm"].clearValidate();
//
this.$refs["dataForm"].resetFields();
this.getList();
}
},
//
hideForm() {
//
this.formVisible = false;
this.subFormVisible = false;
return true;
},
//
handleForm(node, data, formName) {
this.formVisible = true;
let no = this.getProjectNum() + Math.floor(Math.random() * 10000)
this.pidData = data || null;
formJson.pid = (data && parseInt(data.id)) || "";
this.formData = JSON.parse(JSON.stringify(formJson));
if (formName === "edit") {
this.formData = Object.assign({}, data);
this.node = node;
} else {
this.formData.code = no;
}
this.formData.pid = !this.formData.pid ? "" : this.formData.pid;
this.formName = formName;
if (data && data.id) {
this.index = this.mergeList.findIndex((d) => d.id === data.id);
}
},
handleSubForm(node, data, formName) {
this.subFormVisible = true;
this.pidData = data || null;
formJson.pid = (data && parseInt(data.id)) || "";
this.formData = JSON.parse(JSON.stringify(formJson));
if (formName === "edit") {
this.formData = Object.assign({}, data);
this.node = node;
} else {
let no = this.getProjectNum() + Math.floor(Math.random() * 10000);
this.formData.code = no;
}
this.formData.pid = !this.formData.pid ? "" : this.formData.pid;
this.formName = formName;
if (data && data.id) {
this.index = this.mergeList.findIndex((d) => d.id === data.id);
}
},
formSubmit() {
this.$refs["dataForm"].validate((valid) => {
if (valid) {
this.formLoading = true;
let data = Object.assign({}, this.formData);
saveWarehouse(data, this.formName)
.then((response) => {
this.formLoading = false;
if (response.code !== 20000) {
this.$message.error(response.message);
return false;
}
this.$message.success("操作成功");
this.formVisible = false;
if (this.formName !== "edit") {
if (response.data && response.data.id) {
data.id = response.data.id;
if (this.pidData) {
if (!this.pidData.children) {
this.$set(this.pidData, "children", []);
}
this.pidData.children.push(data);
} else {
this.mergeList.push(data);
}
}
} else {
const parent = this.node.parent;
const children = parent.data.children || parent.data;
const index = children.findIndex((d) => d.id === data.id);
children.splice(index, 1, data);
}
//
this.resetForm();
this.getList();
})
.catch(() => {
this.formLoading = false;
});
}
});
},
//
handleDel(node, data) {
if (data.children && data.children.length > 0) {
this.$alert("请先删除子节点", "提示", {
confirmButtonText: "确定",
});
return false;
}
if (data.id) {
this.$confirm("确认删除该记录吗?", "提示", {
type: "warning",
})
.then(() => {
this.deleteLoading = true;
let para = {id: data.id};
deleteWarehouse(para)
.then((response) => {
this.deleteLoading = false;
if (response.code !== 20000) {
this.$message.error(response.message);
return false;
}
this.$message.success("删除成功");
this.getList();
const parent = node.parent;
const children = parent.data.children || parent.data;
const index = children.findIndex((d) => d.id === data.id);
children.splice(index, 1);
})
.catch(() => {
this.deleteLoading = false;
});
})
.catch(() => {
this.$message.info("取消删除");
});
}
},
getProjectNum() {
const projectTime = new Date() //
const Year = projectTime.getFullYear() // IE.
const Month = projectTime.getMonth() + 1 //
const Day = projectTime.getDate() //
var CurrentDate = Year
if (Month >= 10) { // 1010
CurrentDate += Month
} else {
CurrentDate += '0' + Month
}
if (Day >= 10) {
CurrentDate += Day
} else {
CurrentDate += '0' + Day
}
return CurrentDate
}
},
filters: {
statusFilterType(status) {
const statusMap = {
0: "gray",
1: "success",
};
return statusMap[status];
},
statusFilterName(status) {
const statusMap = {
0: "禁用",
1: "正常",
};
return statusMap[status];
},
},
mounted() {
},
created() {
//
this.getList();
},
};
</script>
<style type="text/scss" lang="scss">
</style>

File diff suppressed because it is too large Load Diff

@ -0,0 +1,93 @@
<template>
<div>
<el-form :inline="true" :model="query" class="query-form" size="mini">
<el-form-item class="query-form-item">
<el-input
v-model="query.name"
clearable
placeholder="仓库名称"
style="width: 400px"
></el-input>
</el-form-item>
<el-form-item class="query-form-item">
<el-select v-model="query.advanceType" placeholder="请选择仓库类型" clearable>
<el-option label="全部" value=""></el-option>
<el-option label="寄售" value=true></el-option>
<el-option label="仓库" value=false></el-option>
</el-select>
</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="getList"></el-button>
</el-button-group>
</el-form-item>
</el-form>
<el-table
v-loading="loading"
:data="list"
style="width: 100%"
@row-click="selectStorage"
>
<el-table-column
prop="code"
label="仓库编码"
>
</el-table-column>
<el-table-column
prop="name"
label="仓库名称"
>
</el-table-column>
<el-table-column
prop="advanceType"
label="仓库类型">
<template slot-scope="scope">
<span>{{ enableMap[scope.row.advanceType] }}</span>
</template>
</el-table-column>
</el-table>
</div>
</template>
<script>
import {
filterAll,
} from "../../api/basic/invWarehouse";
export default {
name: "DialogSelectInvStorage",
data() {
return {
query: {key: "", page: 1, limit: 20},
list: [],
enableMap: {
true: "寄售",
false: "仓库",
},
}
},
methods: {
getList() {
this.loading = true;
filterAll(this.query)
.then((response) => {
this.loading = false;
this.list = response.data || [];
})
.catch(() => {
this.loading = false;
});
},
selectStorage(row) {
console.log(row.id);
this.$emit("selectStorage", row);
},
},
}
</script>
<style scoped>
</style>

@ -53,11 +53,12 @@
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="2"> <el-col :span="2">
<div class="ao-text"> <div class="ao-text">
<span>往来单位</span> <span>往来信息</span>
</div> </div>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item class="query-form-item" prop="fromCorp"> <el-form-item class="query-form-item" prop="fromCorp"
v-if="curAction.corpType ==0 && curAction.genUnit ==false">
<el-select <el-select
v-model="formData.fromCorp" v-model="formData.fromCorp"
filterable filterable
@ -79,6 +80,35 @@
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item class="query-form-item" prop="fromCorp"
v-if="curAction.corpType ==1 && curAction.genUnit ==false">
<el-select
v-model="formData.fromCorp"
filterable
remote
clearable="true"
reserve-keyword
placeholder="请输入仓库信息"
:remote-method="findStorageMethod"
:loading="loading"
@change="unitChange"
>
<el-option
v-for="item in fromStorageOptions"
:key="item.value"
:label="item.code"
:value="item.name">
<span style="float: left">{{ item.name }}</span>
<span style="float: right; color: #8492a6; font-size: 13px">{{ item.code }}</span>
</el-option>
</el-select>
</el-form-item>
<el-form-item class="query-form-item" prop="fromCorp" v-if="curAction.genUnit ==true">
<el-input v-model="formData.fromCorp" auto-complete="off"
clearable
placeholder="请输入病人住院号"
></el-input>
</el-form-item>
</el-col> </el-col>
<el-col :span="2"> <el-col :span="2">
<div class="ao-text"> <div class="ao-text">
@ -87,7 +117,8 @@
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item class="query-form-item" prop="billType"> <el-form-item class="query-form-item" prop="billType">
<el-select v-model="formData.action" placeholder="请选择单据类型" :disabled="actionEnable"> <el-select v-model="formData.action" placeholder="请选择单据类型" :disabled="actionEnable"
@change="actionChange">
<el-option <el-option
v-for="item in busTypes" v-for="item in busTypes"
:key="item.name" :key="item.name"
@ -99,6 +130,31 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row :gutter="20">
<el-col :span="2">
<div class="ao-text">
<span>当前仓库</span>
</div>
</el-col>
<el-col :span="8">
<el-form-item prop="locStorageCode">
<!--<el-select v-model="formData.billType" style="width: 100%" placeholder="业务类型" :disabled="true">-->
<!--<el-option label="送货单" value="deliveryNote"></el-option>-->
<!--</el-select>-->
<el-select v-model="formData.locStorageCode" placeholder="当前仓库信息">
<el-option
v-for="item in storageList"
: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-row>
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="2"> <el-col :span="2">
@ -177,304 +233,361 @@
</template> </template>
<script> <script>
import { import {
errorCodeList, addOrderWeb, deleteCodesTempById, submitOrderWeb errorCodeList, addOrderWeb, deleteCodesTempById, submitOrderWeb
} from "../../api/inout/order"; } from "../../api/inout/order";
import {getBussinessType} from "../../api/basic/bussinessType"; import {getBussinessType} from "../../api/basic/bussinessType";
import draggable from "vuedraggable"; import draggable from "vuedraggable";
import {parseTime} from "../../filtres/index"; import {parseTime} from "../../filtres/index";
import store from "../../store"; import store from "../../store";
import {getBasicUnitMaintains} from "../../api/basic/basicUnitMaintain" import {getBasicUnitMaintains} from "../../api/basic/basicUnitMaintain"
import {filterAll} from "@/api/basic/invWarehouse";
export default { export default {
name: "idQuery", name: "idQuery",
props: { props: {
closeDialog: { closeDialog: {
type: Function, type: Function,
required: true, required: true,
},
idQuery: {
type: Object,
required: true,
},
},
data() {
return {
codeQuery: {
code: "",
}, },
idQuery: { query: {
type: Object, code: "",
required: true, corpOrderId: "",
page: 1,
limit: 10,
}, },
busTypes: [],
billAction: null,
actionEnable: false,
formData: {
corpOrderId: "",
code: "",
actor: "",
fromCorpId: "",
fromCorp: null,
fromType: "网页端",
actDate: new Date(),
action: null,
locStorageCode: null,
},
storageList: [],
formRules: {
temp: [
{required: true, message: "请输入条码", trigger: "blur"}
],
},
corpOrderIdDisabled: false,
codeArray: [],
total: 0,
loading: false,
index: null,
formLoading: false,
formVisible: false,
deleteLoading: false,
orderNo: null,
fromOptions: [],
fromStorageOptions: [],
curAction: {
corpType: 0,
genUnit: false,
},
};
},
components: {
draggable,
},
methods: {
submit(formName) {
if (this.total < 1) {
this.$message.error('未添加条码');
return;
}
let tQuery = {
orderId: this.idQuery.id,
locStorageCode: this.formData.locStorageCode,
action: this.formData.action,
}
submitOrderWeb(tQuery)
.then((response) => {
console.log(response)
if (response.code === 20000) {
this.$message.success("提交成功");
this.closeDialog();
} else {
this.$message.error(response.message);
}
this.loading = false;
});
}, },
data() { //
return { resetForm() {
codeQuery: { if (this.$refs["dataForm"]) {
code: "", //
}, this.$refs["dataForm"].clearValidate();
query: { //
code: "", this.$refs["dataForm"].resetFields();
corpOrderId: "", this.getList();
page: 1, }
limit: 10,
},
busTypes: [],
billAction: null,
actionEnable: false,
formData: {
corpOrderId: "",
code: "",
actor: "",
fromCorpId: "",
fromCorp: null,
fromType: "网页端",
actDate: new Date(),
action: null,
},
formRules: {
temp: [
{required: true, message: "请输入条码", trigger: "blur"}
],
},
corpOrderIdDisabled: false,
codeArray: [],
total: 0,
loading: false,
index: null,
formLoading: false,
formVisible: false,
deleteLoading: false,
orderNo: null,
fromOptions: [],
};
},
components: {
draggable,
}, },
methods: { addCode() {
submit(formName) { this.formData.corpOrderId = this.formData.corpOrderId.trim();
if (this.total < 1) { this.actionEnable = true;
this.$message.error('未添加条码');
return; if (this.$isBlank(this.formData.action)) {
this.$message.warning("请选择单据类型!");
return;
}
if (this.$isBlank(this.formData.corpOrderId)) {
let date = new Date();
this.formData.corpOrderId = parseTime(date, '{y}{m}{d}{h}{i}{s}') + Math.ceil(Math.random() * 89 + 10);
}
this.formData.code = this.formData.code.trim();
if (this.$isBlank(this.formData.code)) return;
this.loading = true;
let tQuery = Object.assign(JSON.parse(JSON.stringify(this.formData)));
tQuery.orderId = this.idQuery.id;
tQuery.actDate = parseTime(this.formData.actDate, '{y}-{m}-{d} {h}:{i}:{s}');
tQuery.action = this.formData.action;
console.log(tQuery.action);
addOrderWeb(tQuery).then((response) => {
if (response.code === 20000) {
this.idQuery.id = response.data;
this.corpOrderIdDisabled = true;
this.getCodeList();
} else {
this.$alert(response.message, '提示', {
confirmButtonText: '确定',
type: 'warning',
closeOnClickModal: true,
callback: action => {
this.$refs.inputRef.focus();
}
});
// this.$message.error(response.message);
} }
this.loading = false;
});
},
unitChange(row) {
console.log(row);
this.formData.fromCorpId = row.erpId;
this.formData.fromCorp = row.name;
},
deleteCode(index, row) {
console.log(row.id)
this.$confirm("是否删除?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
}).then(() => {
this.loading = true;
let tQuery = { let tQuery = {
orderId: this.idQuery.id id: row.id
} }
submitOrderWeb(tQuery) deleteCodesTempById(tQuery)
.then((response) => { .then((response) => {
console.log(response)
if (response.code === 20000) { if (response.code === 20000) {
this.$message.success("提交成功"); this.getCodeList();
this.closeDialog();
} else { } else {
this.$message.error(response.message); this.$message.error(response.message);
} }
this.loading = false; this.loading = false;
}); });
}, }).catch(() => {
// });
resetForm() { },
if (this.$refs["dataForm"]) { getInputFocus(event) {
// event.currentTarget.select();
this.$refs["dataForm"].clearValidate(); },
// tableSelection() {
this.$refs["dataForm"].resetFields(); this.$refs.multipleTable.clearSelection();
this.getList(); this.$refs.multipleTable.toggleAllSelection();
} },
}, handleSizeChange(val) {
addCode() { this.query.limit = val;
this.formData.corpOrderId = this.formData.corpOrderId.trim(); this.getCodeList();
this.actionEnable = true; },
handleCurrentChange(val) {
this.query.page = val;
this.getCodeList();
},
getCodeList() {
this.loading = true;
this.query.orderId = this.idQuery.id;
errorCodeList(this.query) //
.then((response) => {
this.codeArray = response.data.list || [];
this.total = response.data.total || 0;
for (let i = 0; i < this.codeArray.length; i++) {
this.codeArray[i].fromType = this.formData.fromType;
this.codeArray[i].billType = this.formData.billType;
}
this.tableSelection();
this.loading = false;
})
.catch(() => {
this.loading = false;
this.list = [];
this.total = 0;
});
},
intentBack() {
this.$router.go(-1);
},
getBusType() {
let query = {
enabled: true,
};
getBussinessType(query)
.then((response) => {
this.busTypes = response.data.list || [];
this.filterQuery.billAction = this.busTypes[0].action;
})
.catch(() => {
});
},
if (this.$isBlank(this.formData.action)) { geActionName(action) {
this.$message.warning("请选择单据类型!"); this.busTypes.forEach((obj) => {
return; if (obj.action == action) {
return obj.name;
} }
});
},
if (this.$isBlank(this.formData.corpOrderId)) {
let date = new Date();
this.formData.corpOrderId = parseTime(date, '{y}{m}{d}{h}{i}{s}') + Math.ceil(Math.random() * 89 + 10);
}
this.formData.code = this.formData.code.trim();
if (this.$isBlank(this.formData.code)) return;
this.loading = true;
let tQuery = Object.assign(JSON.parse(JSON.stringify(this.formData))); findMethod(query) {
tQuery.orderId = this.idQuery.id; console.log(query);
tQuery.actDate = parseTime(this.formData.actDate, '{y}-{m}-{d} {h}:{i}:{s}'); this.fromOptions = [];
tQuery.action = this.formData.action; let cQuery = {
console.log(tQuery.action); key: query,
addOrderWeb(tQuery).then((response) => { };
if (response.code === 20000) { getBasicUnitMaintains(cQuery)
this.idQuery.id = response.data; .then((response) => {
this.corpOrderIdDisabled = true; this.loading = false;
this.getCodeList(); this.fromOptions = response.data.page.list || [];
} else { })
this.$alert(response.message, '提示', { .catch(() => {
confirmButtonText: '确定',
type: 'warning',
closeOnClickModal: true,
callback: action => {
this.$refs.inputRef.focus();
}
});
// this.$message.error(response.message);
}
this.loading = false; this.loading = false;
}); });
}, },
unitChange(row) { findStorageMethod(query) {
console.log(row); console.log(query);
this.formData.fromCorpId = row.erpId; this.fromStorageOptions = [];
this.formData.fromCorp = row.name; let cQuery = {
}, key: query,
deleteCode(index, row) { };
console.log(row.id) filterAll(cQuery)
this.$confirm("是否删除?", "提示", { .then((response) => {
confirmButtonText: "确定", this.fromStorageOptions = response.data || [];
cancelButtonText: "取消", })
type: "warning", .catch(() => {
}).then(() => {
this.loading = true;
let tQuery = {
id: row.id
}
deleteCodesTempById(tQuery)
.then((response) => {
if (response.code === 20000) {
this.getCodeList();
} else {
this.$message.error(response.message);
}
this.loading = false;
});
}).catch(() => {
}); });
}, },
getInputFocus(event) { getStorage(event) {
event.currentTarget.select(); // let query = {
}, // advanceType: this.getActionName(event),
tableSelection() { // };
this.$refs.multipleTable.clearSelection(); this.storageList = [];
this.$refs.multipleTable.toggleAllSelection(); // this.formData.locStorageCode = null;
}, filterAll()
handleSizeChange(val) { .then((response) => {
this.query.limit = val; this.storageList = response.data || [];
this.getCodeList(); this.fromStorageOptions = response.data || [];
}, })
handleCurrentChange(val) { .catch(() => {
this.query.page = val;
this.getCodeList();
},
getCodeList() {
this.loading = true;
this.query.orderId = this.idQuery.id;
errorCodeList(this.query) //
.then((response) => {
this.codeArray = response.data.list || [];
this.total = response.data.total || 0;
for (let i = 0; i < this.codeArray.length; i++) {
this.codeArray[i].fromType = this.formData.fromType;
this.codeArray[i].billType = this.formData.billType;
}
this.tableSelection();
this.loading = false;
})
.catch(() => {
this.loading = false;
this.list = [];
this.total = 0;
});
},
intentBack() {
this.$router.go(-1);
},
getBusType() {
let query = {
enabled: true,
};
getBussinessType(query)
.then((response) => {
this.busTypes = response.data.list || [];
this.filterQuery.billAction = this.busTypes[0].action;
})
.catch(() => {
});
},
geActionName(action){
this.busTypes.forEach((obj) => {
if (obj.action == action) {
return obj.name;
}
}); });
},
findMethod(query) {
console.log(query);
this.fromOptions = [];
let cQuery = {
key: query,
};
getBasicUnitMaintains(cQuery)
.then((response) => {
this.loading = false;
this.fromOptions = response.data.page.list || [];
})
.catch(() => {
this.loading = false;
});
},
}, },
filters: {}, getActionName(action) {
mounted() { for (let i = 0; i < this.busTypes.length; i++) {
document.body.ondrop = function (event) { if (this.busTypes[i].action === action) {
event.preventDefault(); return this.busTypes[i].advanceType;
event.stopPropagation(); }
}; }
}, },
created() { getActionItem(action) {
this.formData.code = ''; for (let i = 0; i < this.busTypes.length; i++) {
this.formData.actDate = new Date(); if (this.busTypes[i].action === action) {
this.codeArray = []; return this.busTypes[i];
// this.formData.fromCorp = store.getters.customerId === 110 ? '' : store.getters.companyName; }
// this.formData.customerId = store.getters.customerId; }
this.getBusType(); },
if (this.$isNotBlank(this.idQuery.id)) { actionChange(item) {
this.formData.actDate = new Date(this.idQuery.actDate); this.curAction = this.getActionItem(item);
this.formData.corpOrderId = this.idQuery.corpOrderId; },
this.corpOrderIdDisabled = true; },
console.log(this.idQuery.fromCorp) filters: {},
this.formData.action = this.idQuery.action; mounted() {
this.formData.fromCorp = this.idQuery.fromCorp; document.body.ondrop = function (event) {
this.formData.fromCorpId = this.idQuery.fromCorpId; event.preventDefault();
this.actionEnable = true; event.stopPropagation();
this.getCodeList(); };
},
created() {
this.formData.code = '';
this.formData.actDate = new Date();
this.codeArray = [];
// this.formData.fromCorp = store.getters.customerId === 110 ? '' : store.getters.companyName;
// this.formData.customerId = store.getters.customerId;
this.getBusType();
this.getStorage(this.formData.billType);
if (this.$isNotBlank(this.idQuery.id)) {
this.formData.actDate = new Date(this.idQuery.actDate);
this.formData.corpOrderId = this.idQuery.corpOrderId;
this.corpOrderIdDisabled = true;
console.log(this.idQuery.fromCorp)
this.formData.action = this.idQuery.action;
this.formData.fromCorp = this.idQuery.fromCorp;
this.formData.fromCorpId = this.idQuery.fromCorpId;
this.formData.locStorageCode = this.idQuery.locStorageCode;
this.actionEnable = true;
this.getCodeList();
} else {
this.corpOrderIdDisabled = false;
if (JSON.stringify(this.$route.query) === '{}') {
// this.formData.corpOrderId = new Date().getTime() + (Math.ceil(Math.random() * 10 + 10) + '');
let date = new Date();
this.formData.corpOrderId = parseTime(date, '{y}{m}{d}{h}{i}{s}') + Math.ceil(Math.random() * 89 + 10);
} else { } else {
this.corpOrderIdDisabled = false; //
if (JSON.stringify(this.$route.query) === '{}') { let query = this.$route.query;
// this.formData.corpOrderId = new Date().getTime() + (Math.ceil(Math.random() * 10 + 10) + ''); this.orderNo = query.id;
let date = new Date();
this.formData.corpOrderId = parseTime(date, '{y}{m}{d}{h}{i}{s}') + Math.ceil(Math.random() * 89 + 10);
} else {
//
let query = this.$route.query;
this.orderNo = query.id;
this.query = Object.assign(this.query, query); this.query = Object.assign(this.query, query);
this.query.limit = parseInt(this.query.limit); this.query.limit = parseInt(this.query.limit);
this.query.corpOrderId = query.id; this.query.corpOrderId = query.id;
// //
// this.getCodeList(); // this.getCodeList();
}
} }
}, }
}; },
};
</script> </script>
<style> <style>
.ao-text { .ao-text {
width: 100%; width: 100%;
font-size: 13px; font-size: 13px;
font-family: "Microsoft YaHei"; font-family: "Microsoft YaHei";
float: right; float: right;
text-align: right; text-align: right;
margin-top: 10px; margin-top: 10px;
} }
</style> </style>

@ -144,6 +144,7 @@
:close-on-click-modal="false" :close-on-click-modal="false"
:close-on-press-escape="false" :close-on-press-escape="false"
title="选择往来单位" title="选择往来单位"
append-to-body
:visible.sync="dialogTableVisible" :visible.sync="dialogTableVisible"
width="70%" width="70%"
> >
@ -192,6 +193,19 @@
</el-table> </el-table>
</el-dialog> </el-dialog>
<el-dialog
title="选择仓库信息"
:visible.sync="dialogStorageVisible"
width="70%"
append-to-body
:close-on-click-modal="false"
:close-on-press-escape="false"
v-if="dialogStorageVisible"
>
<dialogSelectInvStorage v-on:selectStorage="selectStorage"></dialogSelectInvStorage>
</el-dialog>
<el-dialog <el-dialog
title="单号详情" title="单号详情"
:visible.sync="codeDetailVisible" :visible.sync="codeDetailVisible"
@ -226,6 +240,7 @@ import {getBussinessType} from "../../api/basic/bussinessType";
import {getBasicUnitMaintains} from "../../api/basic/basicUnitMaintain" import {getBasicUnitMaintains} from "../../api/basic/basicUnitMaintain"
import draggable from "vuedraggable"; import draggable from "vuedraggable";
import codeDetail from "./IONewCode"; import codeDetail from "./IONewCode";
import dialogSelectInvStorage from "./DialogSelectInvStorage";
const formJson = { const formJson = {
site_id: "", site_id: "",
@ -269,6 +284,7 @@ export default {
adList: {}, adList: {},
adListNoDataText: "无数据", adListNoDataText: "无数据",
queryAdIdAsyncLoading: false, queryAdIdAsyncLoading: false,
dialogStorageVisible:false,
codeDetailVisible: false, codeDetailVisible: false,
total: 0, total: 0,
loading: true, loading: true,
@ -301,6 +317,7 @@ export default {
components: { components: {
draggable, draggable,
codeDetail, codeDetail,
dialogSelectInvStorage,
}, },
methods: { methods: {
onReset() { onReset() {
@ -329,8 +346,16 @@ export default {
this.getList(); this.getList();
}, },
handleUnitClick(row) { handleUnitClick(row) {
// this.curIndex = row.id;
// this.dialogTableVisible = true;
this.curIndex = row.id; this.curIndex = row.id;
this.dialogTableVisible = true; let actionItem = this.getActionItem(row.action);
if (actionItem.corpType == 0) {//
this.dialogTableVisible = true;
} else {
this.dialogStorageVisible = true;
}
}, },
closeDetailDialog() { closeDetailDialog() {
this.codeDetailVisible = false; this.codeDetailVisible = false;
@ -395,7 +420,20 @@ export default {
.catch(() => { .catch(() => {
}); });
}, },
selectStorage(row) {
console.log(row.id);
this.unitUpdateQuery.id = this.curIndex;
this.unitUpdateQuery.fromCorp = row.name;
this.unitUpdateQuery.fromCorpId = row.code;
updateUnit(this.unitUpdateQuery)
.then((response) => {
this.dialogStorageVisible = false;
this.getList();
})
.catch(() => {
this.dialogStorageVisible = false;
});
},
deleteDialog(rowId) { deleteDialog(rowId) {
this.$confirm("此操作将永久删除该订单, 是否继续?", "提示", { this.$confirm("此操作将永久删除该订单, 是否继续?", "提示", {
confirmButtonText: "确定", confirmButtonText: "确定",
@ -460,6 +498,13 @@ export default {
this.codeDetailVisible = true; this.codeDetailVisible = true;
this.idQuery.id = row.id; this.idQuery.id = row.id;
}, },
getActionItem(action) {
for (let i = 0; i < this.busTypes.length; i++) {
if (this.busTypes[i].action === action) {
return this.busTypes[i];
}
}
},
}, },
filters: { filters: {
statusFilterType(status) { statusFilterType(status) {

@ -517,9 +517,10 @@ export default {
if (row.id !== null && row.id !== undefined && row.id !== '') { if (row.id !== null && row.id !== undefined && row.id !== '') {
this.idQuery = row; this.idQuery = row;
this.idQuery.id = row.id; this.idQuery.id = row.id;
this.idQuery.locStorageCode = row.locStorageCode;
this.idQuery.actDate = row.actDate; this.idQuery.actDate = row.actDate;
this.idQuery.corpOrderId = row.corpOrderId; this.idQuery.corpOrderId = row.corpOrderId;
this.idQuery.billType = row.action;
} }
this.addOrderVisible = true; this.addOrderVisible = true;
}, },

Loading…
Cancel
Save