|
@@ -188,7 +188,9 @@
|
|
|
处理<i class="el-icon-arrow-down el-icon--right"></i>
|
|
|
</el-button>
|
|
|
<el-dropdown-menu slot="dropdown">
|
|
|
- <el-dropdown-item>
|
|
|
+ <el-dropdown-item
|
|
|
+ v-show="queryParams.conditionMap.columnValue == '2'"
|
|
|
+ >
|
|
|
<el-button
|
|
|
type="text"
|
|
|
size="mini"
|
|
@@ -196,6 +198,14 @@
|
|
|
>审批</el-button
|
|
|
>
|
|
|
</el-dropdown-item>
|
|
|
+ <el-dropdown-item>
|
|
|
+ <el-button
|
|
|
+ type="text"
|
|
|
+ size="mini"
|
|
|
+ @click="handleDetail(scope.$index, scope.row)"
|
|
|
+ >详情</el-button
|
|
|
+ >
|
|
|
+ </el-dropdown-item>
|
|
|
</el-dropdown-menu>
|
|
|
</el-dropdown>
|
|
|
<Menu
|
|
@@ -215,6 +225,16 @@
|
|
|
:limit.sync="queryParams.pageSize"
|
|
|
@pagination="pageList"
|
|
|
/>
|
|
|
+ <!-- 详情弹窗 -->
|
|
|
+ <el-dialog title="详情" :visible.sync="detailShow" width="1250px">
|
|
|
+ <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>
|
|
|
<!-- 添加或修改销售出库单:- 过磅记录生成数据对话框 -->
|
|
|
<el-dialog :title="title" :visible.sync="open" append-to-body>
|
|
|
<!-- <iframe
|
|
@@ -805,6 +825,9 @@ export default {
|
|
|
dicts: ["sales_order_type", "payment_method", "direction_of_twist"],
|
|
|
data() {
|
|
|
return {
|
|
|
+ // 详情相关数据
|
|
|
+ detailShow: false,
|
|
|
+ printDomData: "",
|
|
|
// 审批相关数据
|
|
|
approveType: "", //审批状态
|
|
|
approveNo: "",
|
|
@@ -1014,6 +1037,268 @@ export default {
|
|
|
},
|
|
|
},
|
|
|
methods: {
|
|
|
+ // 根据字典value获取字典label
|
|
|
+ getDictLabel(value, dict) {
|
|
|
+ return (
|
|
|
+ this.dict.type[dict].find((item) => {
|
|
|
+ return item.value === value;
|
|
|
+ })?.label || ""
|
|
|
+ );
|
|
|
+ },
|
|
|
+ // 获取详情数据
|
|
|
+ async handleDetail(index, row) {
|
|
|
+ this.printDomData = await this.getDetailTableString(row);
|
|
|
+ this.detailShow = true;
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$refs.detailTable.innerHTML = this.printDomData;
|
|
|
+ });
|
|
|
+ },
|
|
|
+ // 获取详情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, //合同号
|
|
|
+ lotNumber, //批号
|
|
|
+ saleCustomNo, //客户编号
|
|
|
+ saleDate, //销售单日期
|
|
|
+ saleOrderEstimatedTime, //预计下单时间
|
|
|
+ saleLeadTime, //交货周期
|
|
|
+ deliveryDate,
|
|
|
+ saleAmounts, //合计金额 小写
|
|
|
+ saleAmountInWords, //合计金额 大写
|
|
|
+ salePayType, //支付方式
|
|
|
+ earnestMoney,
|
|
|
+ salesman, //业务员
|
|
|
+ saleLeader, //业务主管
|
|
|
+ finance, //财务部
|
|
|
+ production, //生产部
|
|
|
+ saleApprover, //批准人
|
|
|
+ // customAddress, //客户地址
|
|
|
+ // customCountryType, //国家类型
|
|
|
+ // contactPerson, //联系人
|
|
|
+ // 货品明细表数据
|
|
|
+ // productNo, //货品号
|
|
|
+ // productName, //货品名称
|
|
|
+ // productNumber: "", //销售数量
|
|
|
+ // productWeight: "", //销售重量kg
|
|
|
+ // productUnitPrice: "", //单价
|
|
|
+ // productAmounts: "", //金额
|
|
|
+ // remark: "", //备注
|
|
|
+ // 工艺表
|
|
|
+ craftGrid, //网络
|
|
|
+ craftOil, //油剂
|
|
|
+ craftPackage, //卷装
|
|
|
+ craftColorFastness, //色牢度
|
|
|
+ directionOfTwist,
|
|
|
+ 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 directionOfTwistDescription = directionOfTwist
|
|
|
+ ? this.getDictLabel(directionOfTwist, "direction_of_twist")
|
|
|
+ : "";
|
|
|
+ let printStr = `
|
|
|
+ <table style="width:1200px; 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="600px" colspan="4">日期:${saleDate.replace(
|
|
|
+ "T",
|
|
|
+ " "
|
|
|
+ )}</td>
|
|
|
+ </tr>
|
|
|
+ <tr align="center">
|
|
|
+ <td width="300px" colspan="2">客户名称:</td>
|
|
|
+ <td width="300px" colspan="2">${customerName}</td>
|
|
|
+ <td width="300px" colspan="2">联系人:</td>
|
|
|
+ <td width="150px" colspan="1">${contactPerson}</td>
|
|
|
+ </tr>
|
|
|
+ <tr align="center">
|
|
|
+ <td width="300px" colspan="2">客户地址:</td>
|
|
|
+ <td width="300px" colspan="2">${customAddress}</td>
|
|
|
+ <td width="300px" colspan="2">客户国别:</td>
|
|
|
+ <td width="300px" colspan="2">${customCountryType}</td>
|
|
|
+ </tr>
|
|
|
+ <tr align="center">
|
|
|
+ <td width="300px" colspan="2">预计下单时间:</td>
|
|
|
+ <td colspan="1">${saleOrderEstimatedTime.replace(
|
|
|
+ "T",
|
|
|
+ " "
|
|
|
+ )}</td>
|
|
|
+ <td colspan="1">交货周期:</td>
|
|
|
+ <td >${saleLeadTime}</td>
|
|
|
+ <td colspan="2">交货日期:</td>
|
|
|
+ <td >${deliveryDate.replace("T", " ")}</td>
|
|
|
+ </tr>
|
|
|
+ <tr align="center">
|
|
|
+ <td colspan="8">货品明细</td>
|
|
|
+ </tr>
|
|
|
+ <tr align="center">
|
|
|
+ <td width="150px">品名</td>
|
|
|
+ <td width="150px">类型</td>
|
|
|
+ <td width="150px">数量/kg</td>
|
|
|
+ <td width="150px">单价</td>
|
|
|
+ <td width="150px">金额</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
|
|
|
+ );
|
|
|
+ console.log("item", item);
|
|
|
+ item.sliceTypeLabel =
|
|
|
+ this.sliceTypeOptions.find((k) => k.materielCode == item.sliceType)
|
|
|
+ ?.materielName || "";
|
|
|
+ item.colourNumberLabel = this.colourNumberOptions.find(
|
|
|
+ (k) => k.materielCode == item.colourNumber
|
|
|
+ )?.materieColorNumber;
|
|
|
+ let productName = productData ? productData.productName : "";
|
|
|
+ let productType = productData ? productData.productType : "";
|
|
|
+ printStr += `<tr align="center">
|
|
|
+ <td>${productName}</td>
|
|
|
+ <td>${productType}</td>
|
|
|
+ <td>${item.productNumber}</td>
|
|
|
+ <td>${item.productUnitPrice}</td>
|
|
|
+ <td>${item.productAmounts}</td>
|
|
|
+ <td>${item.sliceTypeLabel}</td>
|
|
|
+ <td>${item.colourNumberLabel}</td>
|
|
|
+ <td>${item.remark}</td>
|
|
|
+ </tr>`;
|
|
|
+ }
|
|
|
+ // 计算小计
|
|
|
+ printStr += `
|
|
|
+ <tr align="center">
|
|
|
+ <td>小计:</td>
|
|
|
+ <td></td>
|
|
|
+ <td>${amountTotal}</td>
|
|
|
+ <td>${singlTotal}</td>
|
|
|
+ <td>${moneyTotal}</td>
|
|
|
+ <td></td>
|
|
|
+ <td></td>
|
|
|
+ <td></td>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <td colspan="8">合计金额(大写):${saleAmountInWords}</td>
|
|
|
+ </tr>
|
|
|
+ `;
|
|
|
+
|
|
|
+ if (salePayType == "1") {
|
|
|
+ //定金
|
|
|
+ printStr += `
|
|
|
+ <tr>
|
|
|
+ <td colspan="4">付款方式:${salePayType}</td>
|
|
|
+ <td colspan="4">定金:${earnestMoney}</td>
|
|
|
+ </tr>`;
|
|
|
+ } else {
|
|
|
+ printStr += `
|
|
|
+ <tr>
|
|
|
+ <td colspan="8">付款方式:${salePayType}</td>
|
|
|
+ </tr>`;
|
|
|
+ }
|
|
|
+ printStr += `<tr align="center">
|
|
|
+ <td colspan="8">工艺要求</td>
|
|
|
+ </tr>
|
|
|
+ <tr align="center">
|
|
|
+ <td width="150px">网络</td>
|
|
|
+ <td width="150px">油剂</td>
|
|
|
+ <td width="150px">卷装</td>
|
|
|
+ <td width="150px">色牢度</td>
|
|
|
+ <td width="150px">捻向</td>
|
|
|
+ <td width="150px">其他</td>
|
|
|
+ <td width="150px"></td>
|
|
|
+ <td width="150px"></td>
|
|
|
+ </tr>
|
|
|
+ <tr align="center">
|
|
|
+ <td >${craftGrid}</td>
|
|
|
+ <td>${craftOil}</td>
|
|
|
+ <td>${craftPackage}</td>
|
|
|
+ <td>${craftColorFastness}</td>
|
|
|
+ <td>${directionOfTwistDescription}</td>
|
|
|
+ <td>${craftOther}</td>
|
|
|
+ <td width="150px"></td>
|
|
|
+ <td width="150px"></td>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <td colspan="8">包装/贴唛:${craftMark}</td>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <td colspan="8">装运方式:${shippingMethod}</td>
|
|
|
+ </tr>
|
|
|
+ <tr align="center">
|
|
|
+ <td colspan="2">业务员:</td>
|
|
|
+ <td colspan="2">${salesman}</td>
|
|
|
+ <td colspan="2">业务主管:</td>
|
|
|
+ <td colspan="2">${saleLeader}</td>
|
|
|
+ </tr>
|
|
|
+ <tr align="center">
|
|
|
+ <td colspan="2">财务部:</td>
|
|
|
+ <td colspan="2">${finance}</td>
|
|
|
+ <td colspan="2">生产部:</td>
|
|
|
+ <td colspan="2">${production}</td>
|
|
|
+ </tr>
|
|
|
+ <tr align="center">
|
|
|
+ <td colspan="2">批准人:</td>
|
|
|
+ <td colspan="2">${saleApprover}</td>
|
|
|
+ <td></td>
|
|
|
+ <td></td>
|
|
|
+ <td></td>
|
|
|
+ <td></td>
|
|
|
+ </tr>
|
|
|
+ </tbody>
|
|
|
+ </table>
|
|
|
+ `;
|
|
|
+ return printStr;
|
|
|
+ }
|
|
|
+ },
|
|
|
// 审批状态改变回调
|
|
|
approveTypeChange(status) {
|
|
|
this.getList(false, status);
|