|
|
|
@ -2,18 +2,17 @@
|
|
|
|
|
<div>
|
|
|
|
|
|
|
|
|
|
<el-form :model="formData" :rules="formRules" ref="dataForm">
|
|
|
|
|
<el-button-group style="display: flex">
|
|
|
|
|
<!-- <el-button-->
|
|
|
|
|
<!-- type="primary"-->
|
|
|
|
|
<!-- @click.native="submit('1')"-->
|
|
|
|
|
<!-- style="margin: -50px 0 10px auto; height: 35px"-->
|
|
|
|
|
<!-- >保存订单-->
|
|
|
|
|
<!-- </el-button-->
|
|
|
|
|
<!-- >-->
|
|
|
|
|
<el-button-group style="display: flex;margin: -50px 0 10px 80%; height: 35px">
|
|
|
|
|
|
|
|
|
|
<el-button
|
|
|
|
|
type="primary"
|
|
|
|
|
@click.native="saveOrder()"
|
|
|
|
|
>草稿保存
|
|
|
|
|
</el-button
|
|
|
|
|
>
|
|
|
|
|
<el-button
|
|
|
|
|
type="primary"
|
|
|
|
|
@click.native="submit('0')"
|
|
|
|
|
style="margin: -50px 60px 10px auto; height: 35px"
|
|
|
|
|
>提交订单
|
|
|
|
|
</el-button
|
|
|
|
|
>
|
|
|
|
@ -33,7 +32,7 @@
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="2">
|
|
|
|
|
<div class="ao-text">
|
|
|
|
|
<span>日期:</span>
|
|
|
|
|
<span>单据时间:</span>
|
|
|
|
|
</div>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="8">
|
|
|
|
@ -49,7 +48,6 @@
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
</el-row>
|
|
|
|
|
|
|
|
|
|
<el-row :gutter="20">
|
|
|
|
|
|
|
|
|
|
<el-col :span="2">
|
|
|
|
@ -97,7 +95,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</el-row>
|
|
|
|
|
<!-- :disabled="actionEnable"/-->
|
|
|
|
|
<el-row :gutter="20">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -108,7 +105,7 @@
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="8">
|
|
|
|
|
<el-form-item class="query-form-item" prop="fromCorp"
|
|
|
|
|
v-if="curAction.corpType ==0">
|
|
|
|
|
v-if="curAction.corpType ==0 || curAction.corpType == 3 || (curAction.corpType == 2 && !curAction.genUnit)">
|
|
|
|
|
<el-select
|
|
|
|
|
v-model="formData.fromCorp"
|
|
|
|
|
filterable
|
|
|
|
@ -153,7 +150,8 @@
|
|
|
|
|
</el-option>
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item class="query-form-item" prop="fromCorp" v-if="curAction.corpType ==2">
|
|
|
|
|
<el-form-item class="query-form-item" prop="fromCorp"
|
|
|
|
|
v-if="curAction.corpType ==2 && curAction.genUnit">
|
|
|
|
|
<el-input v-model="formData.fromCorp" auto-complete="off"
|
|
|
|
|
clearable
|
|
|
|
|
placeholder="请输入病人住院号"
|
|
|
|
@ -161,7 +159,6 @@
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
</el-row>
|
|
|
|
|
|
|
|
|
|
<el-row :gutter="20">
|
|
|
|
|
<el-col :span="2">
|
|
|
|
|
<div class="ao-text">
|
|
|
|
@ -174,7 +171,6 @@
|
|
|
|
|
@focus="getInputFocus($event)"
|
|
|
|
|
@keypress.enter.native="addCode()"
|
|
|
|
|
v-model="formData.code"
|
|
|
|
|
auto-complete="off"
|
|
|
|
|
ref='inputRef'
|
|
|
|
|
></el-input>
|
|
|
|
|
</el-form-item>
|
|
|
|
@ -195,6 +191,7 @@
|
|
|
|
|
</el-row>
|
|
|
|
|
|
|
|
|
|
<el-table v-loading="loading" :data="codeArray" style="width: 100%;" max-height="350" height="350"
|
|
|
|
|
:row-style="rowStyle"
|
|
|
|
|
ref="multipleTable">
|
|
|
|
|
<el-table-column
|
|
|
|
|
type="selection"
|
|
|
|
@ -206,6 +203,13 @@
|
|
|
|
|
prop="code"
|
|
|
|
|
show-overflow-tooltip
|
|
|
|
|
></el-table-column>
|
|
|
|
|
|
|
|
|
|
<el-table-column
|
|
|
|
|
label="供应商"
|
|
|
|
|
prop="supName"
|
|
|
|
|
show-overflow-tooltip
|
|
|
|
|
></el-table-column>
|
|
|
|
|
|
|
|
|
|
<el-table-column
|
|
|
|
|
label="扫码数量"
|
|
|
|
|
prop="count"
|
|
|
|
@ -222,6 +226,22 @@
|
|
|
|
|
>删除
|
|
|
|
|
</el-button
|
|
|
|
|
>
|
|
|
|
|
<el-button
|
|
|
|
|
type="text"
|
|
|
|
|
size="small"
|
|
|
|
|
:disabled="scope.row.relId != null "
|
|
|
|
|
@click.native.stop="bindRl(scope.row)"
|
|
|
|
|
>选择产品
|
|
|
|
|
</el-button
|
|
|
|
|
>
|
|
|
|
|
<el-button
|
|
|
|
|
type="text"
|
|
|
|
|
size="small"
|
|
|
|
|
:disabled=" scope.row.supId !=null"
|
|
|
|
|
@click.native.stop="handleUnitClick(scope.row)"
|
|
|
|
|
>选择供应商
|
|
|
|
|
</el-button
|
|
|
|
|
>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
</el-table>
|
|
|
|
@ -235,12 +255,41 @@
|
|
|
|
|
</el-pagination>
|
|
|
|
|
</div>
|
|
|
|
|
</el-form>
|
|
|
|
|
<el-dialog
|
|
|
|
|
title="选择供应商"
|
|
|
|
|
:visible.sync="dialogTableVisible"
|
|
|
|
|
v-if="dialogTableVisible"
|
|
|
|
|
width="70%"
|
|
|
|
|
append-to-body
|
|
|
|
|
>
|
|
|
|
|
<DialogSelectUnit
|
|
|
|
|
:codeId="curRow"
|
|
|
|
|
v-on:selectSupUnit="selectSupUnit"
|
|
|
|
|
v-on:closeBindDialog="closeBindDialog"
|
|
|
|
|
></DialogSelectUnit>
|
|
|
|
|
</el-dialog>
|
|
|
|
|
<el-dialog
|
|
|
|
|
title="绑定产品ID"
|
|
|
|
|
:visible.sync="selectRlVisible"
|
|
|
|
|
width="80%"
|
|
|
|
|
v-if="selectRlVisible"
|
|
|
|
|
append-to-body
|
|
|
|
|
>
|
|
|
|
|
<selectRlDialog
|
|
|
|
|
:curRow="curRow"
|
|
|
|
|
v-on:selectBindRl="selectBindRl"
|
|
|
|
|
v-on:closeBindDialog="closeBindDialog"
|
|
|
|
|
></selectRlDialog>
|
|
|
|
|
</el-dialog>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
import {
|
|
|
|
|
errorCodeList, addOrderWeb, deleteCodesTempById, submitOrderWeb
|
|
|
|
|
errorCodeList, addOrderWeb, deleteCodesTempById, submitOrderWeb, saveOrderWeb,
|
|
|
|
|
updateCodeBindSup
|
|
|
|
|
} from "../../api/warehouse/order";
|
|
|
|
|
import {getBussinessType} from "../../api/basic/bussinessType";
|
|
|
|
|
import draggable from "vuedraggable";
|
|
|
|
@ -249,6 +298,8 @@ import store from "../../store";
|
|
|
|
|
import {getBasicUnitMaintains} from "../../api/basic/basicUnitMaintain"
|
|
|
|
|
import {filterAll, filterAllByLoc, filterAllByUser} from "@/api/basic/invWarehouse";
|
|
|
|
|
import {getLocalBusType, getLocalJoinBusType, getLocalJoinByUser} from "../../api/basic/busLocalType";
|
|
|
|
|
import DialogSelectUnit from "./DialogSelectUnit";
|
|
|
|
|
import selectRlDialog from "./DialogSelectRl";
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
|
name: "idQuery",
|
|
|
|
@ -287,6 +338,7 @@ export default {
|
|
|
|
|
action: null,
|
|
|
|
|
locStorageCode: null,
|
|
|
|
|
},
|
|
|
|
|
curId: null,
|
|
|
|
|
storageList: [],
|
|
|
|
|
formRules: {
|
|
|
|
|
temp: [
|
|
|
|
@ -308,10 +360,14 @@ export default {
|
|
|
|
|
corpType: 0,
|
|
|
|
|
genUnit: false,
|
|
|
|
|
},
|
|
|
|
|
curRow: null,
|
|
|
|
|
selectRlVisible: false,
|
|
|
|
|
dialogTableVisible: false,
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
components: {
|
|
|
|
|
draggable,
|
|
|
|
|
DialogSelectUnit, selectRlDialog
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
submit(formName) {
|
|
|
|
@ -319,6 +375,7 @@ export default {
|
|
|
|
|
this.$message.error('未添加条码');
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
let tQuery = {
|
|
|
|
|
orderId: this.idQuery.id,
|
|
|
|
|
locStorageCode: this.formData.locStorageCode,
|
|
|
|
@ -338,6 +395,27 @@ export default {
|
|
|
|
|
this.loading = false;
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
saveOrder() {
|
|
|
|
|
if (this.formData.action == null || this.formData.action == '') {
|
|
|
|
|
this.$message.error('未选择扫码单据类型');
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
if (this.formData.locStorageCode == null || this.formData.locStorageCode == '') {
|
|
|
|
|
this.$message.error('当前仓库不能为空');
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
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}');
|
|
|
|
|
saveOrderWeb(tQuery).then((response) => {
|
|
|
|
|
if (response.code === 20000) {
|
|
|
|
|
this.closeDialog();
|
|
|
|
|
} else {
|
|
|
|
|
this.$message.error(response.message);
|
|
|
|
|
}
|
|
|
|
|
this.loading = false;
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
// 刷新表单
|
|
|
|
|
resetForm() {
|
|
|
|
|
if (this.$refs["dataForm"]) {
|
|
|
|
@ -348,15 +426,24 @@ export default {
|
|
|
|
|
this.getList();
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
addCode() {
|
|
|
|
|
addCode(event) {
|
|
|
|
|
this.formData.corpOrderId = this.formData.corpOrderId.trim();
|
|
|
|
|
this.actionEnable = true;
|
|
|
|
|
|
|
|
|
|
if (event == null) {
|
|
|
|
|
this.$refs.inputRef.focus();
|
|
|
|
|
} else event.target.select();
|
|
|
|
|
if (this.$isBlank(this.formData.action)) {
|
|
|
|
|
this.$message.warning("请选择单据类型!");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (this.$isBlank(this.formData.locStorageCode)) {
|
|
|
|
|
this.$message.error('当前仓库不能为空');
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if (this.$isBlank(this.formData.fromCorp)) {
|
|
|
|
|
this.$message.error('当前往来单位不能为空');
|
|
|
|
|
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);
|
|
|
|
@ -374,17 +461,46 @@ export default {
|
|
|
|
|
if (response.code === 20000) {
|
|
|
|
|
this.idQuery.id = response.data;
|
|
|
|
|
this.corpOrderIdDisabled = true;
|
|
|
|
|
this.$refs.inputRef.focus();
|
|
|
|
|
this.getCodeList();
|
|
|
|
|
} else {
|
|
|
|
|
this.$alert(response.message, '提示', {
|
|
|
|
|
confirmButtonText: '确定',
|
|
|
|
|
type: 'warning',
|
|
|
|
|
closeOnClickModal: true,
|
|
|
|
|
callback: action => {
|
|
|
|
|
this.$refs.inputRef.focus();
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
// this.$message.error(response.message);
|
|
|
|
|
this.corpOrderIdDisabled = true;
|
|
|
|
|
if (response.code == 502) {
|
|
|
|
|
this.curRow = response.data;
|
|
|
|
|
this.idQuery.id = this.curRow.orderId;
|
|
|
|
|
this.getCodeList();
|
|
|
|
|
this.$alert(response.message, '提示', {
|
|
|
|
|
confirmButtonText: '确定',
|
|
|
|
|
type: 'warning',
|
|
|
|
|
closeOnClickModal: true,
|
|
|
|
|
callback: action => {
|
|
|
|
|
this.bindRl(response.data);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
} else if (response.code == 503) {
|
|
|
|
|
this.curRow = response.data;
|
|
|
|
|
this.idQuery.id = this.curRow.orderId;
|
|
|
|
|
this.getCodeList();
|
|
|
|
|
this.$alert(response.message, '提示', {
|
|
|
|
|
confirmButtonText: '确定',
|
|
|
|
|
type: 'warning',
|
|
|
|
|
closeOnClickModal: true,
|
|
|
|
|
callback: action => {
|
|
|
|
|
this.handleUnitClick(response.data);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
this.$alert(response.message, '提示', {
|
|
|
|
|
confirmButtonText: '确定',
|
|
|
|
|
type: 'warning',
|
|
|
|
|
closeOnClickModal: true,
|
|
|
|
|
callback: action => {
|
|
|
|
|
this.$refs.inputRef.focus();
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
this.loading = false;
|
|
|
|
|
});
|
|
|
|
@ -394,6 +510,7 @@ export default {
|
|
|
|
|
console.log(row);
|
|
|
|
|
this.formData.fromCorpId = row.erpId;
|
|
|
|
|
this.formData.fromCorp = row.name;
|
|
|
|
|
this.curRow = row;
|
|
|
|
|
},
|
|
|
|
|
storageChange(row) {
|
|
|
|
|
console.log(row);
|
|
|
|
@ -491,11 +608,33 @@ export default {
|
|
|
|
|
this.fromOptions = [];
|
|
|
|
|
let cQuery = {
|
|
|
|
|
key: query,
|
|
|
|
|
corpType: null,
|
|
|
|
|
outType: null,
|
|
|
|
|
};
|
|
|
|
|
if (this.curAction.corpType == 3) {//特殊往来
|
|
|
|
|
cQuery.corpType = 4;
|
|
|
|
|
this.formData.fromCorpId = this.curAction.defaultUnit;
|
|
|
|
|
} else if (this.curAction.corpType == 2)//客户
|
|
|
|
|
{
|
|
|
|
|
cQuery.corpType = 4;
|
|
|
|
|
cQuery.outType = 2;
|
|
|
|
|
|
|
|
|
|
} else if (this.curAction.corpType == 0) {
|
|
|
|
|
cQuery.corpType = 2;
|
|
|
|
|
} else return;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
getBasicUnitMaintains(cQuery)
|
|
|
|
|
.then((response) => {
|
|
|
|
|
this.loading = false;
|
|
|
|
|
this.fromOptions = response.data.page.list || [];
|
|
|
|
|
if (this.curAction.corpType == 3) {
|
|
|
|
|
for (let i = 0; i < this.fromOptions.length; i++) {
|
|
|
|
|
if (this.fromOptions[i].erpId == this.formData.fromCorpId) {
|
|
|
|
|
this.formData.fromCorp = this.fromOptions[i].name;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
.catch(() => {
|
|
|
|
|
this.loading = false;
|
|
|
|
@ -507,7 +646,7 @@ export default {
|
|
|
|
|
return;
|
|
|
|
|
this.fromStorageOptions = [];
|
|
|
|
|
let cQuery = {
|
|
|
|
|
locInvCode: this.formData.locStorageCode ,
|
|
|
|
|
locInvCode: this.formData.locStorageCode,
|
|
|
|
|
};
|
|
|
|
|
filterAllByLoc(cQuery)
|
|
|
|
|
.then((response) => {
|
|
|
|
@ -545,8 +684,75 @@ export default {
|
|
|
|
|
},
|
|
|
|
|
actionChange(item) {
|
|
|
|
|
this.curAction = this.getActionItem(item);
|
|
|
|
|
this.formData.locStorageCode = this.curAction.storageCode;
|
|
|
|
|
// this.formData.locStorageCode = this.curAction.storageCode;
|
|
|
|
|
this.findMethod();
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
//绑定数据
|
|
|
|
|
bindRl(val) {
|
|
|
|
|
console.log("curRow.erpId = " + val.id);
|
|
|
|
|
this.curRow = val;
|
|
|
|
|
this.selectRlVisible = true;
|
|
|
|
|
},
|
|
|
|
|
handleUnitClick(row) {
|
|
|
|
|
console.log("curRow.erpId = " + row.id);
|
|
|
|
|
this.curRow = row;
|
|
|
|
|
this.dialogTableVisible = true;
|
|
|
|
|
},
|
|
|
|
|
selectSupUnit(row) {
|
|
|
|
|
let query = {
|
|
|
|
|
id: this.curRow.id,
|
|
|
|
|
supId: row.erpId,
|
|
|
|
|
};
|
|
|
|
|
console.log("row.erpId = " + row.erpId);
|
|
|
|
|
updateCodeBindSup(query).then((response) => {
|
|
|
|
|
if (response.code == 20000) {
|
|
|
|
|
this.$message.success("绑定成功");
|
|
|
|
|
this.idQuery.id = this.curRow.orderId;
|
|
|
|
|
this.getCodeList();
|
|
|
|
|
} else {
|
|
|
|
|
this.$message.error("绑定失败");
|
|
|
|
|
}
|
|
|
|
|
}).catch(() => {
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
selectBindRl(row) {
|
|
|
|
|
let query = {
|
|
|
|
|
id: this.curRow.id,
|
|
|
|
|
relId: row.id,
|
|
|
|
|
};
|
|
|
|
|
console.log("row.relId = " + row.id);
|
|
|
|
|
updateCodeBindSup(query).then((response) => {
|
|
|
|
|
if (response.code == 20000) {
|
|
|
|
|
this.$message.success("绑定成功");
|
|
|
|
|
this.idQuery.id = this.curRow.orderId;
|
|
|
|
|
this.getCodeList();
|
|
|
|
|
} else {
|
|
|
|
|
this.$message.error("绑定失败");
|
|
|
|
|
}
|
|
|
|
|
}).catch(() => {
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
closeBindDialog(val) {
|
|
|
|
|
console.log("closeBindDialog" + val);
|
|
|
|
|
this.selectRlVisible = false;
|
|
|
|
|
this.dialogTableVisible = false;
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
rowStyle({row, rowIndex}) {
|
|
|
|
|
let rowBackground = {};
|
|
|
|
|
if (row.supId == null || row.relId == null) {
|
|
|
|
|
//rowBackground.background="#f6f5ee";
|
|
|
|
|
rowBackground.color = '#f60303';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return rowBackground;
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
filters: {},
|
|
|
|
|
mounted() {
|
|
|
|
@ -562,7 +768,7 @@ export default {
|
|
|
|
|
// this.formData.fromCorp = store.getters.customerId === 110 ? '医院' : store.getters.companyName;
|
|
|
|
|
// this.formData.customerId = store.getters.customerId;
|
|
|
|
|
this.getBusType();
|
|
|
|
|
this.getStorage(this.formData.billType);
|
|
|
|
|
this.getStorage(this.formData.action);
|
|
|
|
|
if (this.$isNotBlank(this.idQuery.id)) {
|
|
|
|
|
this.formData.actDate = new Date(this.idQuery.actDate);
|
|
|
|
|
this.formData.corpOrderId = this.idQuery.corpOrderId;
|
|
|
|
|