|
@@ -606,6 +606,15 @@
|
|
|
<el-button type="primary" @click="btnComfirm">确 定</el-button>
|
|
|
</span>
|
|
|
</el-dialog>
|
|
|
+ <!-- 详情弹窗 -->
|
|
|
+ <el-dialog title="详情" :visible.sync="detailShow" width="1000px">
|
|
|
+ <div ref="detailTable" id="detail"></div>
|
|
|
+ <span slot="footer" class="dialog-footer">
|
|
|
+ <el-button @click="detailShow = false">取 消</el-button>
|
|
|
+ <el-button type="primary" @click="detailPrintHandler">确 定</el-button>
|
|
|
+ </span>
|
|
|
+ </el-dialog>
|
|
|
+ <div id="printDom"></div>
|
|
|
</div>
|
|
|
</template>
|
|
|
<script>
|
|
@@ -639,6 +648,9 @@ export default {
|
|
|
components: { Queryfrom, Menu, DialogTemplate },
|
|
|
data() {
|
|
|
return {
|
|
|
+ // 详情弹窗数据
|
|
|
+ detailShow: false,
|
|
|
+ printDomData: "",
|
|
|
// k-form-build组件渲染弹窗
|
|
|
kOpen: false,
|
|
|
// 新的自定义数据 start
|
|
@@ -806,6 +818,9 @@ export default {
|
|
|
this.tableKey = this.$route.query.tableKey;
|
|
|
},
|
|
|
watch: {},
|
|
|
+ async mounted() {
|
|
|
+ await this.getDropDownData();
|
|
|
+ },
|
|
|
computed: {
|
|
|
isShowExcuteCol() {
|
|
|
return !this.excuteBtnArr?.every((arr) => arr.children.length == 0);
|
|
@@ -2164,9 +2179,230 @@ export default {
|
|
|
window.open("http://" + url, "_blank");
|
|
|
}
|
|
|
},
|
|
|
- handleDetail(row) {
|
|
|
+ async handleDetail(row) {
|
|
|
+ this.printDomData = await this.getDetailTableString(row);
|
|
|
+ this.detailShow = true;
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$refs.detailTable.innerHTML = this.printDomData;
|
|
|
+ });
|
|
|
console.log(row);
|
|
|
},
|
|
|
+ // 打印回调
|
|
|
+ detailPrintHandler() {
|
|
|
+ document.body.innerHTML = document.getElementById("printDom").innerHTML =
|
|
|
+ this.printDomData;
|
|
|
+ window.print(); //打印
|
|
|
+ window.location.reload();
|
|
|
+ return false;
|
|
|
+ },
|
|
|
+ // 获取详情html字符串
|
|
|
+ async getDetailTableString(row) {
|
|
|
+ let { saleOrderSaleNo } = row;
|
|
|
+ let payLoad = [
|
|
|
+ {
|
|
|
+ basicMap: {
|
|
|
+ tableName: "sale_order",
|
|
|
+ },
|
|
|
+ conditionMap: {
|
|
|
+ sale_no: [saleOrderSaleNo],
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ basicMap: {
|
|
|
+ tableName: "sale_products",
|
|
|
+ },
|
|
|
+ conditionMap: {
|
|
|
+ sale_order_no: [saleOrderSaleNo],
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ basicMap: {
|
|
|
+ tableName: "sale_craft",
|
|
|
+ },
|
|
|
+ conditionMap: {
|
|
|
+ sale_order_no: [saleOrderSaleNo],
|
|
|
+ },
|
|
|
+ },
|
|
|
+ ];
|
|
|
+ let res = await queryDropDownBoxData(payLoad);
|
|
|
+ if (res.code == 200) {
|
|
|
+ console.log(res);
|
|
|
+ let { sale_craft, sale_order, sale_products } = res.data.resultMap;
|
|
|
+ let {
|
|
|
+ //订单表数据
|
|
|
+ saleNo, //合同号
|
|
|
+ saleCustomNo, //客户编号
|
|
|
+ saleDate, //销售单日期
|
|
|
+ saleOrderEstimatedTime, //预计下单时间
|
|
|
+ saleLeadTime, //交货周期
|
|
|
+ saleAmounts, //合计金额 小写
|
|
|
+ saleAmountInWords, //合计金额 大写
|
|
|
+ salePayType, //支付方式
|
|
|
+ salesman, //业务员
|
|
|
+ saleLeader, //业务主管
|
|
|
+ finance, //财务部
|
|
|
+ production, //生产部
|
|
|
+ saleApprover, //批准人
|
|
|
+ // customAddress, //客户地址
|
|
|
+ // customCountryType, //国家类型
|
|
|
+ // contactPerson, //联系人
|
|
|
+ // 货品明细表数据
|
|
|
+ // productNo, //货品号
|
|
|
+ // productName, //货品名称
|
|
|
+ // productNumber: "", //销售数量
|
|
|
+ // productWeight: "", //销售重量kg
|
|
|
+ // productUnitPrice: "", //单价
|
|
|
+ // productAmounts: "", //金额
|
|
|
+ // remark: "", //备注
|
|
|
+ // 工艺表
|
|
|
+ craftGrid, //网格
|
|
|
+ craftOil, //油剂
|
|
|
+ craftPackage, //卷装
|
|
|
+ craftColorFastness, //色牢度
|
|
|
+ craftOther, //其它工艺要求
|
|
|
+ craftMark, //包装/贴唛
|
|
|
+ shippingMethod, //运输方式
|
|
|
+ } = { ...sale_craft[0], ...sale_order[0] };
|
|
|
+ let customData = this.customerOptions.find(
|
|
|
+ (item) => item.customNo == saleCustomNo
|
|
|
+ );
|
|
|
+ let customerName = customData ? customData.customName : "";
|
|
|
+ let customAddress = customData?.customAddress || "无";
|
|
|
+ let customCountryType = customData?.customCountryType || "";
|
|
|
+ let contactPerson = customData?.contactPerson || "无";
|
|
|
+ let printStr = `
|
|
|
+ <table style="width:900px; border-collapse:collapse;" border="1" cellpadding="10" align="center">
|
|
|
+ <div style="text-align:center;font-size: 20px;">诸暨市新丝维纤维有限公司</div>
|
|
|
+ <div style="text-align:center;">销售合同审计单</div>
|
|
|
+ <tbody>
|
|
|
+ <tr>
|
|
|
+ <td width="600px" colspan="4">合同号:${saleNo}</td>
|
|
|
+ <td width="300px" colspan="2">日期:${saleDate}</td>
|
|
|
+ </tr>
|
|
|
+ <tr align="center">
|
|
|
+ <td width="300px" colspan="2">客户名称:</td>
|
|
|
+ <td width="300px" colspan="2">${customerName}</td>
|
|
|
+ <td width="150px">联系人:</td>
|
|
|
+ <td width="150px">${contactPerson}</td>
|
|
|
+ </tr>
|
|
|
+ <tr align="center">
|
|
|
+ <td colspan="2">客户地址:</td>
|
|
|
+ <td colspan="2">${customAddress}</td>
|
|
|
+ <td>客户国别:</td>
|
|
|
+ <td>${customCountryType}</td>
|
|
|
+ </tr>
|
|
|
+ <tr align="center">
|
|
|
+ <td colspan="2">预计下单时间:</td>
|
|
|
+ <td colspan="2">${saleOrderEstimatedTime}</td>
|
|
|
+ <td>交货周期:</td>
|
|
|
+ <td>${saleLeadTime}</td>
|
|
|
+ </tr>
|
|
|
+ <tr align="center">
|
|
|
+ <td colspan="6">货品明细</td>
|
|
|
+ </tr>
|
|
|
+ <tr align="center">
|
|
|
+ <td width="300px" colspan="2">品名</td>
|
|
|
+ <td width="150px">数量/kg</td>
|
|
|
+ <td width="150px">单价</td>
|
|
|
+ <td width="150px">金额</td>
|
|
|
+ <td width="150px">备注</td>
|
|
|
+ </tr>`;
|
|
|
+ let amountTotal = 0,
|
|
|
+ singlTotal = 0,
|
|
|
+ moneyTotal = 0;
|
|
|
+ for (let i = 0; i < sale_products.length; i++) {
|
|
|
+ let item = sale_products[i];
|
|
|
+ amountTotal += Number(item.productNumber);
|
|
|
+ singlTotal += Number(item.productUnitPrice);
|
|
|
+ moneyTotal += Number(item.productAmounts);
|
|
|
+ let productData = this.productionOptions.find(
|
|
|
+ (pro) => pro.productNo == item.productNo
|
|
|
+ );
|
|
|
+ let productName = productData ? productData.productName : "";
|
|
|
+ printStr += `<tr align="center">
|
|
|
+ <td colspan="2">${productName}</td>
|
|
|
+ <td>${item.productNumber}</td>
|
|
|
+ <td>${item.productUnitPrice}</td>
|
|
|
+ <td>${item.productAmounts}</td>
|
|
|
+ <td>${item.remark}</td>
|
|
|
+ </tr>`;
|
|
|
+ }
|
|
|
+ // 计算小计
|
|
|
+ printStr += `
|
|
|
+ <tr>
|
|
|
+ <td colspan="2">小计:</td>
|
|
|
+ <td>${amountTotal}</td>
|
|
|
+ <td>${singlTotal}</td>
|
|
|
+ <td>${moneyTotal}</td>
|
|
|
+ <td></td>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <td colspan="6">合计金额(大写):${saleAmountInWords}</td>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <td colspan="6">付款方式:${salePayType}</td>
|
|
|
+ </tr>
|
|
|
+ <tr align="center">
|
|
|
+ <td colspan="6">工艺要求</td>
|
|
|
+ </tr>
|
|
|
+ <tr align="center">
|
|
|
+ <td width="300px" colspan="2">网格</td>
|
|
|
+ <td width="150px">油剂</td>
|
|
|
+ <td width="150px">卷装</td>
|
|
|
+ <td width="150px">色牢度</td>
|
|
|
+ <td width="150px">其他</td>
|
|
|
+ </tr>
|
|
|
+ <tr align="center">
|
|
|
+ <td colspan="2">${craftGrid}</td>
|
|
|
+ <td>${craftOil}</td>
|
|
|
+ <td>${craftPackage}</td>
|
|
|
+ <td>${craftColorFastness}</td>
|
|
|
+ <td>${craftOther}</td>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <td colspan="6">包装/贴唛:${craftMark}</td>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <td colspan="6">装运方式:${shippingMethod}</td>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <td colspan="2">业务员:</td>
|
|
|
+ <td colspan="2">${salesman}</td>
|
|
|
+ <td>业务主管:</td>
|
|
|
+ <td>${saleLeader}</td>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <td colspan="2">财务部:</td>
|
|
|
+ <td colspan="2">${finance}</td>
|
|
|
+ <td>生产部:</td>
|
|
|
+ <td>${production}</td>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <td colspan="2">批准人:</td>
|
|
|
+ <td colspan="2">${saleApprover}</td>
|
|
|
+ <td></td>
|
|
|
+ <td></td>
|
|
|
+ </tr>
|
|
|
+ </tbody>
|
|
|
+ </table>
|
|
|
+ `;
|
|
|
+ return printStr;
|
|
|
+ // <tr align="center">
|
|
|
+ // <td colspan="2"> 2</td>
|
|
|
+ // <td> </td>
|
|
|
+ // <td> </td>
|
|
|
+ // <td> </td>
|
|
|
+ // <td> </td>
|
|
|
+ // </tr>
|
|
|
+ // <tr>
|
|
|
+ // <td colspan="2">小计:</td>
|
|
|
+ // <td></td>
|
|
|
+ // <td></td>
|
|
|
+ // <td></td>
|
|
|
+ // <td></td>
|
|
|
+ // </tr>
|
|
|
+ }
|
|
|
+ },
|
|
|
|
|
|
// 操作列回调
|
|
|
excuteHandler(btnData, row) {
|