|
@@ -142,6 +142,12 @@
|
|
|
<el-table-column prop="deliveryDate" label="交货日期" />
|
|
|
<el-table-column prop="saleLeadTime" label="交货天数" />
|
|
|
<el-table-column prop="saleAmountInWords" label="合计金额(大写)" />
|
|
|
+ <el-table-column prop="status" label="状态">
|
|
|
+ <template slot-scope="scope">{{
|
|
|
+ getDictLabel(scope.row.status, "sales_order_status")
|
|
|
+ }}</template>
|
|
|
+ </el-table-column>
|
|
|
+
|
|
|
<el-table-column prop="salesman" label="销售员" />
|
|
|
<el-table-column prop="remark" label="备注" />
|
|
|
<el-table-column label="操作">
|
|
@@ -160,6 +166,24 @@
|
|
|
>修改
|
|
|
</el-button>
|
|
|
</el-dropdown-item>
|
|
|
+ <el-dropdown-item>
|
|
|
+ <el-button
|
|
|
+ size="mini"
|
|
|
+ type="text"
|
|
|
+ icon="el-icon-tickets"
|
|
|
+ @click="handlePrint(scope.row)"
|
|
|
+ >详情
|
|
|
+ </el-button>
|
|
|
+ </el-dropdown-item>
|
|
|
+ <el-dropdown-item>
|
|
|
+ <el-button
|
|
|
+ size="mini"
|
|
|
+ type="text"
|
|
|
+ icon="el-icon-folder-checked"
|
|
|
+ @click="handleSubmit(scope.row)"
|
|
|
+ >提交
|
|
|
+ </el-button>
|
|
|
+ </el-dropdown-item>
|
|
|
<el-dropdown-item>
|
|
|
<el-button
|
|
|
size="mini"
|
|
@@ -243,6 +267,35 @@
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
+
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item v-if="isLeader" label="业务员:">
|
|
|
+ <el-select
|
|
|
+ size="small"
|
|
|
+ v-model="formData.salesman"
|
|
|
+ placeholder="请选择业务员"
|
|
|
+ clearable
|
|
|
+ filterable
|
|
|
+ @change="salemanChange"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in salesmanList"
|
|
|
+ :key="item.value"
|
|
|
+ :label="item.label"
|
|
|
+ :value="item.value"
|
|
|
+ >
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item v-else label="业务员:">
|
|
|
+ <!-- <el-input
|
|
|
+ v-model="formData.salesman"
|
|
|
+ size="small"
|
|
|
+ clearable
|
|
|
+ ></el-input> -->
|
|
|
+ {{ nickName }}
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
<el-col :span="12">
|
|
|
<el-form-item label="联系人:" size="normal">
|
|
|
{{ formData.contactPerson }}
|
|
@@ -255,47 +308,54 @@
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="12">
|
|
|
+ <el-form-item label-width="120px" label="合计金额(大写):">
|
|
|
+ <!-- <el-input
|
|
|
+ v-model="formData.saleAmountInWords"
|
|
|
+ size="small"
|
|
|
+ clearable
|
|
|
+ ></el-input> -->
|
|
|
+ {{ formData.saleAmountInWords }}
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <!-- <el-col :span="12">
|
|
|
+ <el-form-item label="付款方式:">
|
|
|
+ <el-select
|
|
|
+ v-model="formData.salePayType"
|
|
|
+ size="small"
|
|
|
+ clearable
|
|
|
+ filterable
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in dict.type.retail_order_pay_method"
|
|
|
+ :key="item.value"
|
|
|
+ :label="item.label"
|
|
|
+ :value="item.value"
|
|
|
+ ></el-option>
|
|
|
+ </el-select>
|
|
|
+ 零售单
|
|
|
+ </el-form-item>
|
|
|
+ </el-col> -->
|
|
|
+
|
|
|
+ <!-- <el-col :span="12">
|
|
|
<el-form-item
|
|
|
label-width="120px"
|
|
|
prop="saleOrderEstimatedTime"
|
|
|
label="预计下单时间:"
|
|
|
>
|
|
|
- <!-- <el-date-picker
|
|
|
- size="small"
|
|
|
- v-model="formData.saleOrderEstimatedTime"
|
|
|
- value-format="yyyy-MM-dd"
|
|
|
- format="yyyy-MM-dd"
|
|
|
- type="date"
|
|
|
- placeholder="选择日期"
|
|
|
- >
|
|
|
- </el-date-picker> -->
|
|
|
{{ formData.saleOrderEstimatedTime }}
|
|
|
</el-form-item>
|
|
|
- </el-col>
|
|
|
+ </el-col> -->
|
|
|
|
|
|
- <el-col :span="12">
|
|
|
+ <!-- <el-col :span="12">
|
|
|
<el-form-item label="交货日期:" size="normal" prop="deliveryDate">
|
|
|
- <!-- <el-date-picker
|
|
|
- size="small"
|
|
|
- v-model="formData.deliveryDate"
|
|
|
- value-format="yyyy-MM-dd"
|
|
|
- format="yyyy-MM-dd"
|
|
|
- type="date"
|
|
|
- placeholder="选择日期"
|
|
|
- >
|
|
|
- </el-date-picker> -->
|
|
|
{{ formData.deliveryDate }}
|
|
|
</el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :span="12">
|
|
|
+ </el-col> -->
|
|
|
+ <!-- <el-col :span="12">
|
|
|
<el-form-item label="交货天数:" size="normal" prop="saleLeadTime">
|
|
|
- <!-- <el-input
|
|
|
- size="small"
|
|
|
- v-model="formData.saleLeadTime"
|
|
|
- ></el-input> -->
|
|
|
{{ formData.saleLeadTime }}
|
|
|
</el-form-item>
|
|
|
- </el-col>
|
|
|
+ </el-col> -->
|
|
|
<el-col :span="24">
|
|
|
<el-divider>货品明细</el-divider>
|
|
|
</el-col>
|
|
@@ -443,37 +503,7 @@
|
|
|
@click="addProduct"
|
|
|
>添加货品</el-button
|
|
|
>
|
|
|
- <el-col :span="12">
|
|
|
- <el-form-item label-width="120px" label="合计金额(大写)">
|
|
|
- <el-input
|
|
|
- v-model="formData.saleAmountInWords"
|
|
|
- size="small"
|
|
|
- clearable
|
|
|
- ></el-input>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :span="12">
|
|
|
- <el-form-item label="付款方式">
|
|
|
- <!-- <el-input
|
|
|
- v-model="formData.salePayType"
|
|
|
- size="small"
|
|
|
- clearable
|
|
|
- ></el-input> -->
|
|
|
- <el-select
|
|
|
- v-model="formData.salePayType"
|
|
|
- size="small"
|
|
|
- clearable
|
|
|
- filterable
|
|
|
- >
|
|
|
- <el-option
|
|
|
- v-for="item in dict.type.retail_order_pay_method"
|
|
|
- :key="item.value"
|
|
|
- :label="item.label"
|
|
|
- :value="item.value"
|
|
|
- ></el-option>
|
|
|
- </el-select>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
+
|
|
|
<!-- <el-col :span="12" v-show="formData.salePayType == '1'">
|
|
|
<el-form-item prop="earnestMoney" label="定金">
|
|
|
<el-input
|
|
@@ -495,41 +525,9 @@
|
|
|
clearable
|
|
|
></el-input>
|
|
|
</el-col>
|
|
|
- <el-col :span="24">
|
|
|
+ <!-- <el-col :span="24">
|
|
|
<el-divider>审计人员数据</el-divider>
|
|
|
- </el-col>
|
|
|
- <el-col :span="12">
|
|
|
- <el-form-item v-if="isLeader" label="业务员:">
|
|
|
- <!-- <el-input
|
|
|
- v-model="formData.salesman"
|
|
|
- size="small"
|
|
|
- clearable
|
|
|
- ></el-input> -->
|
|
|
- <el-select
|
|
|
- v-model="formData.salesman"
|
|
|
- placeholder="请选择业务员"
|
|
|
- clearable
|
|
|
- filterable
|
|
|
- @change="salemanChange"
|
|
|
- >
|
|
|
- <el-option
|
|
|
- v-for="item in salesmanList"
|
|
|
- :key="item.value"
|
|
|
- :label="item.label"
|
|
|
- :value="item.value"
|
|
|
- >
|
|
|
- </el-option>
|
|
|
- </el-select>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item v-else label="业务员:">
|
|
|
- <!-- <el-input
|
|
|
- v-model="formData.salesman"
|
|
|
- size="small"
|
|
|
- clearable
|
|
|
- ></el-input> -->
|
|
|
- {{ nickName }}
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
+ </el-col> -->
|
|
|
</el-form>
|
|
|
</el-row>
|
|
|
<div slot="footer" class="dialog-footer">
|
|
@@ -539,7 +537,7 @@
|
|
|
</el-dialog>
|
|
|
|
|
|
<!-- 自定义弹窗 -->
|
|
|
- <el-dialog title="提示" :visible.sync="deliverShow" width="1200px">
|
|
|
+ <el-dialog title="提交" :visible.sync="deliverShow" width="1200px">
|
|
|
<!-- <DialogTemplate
|
|
|
ref="dialogRef"
|
|
|
:groupKey="groupKey"
|
|
@@ -550,7 +548,7 @@
|
|
|
@addList="addListHandler"
|
|
|
>
|
|
|
</DialogTemplate> -->
|
|
|
- <Deliver ref="deliverRef" :currentRow="currentRow"></Deliver>
|
|
|
+ <RetailProvide ref="deliverRef"></RetailProvide>
|
|
|
<span slot="footer" class="dialog-footer">
|
|
|
<el-button @click="deliverShow = false">取 消</el-button>
|
|
|
<el-button type="primary" @click="btnComfirm">确 定</el-button>
|
|
@@ -609,6 +607,7 @@ import {
|
|
|
addRetailOrder,
|
|
|
getRetailOrderInfo,
|
|
|
editRetailOrder,
|
|
|
+ retailProductInvoiceInfo,
|
|
|
} from "@/api/system/retailMange.js";
|
|
|
import { listData } from "@/api/system/tenant/data";
|
|
|
import { getToken } from "@/utils/auth";
|
|
@@ -626,15 +625,30 @@ import { v4 as uuidv4 } from "uuid";
|
|
|
import { mapState } from "vuex";
|
|
|
import moment from "moment";
|
|
|
import Deliver from "@/views/orderMange/components/dialogForm/Deliver.vue";
|
|
|
+import RetailProvide from "@/views/orderMange/components/dialogForm/RetailProvide.vue";
|
|
|
import OutBound from "@/views/orderMange/components/dialogForm/OutBound.vue";
|
|
|
import outBoundPrint from "@/utils/print/outBoundPrint";
|
|
|
import { listCustomer } from "@/api/system/customer";
|
|
|
+import { numToCapital } from "@/utils/other";
|
|
|
export default {
|
|
|
name: "retailMange",
|
|
|
- dicts: ["payment_method", "direction_of_twist", "retail_order_pay_method"],
|
|
|
- components: { Queryfrom, Menu, DialogTemplate, Deliver, OutBound },
|
|
|
+ dicts: [
|
|
|
+ "payment_method",
|
|
|
+ "direction_of_twist",
|
|
|
+ "retail_order_pay_method",
|
|
|
+ "sales_order_status",
|
|
|
+ ],
|
|
|
+ components: {
|
|
|
+ Queryfrom,
|
|
|
+ Menu,
|
|
|
+ DialogTemplate,
|
|
|
+ Deliver,
|
|
|
+ OutBound,
|
|
|
+ RetailProvide,
|
|
|
+ },
|
|
|
data() {
|
|
|
return {
|
|
|
+ totalMoney: "", //合计金额 小写
|
|
|
createById: "", //创建者id
|
|
|
salesmanList: [], //销售员列表
|
|
|
isLeader: false, //当前登录用户是否为领导
|
|
@@ -873,7 +887,20 @@ export default {
|
|
|
// 得到当前展示的table的唯一标识
|
|
|
this.tableKey = this.$route.query.tableKey;
|
|
|
},
|
|
|
- watch: {},
|
|
|
+ watch: {
|
|
|
+ totalMoney: {
|
|
|
+ handler(newVal, oldVal) {
|
|
|
+ if (isNaN(Number(newVal))) {
|
|
|
+ this.formData.saleAmountInWords = "零";
|
|
|
+ } else {
|
|
|
+ const ntc = new numToCapital();
|
|
|
+ this.formData.saleAmountInWords = ntc.uppercase(newVal);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ deep: true,
|
|
|
+ immediate: true,
|
|
|
+ },
|
|
|
+ },
|
|
|
async mounted() {
|
|
|
await this.getDropDownData();
|
|
|
},
|
|
@@ -1041,15 +1068,20 @@ export default {
|
|
|
) {
|
|
|
sums[index] = "";
|
|
|
} else if (!values.every((value) => isNaN(value))) {
|
|
|
- sums[index] = values.reduce((prev, curr) => {
|
|
|
- const value = Number(curr);
|
|
|
- if (!isNaN(value)) {
|
|
|
- return prev + curr;
|
|
|
- } else {
|
|
|
- return prev;
|
|
|
- }
|
|
|
- }, 0);
|
|
|
- sums[index];
|
|
|
+ sums[index] = values
|
|
|
+ .reduce((prev, curr) => {
|
|
|
+ const value = Number(curr);
|
|
|
+ if (!isNaN(value)) {
|
|
|
+ return prev + curr;
|
|
|
+ } else {
|
|
|
+ return prev;
|
|
|
+ }
|
|
|
+ }, 0)
|
|
|
+ ?.toFixed(2);
|
|
|
+ console.log(sums[index], index);
|
|
|
+ if (index == 4) {
|
|
|
+ this.totalMoney = sums[index];
|
|
|
+ }
|
|
|
} else {
|
|
|
sums[index] = "N/A";
|
|
|
}
|
|
@@ -1274,11 +1306,45 @@ export default {
|
|
|
callback(new Error("校验失败,请稍后再试"));
|
|
|
}
|
|
|
},
|
|
|
+ // 校验表格数据
|
|
|
+ validateTableData() {
|
|
|
+ if (this.productionTableData.length == 0) {
|
|
|
+ return {
|
|
|
+ res: false,
|
|
|
+ msg: "请添加货品明细",
|
|
|
+ };
|
|
|
+ }
|
|
|
+ let res = this.productionTableData.every((item) => {
|
|
|
+ return (
|
|
|
+ item.productNo &&
|
|
|
+ item.productNumber &&
|
|
|
+ item.productUnitPrice &&
|
|
|
+ item.productAmounts &&
|
|
|
+ item.sliceType &&
|
|
|
+ item.colourNumber
|
|
|
+ );
|
|
|
+ });
|
|
|
+ if (!res) {
|
|
|
+ return {
|
|
|
+ res: false,
|
|
|
+ msg: "请填写完整货品明细",
|
|
|
+ };
|
|
|
+ }
|
|
|
+ return {
|
|
|
+ res: true,
|
|
|
+ msg: "",
|
|
|
+ };
|
|
|
+ },
|
|
|
// 审计 提交编辑结果按钮回调
|
|
|
async editConfirm() {
|
|
|
this.$refs.formDataRef.validate(async (valid) => {
|
|
|
if (valid) {
|
|
|
console.log(valid);
|
|
|
+ let tableValidate = this.validateTableData();
|
|
|
+ if (!tableValidate.res) {
|
|
|
+ this.$message.warning(tableValidate.msg);
|
|
|
+ return;
|
|
|
+ }
|
|
|
let {
|
|
|
id,
|
|
|
//订单表数据
|
|
@@ -1316,6 +1382,7 @@ export default {
|
|
|
contactPerson, //联系人
|
|
|
remark: orderRemark,
|
|
|
salesman: this.isLeader ? salesman : this.nickName,
|
|
|
+ status: 1,
|
|
|
};
|
|
|
payload.saleProductsList = this.productionTableData;
|
|
|
|
|
@@ -1637,6 +1704,89 @@ export default {
|
|
|
return null;
|
|
|
}
|
|
|
},
|
|
|
+ // 初始化数据
|
|
|
+ initData(data) {
|
|
|
+ let {
|
|
|
+ id,
|
|
|
+ //订单表数据
|
|
|
+ saleNo,
|
|
|
+ saleCustomNo,
|
|
|
+ saleDate,
|
|
|
+ saleOrderEstimatedTime,
|
|
|
+ saleLeadTime,
|
|
|
+ deliveryDate,
|
|
|
+ saleAmounts,
|
|
|
+ saleAmountInWords,
|
|
|
+ salePayType,
|
|
|
+ salesman,
|
|
|
+ customAddress,
|
|
|
+ customCountryType, //国家类型
|
|
|
+ contactPerson, //联系人
|
|
|
+
|
|
|
+ // 工艺表数据
|
|
|
+ remark,
|
|
|
+
|
|
|
+ // 产品列表
|
|
|
+ saleProductsList,
|
|
|
+ } = data;
|
|
|
+ Object.assign(this.formData, {
|
|
|
+ id,
|
|
|
+ //订单表数据
|
|
|
+ saleNo,
|
|
|
+ saleCustomNo,
|
|
|
+ saleDate,
|
|
|
+ saleOrderEstimatedTime,
|
|
|
+ saleLeadTime,
|
|
|
+ deliveryDate,
|
|
|
+ saleAmounts,
|
|
|
+ saleAmountInWords,
|
|
|
+ salePayType,
|
|
|
+ salesman,
|
|
|
+ customAddress,
|
|
|
+ customCountryType, //国家类型
|
|
|
+ contactPerson, //联系人
|
|
|
+
|
|
|
+ // 工艺表数据
|
|
|
+ orderRemark: remark,
|
|
|
+ });
|
|
|
+ this.customChangeHandler(saleCustomNo);
|
|
|
+ this.productionTableData = saleProductsList.map((item) => {
|
|
|
+ let {
|
|
|
+ id,
|
|
|
+ saleProductNo,
|
|
|
+ productNo, //货品编号
|
|
|
+ productName, //货品名称
|
|
|
+ productNumber, //销售数量
|
|
|
+ productWeight, //销售重量kg
|
|
|
+ productUnitPrice, //单价
|
|
|
+ productAmounts, //金额
|
|
|
+ sliceType, //切片类型 初始为 切片
|
|
|
+ sliceTypeLabel,
|
|
|
+ colourNumberLabel,
|
|
|
+ colourNumber, //色号
|
|
|
+ remark, //备注
|
|
|
+ } = item;
|
|
|
+ let productType = this.allProductionOptions.find(
|
|
|
+ (i) => productNo == i.productNo
|
|
|
+ )?.productType;
|
|
|
+ return {
|
|
|
+ id,
|
|
|
+ saleProductNo,
|
|
|
+ productNo, //货品编号
|
|
|
+ productType, //类型
|
|
|
+ productName, //货品名称
|
|
|
+ productNumber, //销售数量
|
|
|
+ productWeight, //销售重量kg
|
|
|
+ productUnitPrice, //单价
|
|
|
+ productAmounts, //金额
|
|
|
+ sliceType, //切片类型 初始为 切片
|
|
|
+ sliceTypeLabel,
|
|
|
+ colourNumberLabel,
|
|
|
+ colourNumber, //色号
|
|
|
+ remark,
|
|
|
+ };
|
|
|
+ });
|
|
|
+ },
|
|
|
/** 修改按钮操作 */
|
|
|
async handleUpdate(row) {
|
|
|
console.log(row);
|
|
@@ -1652,84 +1802,7 @@ export default {
|
|
|
let res = await getRetailOrderInfo(row.id);
|
|
|
console.log(res);
|
|
|
if (res.code == 200) {
|
|
|
- let {
|
|
|
- id,
|
|
|
- //订单表数据
|
|
|
- saleNo,
|
|
|
- saleCustomNo,
|
|
|
- saleDate,
|
|
|
- saleOrderEstimatedTime,
|
|
|
- saleLeadTime,
|
|
|
- deliveryDate,
|
|
|
- saleAmounts,
|
|
|
- saleAmountInWords,
|
|
|
- salePayType,
|
|
|
- salesman,
|
|
|
- customAddress,
|
|
|
- customCountryType, //国家类型
|
|
|
- contactPerson, //联系人
|
|
|
-
|
|
|
- // 工艺表数据
|
|
|
- remark,
|
|
|
-
|
|
|
- // 产品列表
|
|
|
- saleProductsList,
|
|
|
- } = res.data;
|
|
|
- Object.assign(this.formData, {
|
|
|
- id,
|
|
|
- //订单表数据
|
|
|
- saleNo,
|
|
|
- saleCustomNo,
|
|
|
- saleDate,
|
|
|
- saleOrderEstimatedTime,
|
|
|
- saleLeadTime,
|
|
|
- deliveryDate,
|
|
|
- saleAmounts,
|
|
|
- saleAmountInWords,
|
|
|
- salePayType,
|
|
|
- salesman,
|
|
|
- customAddress,
|
|
|
- customCountryType, //国家类型
|
|
|
- contactPerson, //联系人
|
|
|
-
|
|
|
- // 工艺表数据
|
|
|
- orderRemark: remark,
|
|
|
- });
|
|
|
- this.customChangeHandler(saleCustomNo);
|
|
|
- this.productionTableData = saleProductsList.map((item) => {
|
|
|
- let {
|
|
|
- id,
|
|
|
- saleProductNo,
|
|
|
- productNo, //货品编号
|
|
|
- productType, //类型
|
|
|
- productName, //货品名称
|
|
|
- productNumber, //销售数量
|
|
|
- productWeight, //销售重量kg
|
|
|
- productUnitPrice, //单价
|
|
|
- productAmounts, //金额
|
|
|
- sliceType, //切片类型 初始为 切片
|
|
|
- sliceTypeLabel,
|
|
|
- colourNumberLabel,
|
|
|
- colourNumber, //色号
|
|
|
- remark, //备注
|
|
|
- } = item;
|
|
|
- return {
|
|
|
- id,
|
|
|
- saleProductNo,
|
|
|
- productNo, //货品编号
|
|
|
- productType, //类型
|
|
|
- productName, //货品名称
|
|
|
- productNumber, //销售数量
|
|
|
- productWeight, //销售重量kg
|
|
|
- productUnitPrice, //单价
|
|
|
- productAmounts, //金额
|
|
|
- sliceType, //切片类型 初始为 切片
|
|
|
- sliceTypeLabel,
|
|
|
- colourNumberLabel,
|
|
|
- colourNumber, //色号
|
|
|
- remark,
|
|
|
- };
|
|
|
- });
|
|
|
+ this.initData(res.data);
|
|
|
this.open = true;
|
|
|
} else {
|
|
|
this.$message.error(res.msg);
|
|
@@ -1738,6 +1811,161 @@ export default {
|
|
|
console.log(error);
|
|
|
}
|
|
|
},
|
|
|
+ //详情 打印回调
|
|
|
+ async handlePrint(row) {
|
|
|
+ await this.getDropDownData();
|
|
|
+ this.isLeader = !this.userInfo.roles.includes("salesman");
|
|
|
+ if (!this.isLeader) {
|
|
|
+ this.createById = this.userInfo.userId;
|
|
|
+ }
|
|
|
+ await this.getRoleUser();
|
|
|
+ try {
|
|
|
+ let res = await getRetailOrderInfo(row.id);
|
|
|
+ console.log(res);
|
|
|
+ if (res.code == 200) {
|
|
|
+ this.initData(res.data);
|
|
|
+ this.printDomData = this.getPrintDom(res.data);
|
|
|
+ this.detailShow = true;
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$refs.detailTable.innerHTML = this.printDomData;
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ this.$message.error(res.msg);
|
|
|
+ }
|
|
|
+ } catch (error) {
|
|
|
+ console.log(error);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 提交 回调
|
|
|
+ async handleSubmit(row) {
|
|
|
+ this.deliverShow = true;
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$refs.deliverRef.productInvoiceInfo(row);
|
|
|
+ });
|
|
|
+ },
|
|
|
+ // 获取打印dom
|
|
|
+ getPrintDom(data) {
|
|
|
+ let {
|
|
|
+ id,
|
|
|
+ //订单表数据
|
|
|
+ saleNo,
|
|
|
+ saleCustomNo,
|
|
|
+ saleDate,
|
|
|
+ saleOrderEstimatedTime,
|
|
|
+ saleLeadTime,
|
|
|
+ deliveryDate,
|
|
|
+ saleAmounts,
|
|
|
+ saleAmountInWords,
|
|
|
+ salePayType,
|
|
|
+ salesman,
|
|
|
+ customAddress,
|
|
|
+ customCountryType, //国家类型
|
|
|
+ contactPerson, //联系人
|
|
|
+
|
|
|
+ // 工艺表数据
|
|
|
+ orderRemark,
|
|
|
+ } = this.formData;
|
|
|
+ this.productionTableData;
|
|
|
+ let customData = this.customerOptions.find(
|
|
|
+ (item) => item.customNo == saleCustomNo
|
|
|
+ );
|
|
|
+ let customerName = customData ? customData.customName : "";
|
|
|
+ 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 colspan="2">业务员:</td>
|
|
|
+ <td colspan="2">${salesman}</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 width="150px" colspan="1">${contactPerson}</td>
|
|
|
+ <td colspan="2">合计金额(大写):</td>
|
|
|
+ <td colspan="3">${saleAmountInWords}</td>
|
|
|
+ </tr>
|
|
|
+ <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>`;
|
|
|
+ let amountTotal = 0,
|
|
|
+ singlTotal = 0,
|
|
|
+ moneyTotal = 0;
|
|
|
+ for (let i = 0; i < this.productionTableData.length; i++) {
|
|
|
+ let item = this.productionTableData[i];
|
|
|
+ amountTotal += Number(item.productNumber);
|
|
|
+ singlTotal += Number(item.productUnitPrice);
|
|
|
+ moneyTotal += Number(item.productAmounts);
|
|
|
+ let productData = this.productionOptions.find(
|
|
|
+ (pro) => pro.productNo == item.productNo
|
|
|
+ );
|
|
|
+ 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>`;
|
|
|
+ }
|
|
|
+ // 计算小计
|
|
|
+ amountTotal = amountTotal.toFixed(2);
|
|
|
+ singlTotal = singlTotal.toFixed(2);
|
|
|
+ moneyTotal = moneyTotal.toFixed(2);
|
|
|
+ printStr += `
|
|
|
+ <tr align="center">
|
|
|
+ <td>小计:</td>
|
|
|
+ <td></td>
|
|
|
+ <td>${amountTotal}</td>
|
|
|
+ <td>${singlTotal}</td>
|
|
|
+ <td>${moneyTotal}</td>
|
|
|
+ <td></td>
|
|
|
+ <td></td>
|
|
|
+ <td></td>
|
|
|
+ </tr>`;
|
|
|
+ printStr += `<tr align="left">
|
|
|
+ <td colspan="8">订单备注:${orderRemark}</td>
|
|
|
+ </tr>
|
|
|
+ </tbody>
|
|
|
+ </table>`;
|
|
|
+ return printStr;
|
|
|
+ },
|
|
|
// 添加真正的字段名
|
|
|
addRealFieldName(row) {
|
|
|
let fieldList = Object.keys(row);
|