|
@@ -1,13 +1,18 @@
|
|
|
<template>
|
|
|
<div>
|
|
|
<!-- 页面主体内容 -->
|
|
|
- <div class="planAddContent" v-show="contentShow">
|
|
|
+ <div class="planAddContent" v-show="contentShow && !printShow">
|
|
|
<Card style="width:100%" :bordered="false" :dis-hover="true">
|
|
|
<p slot="title">采购订单详情</p>
|
|
|
<div slot="extra">
|
|
|
<Button v-if="form.spzt != '1'" @click="toSpjl">查看审批记录</Button>
|
|
|
<Button @click="submitCgdd" v-if="orderType == 'edit' && form.spzt == '1'">提交</Button>
|
|
|
<Button @click="addCgdd" v-if="form.spzt == '1'">保存</Button>
|
|
|
+ <Button
|
|
|
+ href="javascript:;"
|
|
|
+ v-if="form.ddzt != '6' && form.spzt != '4'"
|
|
|
+ @click="printRow()"
|
|
|
+ >打印</Button>
|
|
|
<Button @click="cancel">返回</Button>
|
|
|
</div>
|
|
|
<Row class="mainCont">
|
|
@@ -59,7 +64,7 @@
|
|
|
</Select>
|
|
|
<span v-else>{{ form.glxm.split(',')[1] }}</span>
|
|
|
</Col>
|
|
|
- <Col span="4" class-name="tables">
|
|
|
+ <!-- <Col span="4" class-name="tables">
|
|
|
单据类型
|
|
|
<span class="mustSpan">*</span>
|
|
|
</Col>
|
|
@@ -71,7 +76,7 @@
|
|
|
:key="item.value"
|
|
|
>{{ item.label }}</Option>
|
|
|
</Select>
|
|
|
- </Col>
|
|
|
+ </Col>-->
|
|
|
|
|
|
<Col span="4" class-name="tables">采购人</Col>
|
|
|
<Col span="4" class-name="tables">{{ form.cgr }}</Col>
|
|
@@ -199,6 +204,8 @@
|
|
|
<span v-if="form.ddzt == '5'">已入库</span>
|
|
|
<span v-if="form.ddzt == '6'">已取消</span>
|
|
|
</Col>
|
|
|
+ <Col span="4" class-name="tables"></Col>
|
|
|
+ <Col span="4" class-name="tables"></Col>
|
|
|
</Row>
|
|
|
<Row class="uplCont" type="flex" justify="center" style="align-items: stretch">
|
|
|
<Col span="4" class-name="upl">附件</Col>
|
|
@@ -365,6 +372,7 @@
|
|
|
</div>
|
|
|
<!-- 计划明细新增 -->
|
|
|
<orderMxAdd ref="mxAdd" @plAdd="plAdd" @return="contentShow = true" v-show="!contentShow" />
|
|
|
+ <orderPrint ref="print" @return="() => {printShow = false;}" v-show="printShow" />
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -383,10 +391,13 @@ import {
|
|
|
editPurchaseOrderDetailState
|
|
|
} from "@/service/getData";
|
|
|
import orderMxAdd from "./orderMxAdd";
|
|
|
+import orderPrint from "./orderPrint";
|
|
|
export default {
|
|
|
+ name: "orderAdd",
|
|
|
props: ["glqyList"],
|
|
|
components: {
|
|
|
- orderMxAdd
|
|
|
+ orderMxAdd,
|
|
|
+ orderPrint
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
@@ -399,6 +410,7 @@ export default {
|
|
|
},
|
|
|
spinShow: false,
|
|
|
contentShow: true,
|
|
|
+ printShow: false,
|
|
|
form: {
|
|
|
dgbh: "", //订购编号
|
|
|
bt: "", //标题
|
|
@@ -596,9 +608,16 @@ export default {
|
|
|
},
|
|
|
methods: {
|
|
|
goDetail(id) {
|
|
|
- window.open(
|
|
|
- `https://test.hajwy.com/purchase-web/#/viewPurchaseApply?id=${id}`
|
|
|
- );
|
|
|
+ let routeUrl = this.$router.resolve({
|
|
|
+ path: "/viewPurchaseApply",
|
|
|
+ query: {
|
|
|
+ id: id
|
|
|
+ }
|
|
|
+ });
|
|
|
+ window.open(routeUrl.href, "_blank");
|
|
|
+ // window.open(
|
|
|
+ // `https://test.hajwy.com/purchase-web/#/viewPurchaseApply?id=${id}`
|
|
|
+ // );
|
|
|
// this.$router.push(`/viewPurchaseApply?code=${code}`)
|
|
|
},
|
|
|
//批量设置弹窗
|
|
@@ -667,7 +686,7 @@ export default {
|
|
|
this.form.bt = data.title;
|
|
|
this.form.glqy = data.areaId + "," + data.areaName;
|
|
|
this.form.glxm = data.projectId + "," + data.projectName;
|
|
|
- this.form.djlx = data.type;
|
|
|
+ // this.form.djlx = data.type;
|
|
|
this.form.cgr = data.purchaserName;
|
|
|
this.form.cgrlxfs = data.purchaserTel;
|
|
|
this.form.xdrq = data.orderTime;
|
|
@@ -887,57 +906,63 @@ export default {
|
|
|
this.tableData[i].price * this.tableData[i].purchaseNum
|
|
|
);
|
|
|
}
|
|
|
- let postData = {
|
|
|
- areaId: this.form.glqy.split(",")[0],
|
|
|
- areaName: this.form.glqy.split(",")[1],
|
|
|
- projectId: this.form.glxm.split(",")[0],
|
|
|
- projectName: this.form.glxm.split(",")[1],
|
|
|
- purchaserId: localStorage.user_id,
|
|
|
- purchaserName: localStorage.user_name,
|
|
|
- purchaserTel: this.form.cgrlxfs,
|
|
|
- receivedName: this.form.shr,
|
|
|
- receivedTel: this.form.shrlxfs,
|
|
|
- orderTime: this.form.xdrq,
|
|
|
- invoiceTitleCode: this.form.fptt,
|
|
|
- // deliveryStartTime: this.form.jhsj[0],
|
|
|
- // deliveryEndTime: this.form.jhsj[1],
|
|
|
- deliveryTime: this.form.jhsj,
|
|
|
- deliveryPlace: this.form.jhdd,
|
|
|
- type: this.form.djlx,
|
|
|
- instruction: this.form.sm,
|
|
|
- attachmentList: this.form.filesList,
|
|
|
- gpId: this.form.gys, //供应商ID
|
|
|
- gpNmae: gpName.length ? gpName[0].gpName : "", //供应商Name
|
|
|
- orderId: this.orderId,
|
|
|
- // deleteId: this.deleteIds.join(","),
|
|
|
- attachmentList: this.form.filesList,
|
|
|
- detailList: this.tableData
|
|
|
- };
|
|
|
- this.spinShow = true;
|
|
|
- this.tableLoading = true;
|
|
|
- editPurchaseOrder(postData).then(res => {
|
|
|
- this.spinShow = false;
|
|
|
- this.tableLoading = false;
|
|
|
- if (res.status == 200) {
|
|
|
- this.$Message.success("编辑采购订单成功!");
|
|
|
- this.getCgddXq(this.orderId);
|
|
|
- } else {
|
|
|
- this.$Message.error(res.message);
|
|
|
- }
|
|
|
+ return new Promise((resolve, reject) => {
|
|
|
+ let postData = {
|
|
|
+ areaId: this.form.glqy.split(",")[0],
|
|
|
+ areaName: this.form.glqy.split(",")[1],
|
|
|
+ projectId: this.form.glxm.split(",")[0],
|
|
|
+ projectName: this.form.glxm.split(",")[1],
|
|
|
+ purchaserId: localStorage.user_id,
|
|
|
+ purchaserName: localStorage.user_name,
|
|
|
+ purchaserTel: this.form.cgrlxfs,
|
|
|
+ receivedName: this.form.shr,
|
|
|
+ receivedTel: this.form.shrlxfs,
|
|
|
+ orderTime: this.form.xdrq,
|
|
|
+ invoiceTitleCode: this.form.fptt,
|
|
|
+ // deliveryStartTime: this.form.jhsj[0],
|
|
|
+ // deliveryEndTime: this.form.jhsj[1],
|
|
|
+ deliveryTime: this.form.jhsj,
|
|
|
+ deliveryPlace: this.form.jhdd,
|
|
|
+ // type: this.form.djlx,
|
|
|
+ instruction: this.form.sm,
|
|
|
+ attachmentList: this.form.filesList,
|
|
|
+ gpId: this.form.gys, //供应商ID
|
|
|
+ gpNmae: gpName.length ? gpName[0].gpName : "", //供应商Name
|
|
|
+ orderId: this.orderId,
|
|
|
+ // deleteId: this.deleteIds.join(","),
|
|
|
+ attachmentList: this.form.filesList,
|
|
|
+ detailList: this.tableData
|
|
|
+ };
|
|
|
+ this.spinShow = true;
|
|
|
+ this.tableLoading = true;
|
|
|
+ editPurchaseOrder(postData).then(res => {
|
|
|
+ this.spinShow = false;
|
|
|
+ this.tableLoading = false;
|
|
|
+ if (res.status == 200) {
|
|
|
+ this.$Message.success("编辑采购订单成功!");
|
|
|
+ this.getCgddXq(this.orderId);
|
|
|
+ resolve();
|
|
|
+ } else {
|
|
|
+ this.$Message.error(res.message);
|
|
|
+ reject();
|
|
|
+ }
|
|
|
+ });
|
|
|
});
|
|
|
},
|
|
|
submitCgdd() {
|
|
|
- let gpName = this.gysList.filter(a => a.gpId == this.form.gys);
|
|
|
- let postData = {
|
|
|
- orderId: this.orderId
|
|
|
- };
|
|
|
- submitPurchaseOrder(postData).then(res => {
|
|
|
- if (res.status == 200) {
|
|
|
- this.$Message.success("提交采购订单成功!");
|
|
|
- this.form.spzt = "2";
|
|
|
- } else {
|
|
|
- this.$Message.error(res.message);
|
|
|
- }
|
|
|
+ this.editCgdd().then(() => {
|
|
|
+ let gpName = this.gysList.filter(a => a.gpId == this.form.gys);
|
|
|
+ let postData = {
|
|
|
+ orderId: this.orderId
|
|
|
+ };
|
|
|
+ submitPurchaseOrder(postData).then(res => {
|
|
|
+ if (res.status == 200) {
|
|
|
+ this.$Message.success("提交采购订单成功!");
|
|
|
+ this.form.spzt = "2";
|
|
|
+ } else {
|
|
|
+ this.$Message.error(res.message);
|
|
|
+ }
|
|
|
+ });
|
|
|
});
|
|
|
},
|
|
|
//新增采购订单
|
|
@@ -945,7 +970,6 @@ export default {
|
|
|
let mustArr = [
|
|
|
"glqy",
|
|
|
"glxm",
|
|
|
- "djlx",
|
|
|
"xdrq",
|
|
|
"jhsj",
|
|
|
"cgrlxfs",
|
|
@@ -1003,7 +1027,7 @@ export default {
|
|
|
// deliveryEndTime: this.form.jhsj[1],
|
|
|
deliveryTime: this.form.jhsj,
|
|
|
deliveryPlace: this.form.jhdd,
|
|
|
- type: this.form.djlx,
|
|
|
+ // type: this.form.djlx,
|
|
|
instruction: this.form.sm,
|
|
|
attachmentList: this.form.filesList,
|
|
|
gpId: this.form.gys, //供应商ID
|
|
@@ -1091,6 +1115,10 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
+ printRow() {
|
|
|
+ this.printShow = true;
|
|
|
+ this.$refs.print.getData(this.orderId);
|
|
|
+ },
|
|
|
tableOnSelect(selection, row) {},
|
|
|
//取消、返回
|
|
|
cancel() {
|