|
@@ -117,7 +117,6 @@
|
|
|
<el-form-item size="mini" label="生产企业" prop="prodEntp" class="long">
|
|
|
<el-input v-model="listQuery.prodEntp" placeholder="请输入生产企业"></el-input>
|
|
|
</el-form-item>
|
|
|
-
|
|
|
<el-form-item size="mini" label="是否集采" prop="isFas" class="long">
|
|
|
<el-select v-model="listQuery.isFas" placeholder="请选择是否集采" clearable>
|
|
|
<el-option
|
|
@@ -143,11 +142,16 @@
|
|
|
element-loading-text="加载中..."
|
|
|
border
|
|
|
:span-method="handleSpan"
|
|
|
+ @selection-change="handleSelectionChange"
|
|
|
>
|
|
|
<template slot="empty">
|
|
|
<img src="@/assets/nopage.png" alt />
|
|
|
<p>暂无数据</p>
|
|
|
</template>
|
|
|
+ <el-table-column
|
|
|
+ type="selection"
|
|
|
+ width="55">
|
|
|
+ </el-table-column>
|
|
|
<el-table-column fixed type="index" label="序号" width="60" />
|
|
|
<el-table-column label="耗材编码" prop="prodCode" />
|
|
|
<el-table-column label="医保编码" prop="hiCode" />
|
|
@@ -183,13 +187,7 @@
|
|
|
label-width="0"
|
|
|
class="item"
|
|
|
:prop="scope.$index + '.lotNum'"
|
|
|
- :rules="[
|
|
|
- {
|
|
|
- required: true,
|
|
|
- message: '请输入',
|
|
|
- trigger: 'blur',
|
|
|
- },
|
|
|
- ]"
|
|
|
+ :rules="lotNumCheck(scope.row,lotNumRule)"
|
|
|
>
|
|
|
<el-input placeholder="请输入" v-model="scope.row.lotNum" @change="handleEDIT(scope.row,scope.$index)"></el-input>
|
|
|
</el-form-item>
|
|
@@ -201,13 +199,7 @@
|
|
|
label-width="0"
|
|
|
class="item"
|
|
|
:prop="scope.$index + '.manuDate'"
|
|
|
- :rules="[
|
|
|
- {
|
|
|
- required: true,
|
|
|
- message: '请选择生产日期',
|
|
|
- trigger: 'change',
|
|
|
- },
|
|
|
- ]"
|
|
|
+ :rules="lotNumCheck(scope.row,manuDateRule)"
|
|
|
>
|
|
|
<el-date-picker
|
|
|
style="width: 100%"
|
|
@@ -227,13 +219,7 @@
|
|
|
label-width="0"
|
|
|
class="item"
|
|
|
:prop="scope.$index + '.prodExpy'"
|
|
|
- :rules="[
|
|
|
- {
|
|
|
- required: true,
|
|
|
- message: '请选择有效期',
|
|
|
- trigger: 'change',
|
|
|
- },
|
|
|
- ]"
|
|
|
+ :rules="lotNumCheck(scope.row,prodExpyRule)"
|
|
|
>
|
|
|
<el-date-picker
|
|
|
style="width: 100%"
|
|
@@ -508,165 +494,6 @@
|
|
|
>
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
- <!-- 出库单预览 -->
|
|
|
- <el-dialog title="出库单预览" :visible.sync="printVisible" width="70%">
|
|
|
- <div id="printMe">
|
|
|
- <table cellspacing="0" cellpadding="0" border="1" width="100%" class="chuTable">
|
|
|
- <tr height="50px">
|
|
|
- <th :colspan="12" :rowspan="1" style="font-size: 26px; font-weight: 800">
|
|
|
- 送货单
|
|
|
- </th>
|
|
|
- <th :colspan="8" :rowspan="1" style="font-size: 20px">
|
|
|
- NO:<span style="color: red">{{ listForm.id }}</span>
|
|
|
- </th>
|
|
|
- </tr>
|
|
|
- <tr class="hang">
|
|
|
- <th :colspan="2">医院名称:</th>
|
|
|
- <th :colspan="8">
|
|
|
- {{ listForm.branchName }}
|
|
|
- </th>
|
|
|
- <!-- <th>
|
|
|
- 制单人:
|
|
|
- </th>
|
|
|
- <th :colspan="4">
|
|
|
- {{ listForm.docmker }}
|
|
|
- </th> -->
|
|
|
- <th :colspan="2">制单时间:</th>
|
|
|
- <th :colspan="8">
|
|
|
- {{ listForm.docmkDate }}
|
|
|
- </th>
|
|
|
- </tr>
|
|
|
- <tr class="hang">
|
|
|
- <th :colspan="2">出库人:</th>
|
|
|
- <th :colspan="8">
|
|
|
- {{ $store.state.user.username }}
|
|
|
- </th>
|
|
|
- <th :colspan="2">出库日期:</th>
|
|
|
- <th :colspan="8">
|
|
|
- {{ listForm.OutboundDate }}
|
|
|
- </th>
|
|
|
- </tr>
|
|
|
- <tr class="hang">
|
|
|
- <th>序号</th>
|
|
|
- <th>耗材编码</th>
|
|
|
- <th>医保编码</th>
|
|
|
- <th>耗材名称</th>
|
|
|
- <th>商品类别</th>
|
|
|
- <th>规格</th>
|
|
|
- <th>型号</th>
|
|
|
- <th>材质</th>
|
|
|
- <th>生产来源</th>
|
|
|
- <th>注册证号</th>
|
|
|
- <th>生产企业</th>
|
|
|
- <!-- <th>单价</th> -->
|
|
|
- <th>批号</th>
|
|
|
- <th>生产日期</th>
|
|
|
- <th>有效期至</th>
|
|
|
- <!-- <th>UDI码</th> -->
|
|
|
- <th>需求数量</th>
|
|
|
- <th>已出库数量</th>
|
|
|
- <th>剩余出库量</th>
|
|
|
- <th>本次出库数量</th>
|
|
|
-
|
|
|
- </tr>
|
|
|
- <tr v-for="(item, index) in chuList" :key="index" class="hang">
|
|
|
- <td align="center">
|
|
|
- {{ index + 1 }}
|
|
|
- </td>
|
|
|
- <td align="center">
|
|
|
- {{ item.prodCode }}
|
|
|
- </td>
|
|
|
- <td align="center">
|
|
|
- {{ item.hiCode }}
|
|
|
- </td>
|
|
|
- <td align="center">
|
|
|
- {{ item.prodName }}
|
|
|
- </td>
|
|
|
- <td align="center">
|
|
|
- <span v-if="item.mcsType=='0'">普通耗材</span>
|
|
|
- <span v-if="item.mcsType=='1'">高值耗材</span>
|
|
|
- <span v-if="item.mcsType=='2'">试剂</span>
|
|
|
- </td>
|
|
|
- <td align="center">
|
|
|
- {{ item.spec }}
|
|
|
- </td>
|
|
|
- <td align="center">
|
|
|
- {{ item.mol }}
|
|
|
- </td>
|
|
|
- <!-- 材质 -->
|
|
|
- <td align="center">
|
|
|
- {{ item.matl }}
|
|
|
- </td>
|
|
|
- <td align="center">
|
|
|
- <span v-if="item.prodSouc=='1'">国产</span>
|
|
|
- <span v-if="item.prodSouc=='2'">进口</span>
|
|
|
- </td>
|
|
|
- <td align="center">
|
|
|
- {{ item.regcertno }}
|
|
|
- </td>
|
|
|
- <td align="center">
|
|
|
- {{ item.prodEntp }}
|
|
|
- </td>
|
|
|
- <!-- <td align="center">
|
|
|
- {{ item.purcPric }}
|
|
|
- </td> -->
|
|
|
- <td align="center">
|
|
|
- {{ item.lotNum }}
|
|
|
- </td>
|
|
|
- <td align="center">
|
|
|
- {{ item.manuDate }}
|
|
|
- </td>
|
|
|
- <td align="center">
|
|
|
- {{ item.prodExpy }}
|
|
|
- </td>
|
|
|
- <!-- <td align="center">
|
|
|
- {{ item.udi }}
|
|
|
- </td> -->
|
|
|
- <td align="center">
|
|
|
- {{ item.purcCnt }}
|
|
|
- </td>
|
|
|
- <td align="center">
|
|
|
- {{ item.delvCntYck }}
|
|
|
- </td>
|
|
|
- <td align="center">
|
|
|
- {{ item.toDelvCnt }}
|
|
|
- </td>
|
|
|
- <td align="center">
|
|
|
- {{ item.delvCnt }}
|
|
|
- </td>
|
|
|
- </tr>
|
|
|
- <tr class="hang">
|
|
|
- <th align="left" :colspan="6" >合计</th>
|
|
|
- <td :colspan="12" align="left">
|
|
|
- {{ mcsSum }}
|
|
|
- </td>
|
|
|
- <!-- <td align="center"> -->
|
|
|
- <!-- {{ numSum }} -->
|
|
|
- <!-- </td> -->
|
|
|
- </tr>
|
|
|
- <tr class="hang">
|
|
|
- <th :colspan="6" align="left">发货金额(人民币)大写:</th>
|
|
|
- <td :colspan="12">
|
|
|
- {{ mcsSum | toChineseAmount }}
|
|
|
- </td>
|
|
|
- </tr>
|
|
|
- <tr height="50px">
|
|
|
- <th :colspan="6" align="left">备注:</th>
|
|
|
- <td :colspan="12"></td>
|
|
|
- </tr>
|
|
|
- <!-- <tr class="hang">
|
|
|
- <th align="left" :colspan="6">收货人:</th>
|
|
|
- <td :colspan="13"></td>
|
|
|
- </tr> -->
|
|
|
- </table>
|
|
|
- </div>
|
|
|
- <div class="foot-button" style="margin-top: 40px">
|
|
|
- <el-button type="primary" :loading="comfirmLoad" @click="handleConfirm"
|
|
|
- >确认</el-button
|
|
|
- >
|
|
|
- <el-button type="primary" v-print="printObj">打印</el-button>
|
|
|
- </div>
|
|
|
- </el-dialog>
|
|
|
<!-- 订单复用 mulDialog-->
|
|
|
<el-dialog
|
|
|
title="订单复用"
|
|
@@ -735,12 +562,11 @@
|
|
|
import ylStep from "@/components/yl-step";
|
|
|
import ylPagination from "@/components/yl-pagination";
|
|
|
import ylUpload from "@/components/yl-upload";
|
|
|
+import printView from "./printView.vue";
|
|
|
import mcsInfo from "@/views/components/mcs-info.vue";
|
|
|
import { countNumPrice, getTotalAmount } from "@/utils/utils";
|
|
|
import moment from "moment";
|
|
|
-import {
|
|
|
- getMcsOrdDck,
|
|
|
-} from "@/api/orderManage-sup/index";
|
|
|
+import { getMcsOrdDck } from "@/api/orderManage-sup/index";
|
|
|
import {
|
|
|
getMcsOrdDckDetl,
|
|
|
saveDelvOrd,
|
|
@@ -752,21 +578,45 @@ import {
|
|
|
} from "@/api/orderManage-sup/index";
|
|
|
export default {
|
|
|
components: {
|
|
|
- ylStep,
|
|
|
+ ylStep,
|
|
|
ylPagination,
|
|
|
ylUpload,
|
|
|
- mcsInfo
|
|
|
+ mcsInfo,
|
|
|
+ printView,
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
- roleRadio:"",
|
|
|
- cShow:false,
|
|
|
+ roleRadio: "",
|
|
|
+ cShow: false,
|
|
|
pdfSrc: "",
|
|
|
dialogVisible: false,
|
|
|
saveLoad: false,
|
|
|
confirmLoad: false,
|
|
|
endLoad: false,
|
|
|
number: [],
|
|
|
+ orderData: [], //出库单打印数据
|
|
|
+ lotNumRule: [
|
|
|
+ {
|
|
|
+ required: true,
|
|
|
+ message: "请输入",
|
|
|
+ trigger: "blur",
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ manuDateRule: [
|
|
|
+ {
|
|
|
+ required: true,
|
|
|
+ message: "请选择生产日期",
|
|
|
+ trigger: "change",
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ prodExpyRule: [
|
|
|
+ {
|
|
|
+ required: true,
|
|
|
+ message: "请选择有效日期",
|
|
|
+ trigger: "change",
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ multipleSelection: [],
|
|
|
listForm: {
|
|
|
id: "",
|
|
|
detlCnt: "",
|
|
@@ -774,8 +624,8 @@ export default {
|
|
|
docmker: "",
|
|
|
docmkDate: "",
|
|
|
stas: "",
|
|
|
- deptName:"",
|
|
|
- branchName:"",
|
|
|
+ deptName: "",
|
|
|
+ branchName: "",
|
|
|
},
|
|
|
stasOptions: [
|
|
|
{ value: "A", lable: "未受理" },
|
|
@@ -821,35 +671,17 @@ export default {
|
|
|
// 出库单预览
|
|
|
printVisible: false,
|
|
|
chuList: [],
|
|
|
- // 打印
|
|
|
- printObj: {
|
|
|
- id: "printMe",
|
|
|
- popTitle: "", // 打印配置页上方标题
|
|
|
- extraHead: "", //最上方的头部文字,附加在head标签上的额外标签,使用逗号分隔
|
|
|
- preview: "", // 是否启动预览模式,默认是false(开启预览模式,可以先预览后打印)
|
|
|
- previewTitle: "", // 打印预览的标题(开启预览模式后出现),
|
|
|
- previewPrintBtnLabel: "", // 打印预览的标题的下方按钮文本,点击可进入打印(开启预览模式后出现)
|
|
|
- zIndex: "", // 预览的窗口的z-index,默认是 20002(此值要高一些,这涉及到预览模式是否显示在最上面)
|
|
|
- previewBeforeOpenCallback() {}, //预览窗口打开之前的callback(开启预览模式调用)
|
|
|
- previewOpenCallback() {}, // 预览窗口打开之后的callback(开启预览模式调用)
|
|
|
- beforeOpenCallback: () => {}, // 开启打印前的回调事件
|
|
|
- openCallback() {}, // 调用打印之后的回调事件
|
|
|
- closeCallback() {}, //关闭打印的回调事件(无法确定点击的是确认还是取消)
|
|
|
- url: "",
|
|
|
- standard: "",
|
|
|
- extraCss: "",
|
|
|
- },
|
|
|
- fileIndex:null,
|
|
|
- fileIndex1:null,
|
|
|
- endBtn:false,
|
|
|
- listQuery:{
|
|
|
- prodEntp: "",
|
|
|
- isFas: "",
|
|
|
- regcertno: "",
|
|
|
+ fileIndex: null,
|
|
|
+ fileIndex1: null,
|
|
|
+ endBtn: false,
|
|
|
+ listQuery: {
|
|
|
+ prodEntp: "",
|
|
|
+ isFas: "",
|
|
|
+ regcertno: "",
|
|
|
},
|
|
|
isFasData: [
|
|
|
- { value: "1", name: "是" },
|
|
|
- { value: "0", name: "否" },
|
|
|
+ { value: "1", name: "是" },
|
|
|
+ { value: "0", name: "否" },
|
|
|
],
|
|
|
TimeOption: {
|
|
|
disabledDate(time) {
|
|
@@ -861,26 +693,26 @@ export default {
|
|
|
return time.getTime() > Date.now();
|
|
|
},
|
|
|
},
|
|
|
- udidialog:false,
|
|
|
- mulDialog:false,
|
|
|
- udiData:[],
|
|
|
- mulData:[],
|
|
|
- mcsSum:0,
|
|
|
- purcOrdId:"",
|
|
|
- rowIndex:0,
|
|
|
- listQuerym:{
|
|
|
+ udidialog: false,
|
|
|
+ mulDialog: false,
|
|
|
+ udiData: [],
|
|
|
+ mulData: [],
|
|
|
+ mcsSum: 0,
|
|
|
+ purcOrdId: "",
|
|
|
+ rowIndex: 0,
|
|
|
+ listQuerym: {
|
|
|
current: 1,
|
|
|
size: 10,
|
|
|
id: "",
|
|
|
- branchName:"",
|
|
|
+ branchName: "",
|
|
|
docmkDateStart: "",
|
|
|
docmkDateEnd: "",
|
|
|
docmkDate: [],
|
|
|
stas: "",
|
|
|
- spdId:this.$route.query.spdId,
|
|
|
- fyLoad:false,
|
|
|
+ spdId: this.$route.query.spdId,
|
|
|
+ fyLoad: false,
|
|
|
},
|
|
|
- overLoading:false,
|
|
|
+ overLoading: false,
|
|
|
};
|
|
|
},
|
|
|
created() {
|
|
@@ -892,20 +724,22 @@ export default {
|
|
|
this.listForm.docmker = this.$route.query.docmker;
|
|
|
this.listForm.stas = this.$route.query.stas;
|
|
|
this.listForm.docmkDate = this.$route.query.docmkDate;
|
|
|
- this.listForm.OutboundDate = moment(new Date()).format("YYYY-MM-DD HH:mm:ss");
|
|
|
+ this.listForm.OutboundDate = moment(new Date()).format(
|
|
|
+ "YYYY-MM-DD HH:mm:ss"
|
|
|
+ );
|
|
|
this.listForm.branchName = this.$route.query.branchName;
|
|
|
this.listForm.deptName = this.$route.query.deptName;
|
|
|
this.listForm.oprn = this.$route.query.oprn;
|
|
|
this.listForm.oprtRoom = this.$route.query.oprtRoom;
|
|
|
this.listForm.oprtTime = this.$route.query.oprtTime;
|
|
|
this.listForm.atddr = this.$route.query.atddr;
|
|
|
- if(this.listForm.stas=='部分出库'){
|
|
|
- this.endBtn = true
|
|
|
+ if (this.listForm.stas == "部分出库") {
|
|
|
+ this.endBtn = true;
|
|
|
}
|
|
|
- if(this.$route.query.purcType=="2"){
|
|
|
- this.cShow = true
|
|
|
- }else{
|
|
|
- this.cShow = false
|
|
|
+ if (this.$route.query.purcType == "2") {
|
|
|
+ this.cShow = true;
|
|
|
+ } else {
|
|
|
+ this.cShow = false;
|
|
|
}
|
|
|
// this.stasOptions.forEach((i)=>{
|
|
|
// if(i.value == this.$route.query.stas){
|
|
@@ -918,12 +752,18 @@ export default {
|
|
|
numSum: function () {
|
|
|
return this.chuList
|
|
|
.map((row) => row.delvCnt)
|
|
|
- .reduce((acc, cur) => (parseFloat(acc) + parseFloat(cur)).toFixed(2), 0);
|
|
|
+ .reduce(
|
|
|
+ (acc, cur) => (parseFloat(acc) + parseFloat(cur)).toFixed(2),
|
|
|
+ 0
|
|
|
+ );
|
|
|
},
|
|
|
moneySum: function () {
|
|
|
return this.chuList
|
|
|
.map((row) => row.price)
|
|
|
- .reduce((acc, cur) => (parseFloat(acc) + parseFloat(cur)).toFixed(2), 0);
|
|
|
+ .reduce(
|
|
|
+ (acc, cur) => (parseFloat(acc) + parseFloat(cur)).toFixed(2),
|
|
|
+ 0
|
|
|
+ );
|
|
|
},
|
|
|
},
|
|
|
filters: {
|
|
@@ -1003,16 +843,39 @@ export default {
|
|
|
this.getData();
|
|
|
},
|
|
|
methods: {
|
|
|
+ lotNumCheck(row, ruleArray) {
|
|
|
+ let rule = [];
|
|
|
+ let isId = this.multipleSelection.filter((item) => {
|
|
|
+ return item.id == row.id;
|
|
|
+ });
|
|
|
+ if (isId.length > 0) {
|
|
|
+ rule = ruleArray;
|
|
|
+ } else {
|
|
|
+ rule = [];
|
|
|
+ }
|
|
|
+ return rule;
|
|
|
+ },
|
|
|
+ //表格选中触发
|
|
|
+ handleSelectionChange(val) {
|
|
|
+ val.length > 0 &&
|
|
|
+ val.map((item) => {
|
|
|
+ item.purcOrdId = this.$route.query.id;
|
|
|
+ item.materialId = item.prodCode;
|
|
|
+ });
|
|
|
+ this.multipleSelection = val;
|
|
|
+ },
|
|
|
getData() {
|
|
|
this.listLoading = true;
|
|
|
- getMcsOrdDckDetl({ id: this.$route.query.id,
|
|
|
- spdId:this.$route.query.spdId,
|
|
|
- prodEntp:this.listQuery.prodEntp,
|
|
|
- isFas:this.listQuery.isFas,
|
|
|
- regcertno:this.listQuery.regcertno, })
|
|
|
+ getMcsOrdDckDetl({
|
|
|
+ id: this.$route.query.id,
|
|
|
+ spdId: this.$route.query.spdId,
|
|
|
+ prodEntp: this.listQuery.prodEntp,
|
|
|
+ isFas: this.listQuery.isFas,
|
|
|
+ regcertno: this.listQuery.regcertno,
|
|
|
+ })
|
|
|
.then((res) => {
|
|
|
this.tableData = res.data;
|
|
|
- this.tableData.udiList=[];
|
|
|
+ this.tableData.udiList = [];
|
|
|
this.chuList = res.data;
|
|
|
this.listLoading = false;
|
|
|
this.computeCell(this.tableData);
|
|
@@ -1042,7 +905,7 @@ export default {
|
|
|
// }
|
|
|
this.shanchu3(row);
|
|
|
this.numOrPriceChange(index, row);
|
|
|
- this.tableData[index].udiList=[];
|
|
|
+ this.tableData[index].udiList = [];
|
|
|
},
|
|
|
numOrPriceChange(index, row) {
|
|
|
this.$set(
|
|
@@ -1126,36 +989,36 @@ export default {
|
|
|
// 添加批次
|
|
|
handleBatch(row, index) {
|
|
|
let list = {
|
|
|
- prodCode:row.prodCode,
|
|
|
- regcertno:row.regcertno,
|
|
|
+ prodCode: row.prodCode,
|
|
|
+ regcertno: row.regcertno,
|
|
|
delvCnt: "",
|
|
|
- delvCntYck:row.delvCntYck,
|
|
|
- docmkDate:row.docmkDate,
|
|
|
- docmker:row.docmker,
|
|
|
- essdrugType:row.essdrugType,
|
|
|
+ delvCntYck: row.delvCntYck,
|
|
|
+ docmkDate: row.docmkDate,
|
|
|
+ docmker: row.docmker,
|
|
|
+ essdrugType: row.essdrugType,
|
|
|
prodEntp: row.prodEntp,
|
|
|
materialId: row.materialId,
|
|
|
prodName: row.prodName,
|
|
|
- hiCode:row.hiCode,
|
|
|
+ hiCode: row.hiCode,
|
|
|
mol: row.mol,
|
|
|
matl: row.matl,
|
|
|
- memo:row.memo,
|
|
|
- mcsType:row.mcsType,
|
|
|
+ memo: row.memo,
|
|
|
+ mcsType: row.mcsType,
|
|
|
purcPric: row.purcPric,
|
|
|
purcAmt: row.purcAmt,
|
|
|
purcCnt: row.purcCnt,
|
|
|
- prodSouc:row.prodSouc,
|
|
|
+ prodSouc: row.prodSouc,
|
|
|
spec: row.spec,
|
|
|
toDelvCnt: row.toDelvCnt,
|
|
|
- convrat:row.convrat,
|
|
|
- prcUnt:row.prcUnt,
|
|
|
- purcUnt:row.purcUnt,
|
|
|
+ convrat: row.convrat,
|
|
|
+ prcUnt: row.prcUnt,
|
|
|
+ purcUnt: row.purcUnt,
|
|
|
invoFileId: "",
|
|
|
lotNum: "",
|
|
|
manuDate: "",
|
|
|
prodExpy: "",
|
|
|
dyntFileId: "",
|
|
|
- isFas:row.isFas,
|
|
|
+ isFas: row.isFas,
|
|
|
// udiList:[],
|
|
|
};
|
|
|
this.tableData.splice(index + 1, 0, list);
|
|
@@ -1164,8 +1027,8 @@ export default {
|
|
|
// const aa = this.tableData.findIndex((item) => item.id === row.id);
|
|
|
// this.number.splice(aa+1,0,this.number[aa])
|
|
|
},
|
|
|
- handleEDIT(row,index){
|
|
|
- this.tableData[index].udiList=[];
|
|
|
+ handleEDIT(row, index) {
|
|
|
+ this.tableData[index].udiList = [];
|
|
|
},
|
|
|
// 筛选合并项
|
|
|
computeCell(tableData) {
|
|
@@ -1204,7 +1067,7 @@ export default {
|
|
|
columnIndex === 8 ||
|
|
|
columnIndex === 12 ||
|
|
|
columnIndex === 13 ||
|
|
|
- columnIndex === 14
|
|
|
+ columnIndex === 14
|
|
|
) {
|
|
|
// console.log("单元格数组,若下一项为0,则代表合并上一项", this.cellList);
|
|
|
const rowCell = this.cellList[rowIndex];
|
|
@@ -1243,7 +1106,9 @@ export default {
|
|
|
},
|
|
|
//删除
|
|
|
handleDelete(row, i) {
|
|
|
- const index = this.tableData.findIndex((item) => item.prodCode === row.prodCode);
|
|
|
+ const index = this.tableData.findIndex(
|
|
|
+ (item) => item.prodCode === row.prodCode
|
|
|
+ );
|
|
|
if (index !== -1) {
|
|
|
let qwe = this.tableData.findIndex(function (item) {
|
|
|
return item.prodCode == row.prodCode;
|
|
@@ -1262,24 +1127,23 @@ export default {
|
|
|
// }
|
|
|
// this.number.splice(i,1);
|
|
|
},
|
|
|
- getUpload1(id,index) {
|
|
|
- this.tableData[index].invoFileId = id
|
|
|
+ getUpload1(id, index) {
|
|
|
+ this.tableData[index].invoFileId = id;
|
|
|
if (id) {
|
|
|
this.$refs.tabledata.clearValidate("invoFileId");
|
|
|
} else {
|
|
|
this.$refs.tabledata.validateField("invoFileId");
|
|
|
}
|
|
|
},
|
|
|
- getUpload(id,index) {
|
|
|
- this.tableData[index].dyntFileId = id
|
|
|
+ getUpload(id, index) {
|
|
|
+ this.tableData[index].dyntFileId = id;
|
|
|
if (id) {
|
|
|
this.$refs.tabledata.clearValidate("dyntFileId");
|
|
|
} else {
|
|
|
this.$refs.tabledata.validateField("dyntFileId");
|
|
|
}
|
|
|
},
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
// 获取发票信息
|
|
|
getFaData(type) {
|
|
|
if (type == "search") {
|
|
@@ -1344,68 +1208,72 @@ export default {
|
|
|
this.getTongData();
|
|
|
},
|
|
|
// 填写UDI码
|
|
|
- handleudi(row,index){
|
|
|
- if(row.lotNum && row.delvCnt){
|
|
|
+ handleudi(row, index) {
|
|
|
+ if (row.lotNum && row.delvCnt) {
|
|
|
this.rowIndex = index;
|
|
|
- if(!this.tableData[index].udiList || this.tableData[index].udiList.length==0 || this.tableData[index].udiList.length!==row.delvCnt || this.tableData[index].lotNum!==this.tableData[index].udiList[0].lotNum){
|
|
|
- let udiObj={
|
|
|
- ...row,
|
|
|
- udi:"",
|
|
|
- }
|
|
|
- const n = row.delvCnt;
|
|
|
- const copiedObjects = Array.from({ length: n }, () => ({ ...udiObj }));
|
|
|
- this.tableData[index].udiList = copiedObjects;
|
|
|
-
|
|
|
- }
|
|
|
- this.$nextTick(()=>{
|
|
|
- this.udidialog = true;
|
|
|
- this.udiData = this.tableData[index].udiList
|
|
|
- })
|
|
|
- }else{
|
|
|
- this.$message.warning("先填写必填信息,再填写UDI码")
|
|
|
+ if (
|
|
|
+ !this.tableData[index].udiList ||
|
|
|
+ this.tableData[index].udiList.length == 0 ||
|
|
|
+ this.tableData[index].udiList.length !== row.delvCnt ||
|
|
|
+ this.tableData[index].lotNum !==
|
|
|
+ this.tableData[index].udiList[0].lotNum
|
|
|
+ ) {
|
|
|
+ let udiObj = {
|
|
|
+ ...row,
|
|
|
+ udi: "",
|
|
|
+ };
|
|
|
+ const n = row.delvCnt;
|
|
|
+ const copiedObjects = Array.from({ length: n }, () => ({
|
|
|
+ ...udiObj,
|
|
|
+ }));
|
|
|
+ this.tableData[index].udiList = copiedObjects;
|
|
|
+ }
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.udidialog = true;
|
|
|
+ this.udiData = this.tableData[index].udiList;
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ this.$message.warning("先填写必填信息,再填写UDI码");
|
|
|
}
|
|
|
-
|
|
|
},
|
|
|
// 去chong
|
|
|
- handleClose(){
|
|
|
- this.udiData.forEach((v)=>{
|
|
|
- if(v.udi){
|
|
|
+ handleClose() {
|
|
|
+ this.udiData.forEach((v) => {
|
|
|
+ if (v.udi) {
|
|
|
let udicf = this.udif(this.udiData);
|
|
|
if (udicf == true) {
|
|
|
- this.$message({
|
|
|
- message: "同一产品的udi码不能重复",
|
|
|
- type: "error",
|
|
|
- });
|
|
|
- throw new Error("同一产品的udi码不能重复");
|
|
|
- }else{
|
|
|
- this.udidialog = false
|
|
|
- }
|
|
|
- }else{
|
|
|
- this.udidialog = false
|
|
|
+ this.$message({
|
|
|
+ message: "同一产品的udi码不能重复",
|
|
|
+ type: "error",
|
|
|
+ });
|
|
|
+ throw new Error("同一产品的udi码不能重复");
|
|
|
+ } else {
|
|
|
+ this.udidialog = false;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ this.udidialog = false;
|
|
|
}
|
|
|
- })
|
|
|
-
|
|
|
+ });
|
|
|
},
|
|
|
-
|
|
|
+
|
|
|
// 确定UDI
|
|
|
- clickUdi(){
|
|
|
+ clickUdi() {
|
|
|
this.$refs.udiForm.validate((valid) => {
|
|
|
if (valid) {
|
|
|
let udicf = this.udif(this.udiData);
|
|
|
if (udicf == true) {
|
|
|
- this.$message({
|
|
|
- message: "同一产品的udi码不能重复",
|
|
|
- type: "info",
|
|
|
- });
|
|
|
- throw new Error("同一产品的udi码不能重复");
|
|
|
- }
|
|
|
+ this.$message({
|
|
|
+ message: "同一产品的udi码不能重复",
|
|
|
+ type: "info",
|
|
|
+ });
|
|
|
+ throw new Error("同一产品的udi码不能重复");
|
|
|
+ }
|
|
|
this.$confirm("确认提交udi码", "提示", {
|
|
|
confirmButtonText: "确定",
|
|
|
cancelButtonText: "取消",
|
|
|
type: "warning",
|
|
|
}).then(() => {
|
|
|
-
|
|
|
- this.tableData[this.rowIndex].udiList = this.udiData
|
|
|
+ this.tableData[this.rowIndex].udiList = this.udiData;
|
|
|
this.udidialog = false;
|
|
|
});
|
|
|
} else {
|
|
@@ -1474,7 +1342,14 @@ export default {
|
|
|
},
|
|
|
// 出库
|
|
|
handleDelivery() {
|
|
|
- let lotnum = this.pf(this.tableData);
|
|
|
+ if (this.multipleSelection.length <= 0) {
|
|
|
+ this.$message({
|
|
|
+ message: "请选择出库耗材",
|
|
|
+ type: "error",
|
|
|
+ });
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ let lotnum = this.pf(this.multipleSelection);
|
|
|
if (lotnum == true) {
|
|
|
this.$message({
|
|
|
message: "同一产品的批号不能重复",
|
|
@@ -1482,8 +1357,8 @@ export default {
|
|
|
});
|
|
|
throw new Error("同一产品的批号不能重复");
|
|
|
}
|
|
|
- this.tableData.forEach((item) => {
|
|
|
- if (item.delvCnt=='0') {
|
|
|
+ this.multipleSelection.forEach((item) => {
|
|
|
+ if (item.delvCnt == "0") {
|
|
|
this.$message({
|
|
|
message: "本次出库数量必须大于0",
|
|
|
type: "warning",
|
|
@@ -1498,34 +1373,28 @@ export default {
|
|
|
// });
|
|
|
// throw new Error("请填写相应信息,并选择报关单");
|
|
|
// }
|
|
|
- if(this.cShow==true &&( !item.udiList|| item.udiList.length==0)){
|
|
|
- this.$message.warning("请填写udi再提交")
|
|
|
+ if (this.cShow == true && (!item.udiList || item.udiList.length == 0)) {
|
|
|
+ this.$message.warning("请填写udi再提交");
|
|
|
throw new Error("请填写udi再提交");
|
|
|
}
|
|
|
- item.udiList.forEach((v,index)=>{
|
|
|
- if(v.udi==""||v.udi==null){
|
|
|
- this.$message.warning("请填写udi再提交")
|
|
|
+ item.udiList.forEach((v, index) => {
|
|
|
+ if (v.udi == "" || v.udi == null) {
|
|
|
+ this.$message.warning("请填写udi再提交");
|
|
|
throw new Error("请填写udi再提交");
|
|
|
}
|
|
|
- })
|
|
|
+ });
|
|
|
});
|
|
|
-
|
|
|
+
|
|
|
this.$refs.tabledata.validate((valid) => {
|
|
|
if (valid) {
|
|
|
- this.$confirm("确认出库", "提示", {
|
|
|
- confirmButtonText: "确定",
|
|
|
- cancelButtonText: "取消",
|
|
|
- type: "warning",
|
|
|
- }).then(() => {
|
|
|
- this.mcsSum = 0;
|
|
|
- this.tableData.forEach((item) => {
|
|
|
- let rowSum = 0;
|
|
|
- rowSum = item.purcPric*item.convrat*item.delvCnt;
|
|
|
- this.mcsSum+=rowSum
|
|
|
- })
|
|
|
- this.mcsSum = (this.mcsSum).toFixed(4)
|
|
|
- this.printVisible = true;
|
|
|
+ this.mcsSum = 0;
|
|
|
+ this.multipleSelection.forEach((item) => {
|
|
|
+ let rowSum = 0;
|
|
|
+ rowSum = item.purcPric * item.convrat * item.delvCnt;
|
|
|
+ this.mcsSum += rowSum;
|
|
|
});
|
|
|
+ this.mcsSum = this.mcsSum.toFixed(4);
|
|
|
+ this.handleConfirm();
|
|
|
} else {
|
|
|
this.$message({
|
|
|
type: "warning",
|
|
@@ -1543,8 +1412,7 @@ export default {
|
|
|
}).then(() => {
|
|
|
let data2 = {
|
|
|
delvOrdId: "",
|
|
|
- purcOrdId: this.$route.query.id,
|
|
|
- detlList: this.tableData,
|
|
|
+ detlList: this.multipleSelection,
|
|
|
deptId: this.$route.query.deptId,
|
|
|
spdId: this.$route.query.spdId,
|
|
|
deptName: this.$route.query.deptName,
|
|
@@ -1552,15 +1420,17 @@ export default {
|
|
|
submitMcsDelvOrd(data2)
|
|
|
.then((res) => {
|
|
|
this.printVisible = false;
|
|
|
- this.$message.success("出库成功")
|
|
|
+ this.$message.success("出库成功");
|
|
|
this.$router.push({
|
|
|
- name: "purOrderDelivery",
|
|
|
- query:{spdId:this.$route.query.spdId,activeName:this.$route.query.activeName}
|
|
|
+ name: "devsuccs",
|
|
|
+ query: {
|
|
|
+ form: JSON.stringify(this.listForm),
|
|
|
+ data: JSON.stringify(this.multipleSelection),
|
|
|
+ },
|
|
|
});
|
|
|
})
|
|
|
.catch((err) => {
|
|
|
// this.$message.error("出库失败")
|
|
|
-
|
|
|
// this.confirmLoadLoad = false;
|
|
|
});
|
|
|
});
|
|
@@ -1593,15 +1463,14 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
// 订单复用
|
|
|
- handlemultiplex(){
|
|
|
+ handlemultiplex() {
|
|
|
this.mulDialog = true;
|
|
|
- this.getOutboundData()
|
|
|
+ this.getOutboundData();
|
|
|
this.roleRadio = "";
|
|
|
this.purcOrdId = "";
|
|
|
-
|
|
|
},
|
|
|
// 结束订单
|
|
|
- handleEnd(){
|
|
|
+ handleEnd() {
|
|
|
this.$confirm("确认结束订单", "提示", {
|
|
|
confirmButtonText: "确定",
|
|
|
cancelButtonText: "取消",
|
|
@@ -1616,15 +1485,18 @@ export default {
|
|
|
this.overLoading = false;
|
|
|
this.$message.success("结束订单成功");
|
|
|
this.$router.push({
|
|
|
- name: "purOrderDelivery",
|
|
|
- query:{spdId:this.$route.query.spdId,activeName:this.$route.query.activeName}
|
|
|
+ name: "purOrderDelivery",
|
|
|
+ query: {
|
|
|
+ spdId: this.$route.query.spdId,
|
|
|
+ activeName: this.$route.query.activeName,
|
|
|
+ },
|
|
|
});
|
|
|
})
|
|
|
.catch((err) => {
|
|
|
this.overLoading = false;
|
|
|
- this.$message.error("结束订单失败")
|
|
|
+ this.$message.error("结束订单失败");
|
|
|
});
|
|
|
- })
|
|
|
+ });
|
|
|
},
|
|
|
// 复用查询
|
|
|
getOutboundData() {
|
|
@@ -1633,57 +1505,63 @@ export default {
|
|
|
this.mulData = res.data.records;
|
|
|
this.totalm = res.data.total;
|
|
|
})
|
|
|
- .catch((err) => {
|
|
|
- });
|
|
|
+ .catch((err) => {});
|
|
|
},
|
|
|
// 返回
|
|
|
- handleBack(){
|
|
|
+ handleBack() {
|
|
|
this.$router.push({
|
|
|
name: "purOrderDelivery",
|
|
|
- query:{spdId:this.$route.query.spdId,activeName:this.$route.query.activeName}
|
|
|
+ query: {
|
|
|
+ spdId: this.$route.query.spdId,
|
|
|
+ activeName: this.$route.query.activeName,
|
|
|
+ },
|
|
|
});
|
|
|
},
|
|
|
// 重置
|
|
|
- reset(){
|
|
|
+ reset() {
|
|
|
this.$refs.listQuery.resetFields();
|
|
|
- this.getData()
|
|
|
+ this.getData();
|
|
|
},
|
|
|
// 复用单选
|
|
|
getTemplateRow(index, row) {
|
|
|
this.purcOrdId = row.id;
|
|
|
},
|
|
|
// 复用确认
|
|
|
- clickMul(){
|
|
|
- if(!this.purcOrdId){
|
|
|
- this.$message.warning("请选择要复用的订单")
|
|
|
- }else{
|
|
|
+ clickMul() {
|
|
|
+ if (!this.purcOrdId) {
|
|
|
+ this.$message.warning("请选择要复用的订单");
|
|
|
+ } else {
|
|
|
this.$confirm("确认复用该订单", "提示", {
|
|
|
- confirmButtonText: "确定",
|
|
|
- cancelButtonText: "取消",
|
|
|
- type: "warning",
|
|
|
- }).then(() => {
|
|
|
- selectDelvOrdCopy({delvOrdId:this.listForm.id,purcOrdId:this.purcOrdId}).then((res)=>{
|
|
|
- this.fyLoad = true;
|
|
|
- if(res.success==true){
|
|
|
- this.$message.success("操作成功")
|
|
|
- this.mulDialog = false;
|
|
|
- this.fyLoad = false;
|
|
|
- this.purcOrdId = "";
|
|
|
- }else{
|
|
|
- // this.$message.error("操作失败")
|
|
|
- this.$message(res.message)
|
|
|
- this.fyLoad = false;
|
|
|
- this.purcOrdId="";
|
|
|
- }
|
|
|
- }).catch((err)=>{
|
|
|
- // this.$message(res.message)
|
|
|
- this.fyLoad = false;
|
|
|
- this.purcOrdId="";
|
|
|
- })
|
|
|
- })
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning",
|
|
|
+ }).then(() => {
|
|
|
+ selectDelvOrdCopy({
|
|
|
+ delvOrdId: this.listForm.id,
|
|
|
+ purcOrdId: this.purcOrdId,
|
|
|
+ })
|
|
|
+ .then((res) => {
|
|
|
+ this.fyLoad = true;
|
|
|
+ if (res.success == true) {
|
|
|
+ this.$message.success("操作成功");
|
|
|
+ this.mulDialog = false;
|
|
|
+ this.fyLoad = false;
|
|
|
+ this.purcOrdId = "";
|
|
|
+ } else {
|
|
|
+ // this.$message.error("操作失败")
|
|
|
+ this.$message(res.message);
|
|
|
+ this.fyLoad = false;
|
|
|
+ this.purcOrdId = "";
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .catch((err) => {
|
|
|
+ // this.$message(res.message)
|
|
|
+ this.fyLoad = false;
|
|
|
+ this.purcOrdId = "";
|
|
|
+ });
|
|
|
+ });
|
|
|
}
|
|
|
},
|
|
|
-
|
|
|
},
|
|
|
};
|
|
|
</script>
|