|
@@ -143,9 +143,11 @@
|
|
<el-table-column prop="saleLeadTime" label="交货天数" />
|
|
<el-table-column prop="saleLeadTime" label="交货天数" />
|
|
<el-table-column prop="saleAmountInWords" label="合计金额(大写)" />
|
|
<el-table-column prop="saleAmountInWords" label="合计金额(大写)" />
|
|
<el-table-column prop="status" label="状态">
|
|
<el-table-column prop="status" label="状态">
|
|
- <template slot-scope="scope">{{
|
|
|
|
- getDictLabel(scope.row.status, "sales_order_status")
|
|
|
|
- }}</template>
|
|
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
+ <el-tag :type="scope.row.listClass">{{
|
|
|
|
+ getDictLabel(scope.row.status, "sales_order_status")
|
|
|
|
+ }}</el-tag>
|
|
|
|
+ </template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
|
|
|
<el-table-column prop="salesman" label="销售员" />
|
|
<el-table-column prop="salesman" label="销售员" />
|
|
@@ -175,7 +177,7 @@
|
|
>详情
|
|
>详情
|
|
</el-button>
|
|
</el-button>
|
|
</el-dropdown-item>
|
|
</el-dropdown-item>
|
|
- <el-dropdown-item>
|
|
|
|
|
|
+ <el-dropdown-item v-show="scope.row.status == 1">
|
|
<el-button
|
|
<el-button
|
|
size="mini"
|
|
size="mini"
|
|
type="text"
|
|
type="text"
|
|
@@ -184,6 +186,39 @@
|
|
>提交
|
|
>提交
|
|
</el-button>
|
|
</el-button>
|
|
</el-dropdown-item>
|
|
</el-dropdown-item>
|
|
|
|
+ <el-dropdown-item v-show="scope.row.status == 2">
|
|
|
|
+ <el-button
|
|
|
|
+ size="mini"
|
|
|
|
+ type="text"
|
|
|
|
+ icon="el-icon-folder-delete"
|
|
|
|
+ @click="handleSubmitCancel(scope.row)"
|
|
|
|
+ >取消提交
|
|
|
|
+ </el-button>
|
|
|
|
+ </el-dropdown-item>
|
|
|
|
+ <el-dropdown-item v-show="scope.row.status != 1">
|
|
|
|
+ <el-button
|
|
|
|
+ size="mini"
|
|
|
|
+ type="text"
|
|
|
|
+ icon="el-icon-folder-delete"
|
|
|
|
+ @click="handleOutDetail(scope.row)"
|
|
|
|
+ >出库明细
|
|
|
|
+ </el-button>
|
|
|
|
+ </el-dropdown-item>
|
|
|
|
+ <el-dropdown-item
|
|
|
|
+ v-show="
|
|
|
|
+ scope.row.status == 1 ||
|
|
|
|
+ scope.row.status == 2 ||
|
|
|
|
+ scope.row.status == 8
|
|
|
|
+ "
|
|
|
|
+ >
|
|
|
|
+ <el-button
|
|
|
|
+ size="mini"
|
|
|
|
+ type="text"
|
|
|
|
+ icon="el-icon-folder-delete"
|
|
|
|
+ @click="myPrintOutBoundHandler(scope.row)"
|
|
|
|
+ >打印出库单
|
|
|
|
+ </el-button>
|
|
|
|
+ </el-dropdown-item>
|
|
<el-dropdown-item>
|
|
<el-dropdown-item>
|
|
<el-button
|
|
<el-button
|
|
size="mini"
|
|
size="mini"
|
|
@@ -551,6 +586,7 @@
|
|
<RetailProvide ref="deliverRef"></RetailProvide>
|
|
<RetailProvide ref="deliverRef"></RetailProvide>
|
|
<span slot="footer" class="dialog-footer">
|
|
<span slot="footer" class="dialog-footer">
|
|
<el-button @click="deliverShow = false">取 消</el-button>
|
|
<el-button @click="deliverShow = false">取 消</el-button>
|
|
|
|
+ <!-- <el-button @click="btnSave">保 存</el-button> -->
|
|
<el-button type="primary" @click="btnComfirm">确 定</el-button>
|
|
<el-button type="primary" @click="btnComfirm">确 定</el-button>
|
|
</span>
|
|
</span>
|
|
</el-dialog>
|
|
</el-dialog>
|
|
@@ -578,6 +614,15 @@
|
|
>
|
|
>
|
|
</span>
|
|
</span>
|
|
</el-dialog>
|
|
</el-dialog>
|
|
|
|
+ <!-- 出库详情 -->
|
|
|
|
+ <el-dialog title="出库明细" :visible.sync="outStockShow" width="1200px">
|
|
|
|
+ <OutStock ref="outStockRef"></OutStock>
|
|
|
|
+ <span slot="footer" class="dialog-footer">
|
|
|
|
+ <el-button @click="outStockShow = false">关 闭</el-button>
|
|
|
|
+ <!-- <el-button @click="btnSave">保 存</el-button> -->
|
|
|
|
+ <!-- <el-button type="primary" @click="btnComfirm">确 定</el-button> -->
|
|
|
|
+ </span>
|
|
|
|
+ </el-dialog>
|
|
<div id="printDom"></div>
|
|
<div id="printDom"></div>
|
|
</div>
|
|
</div>
|
|
</el-card>
|
|
</el-card>
|
|
@@ -608,6 +653,8 @@ import {
|
|
getRetailOrderInfo,
|
|
getRetailOrderInfo,
|
|
editRetailOrder,
|
|
editRetailOrder,
|
|
retailProductInvoiceInfo,
|
|
retailProductInvoiceInfo,
|
|
|
|
+ submitRetailOrder,
|
|
|
|
+ cancelRetailOrder,
|
|
} from "@/api/system/retailMange.js";
|
|
} from "@/api/system/retailMange.js";
|
|
import { listData } from "@/api/system/tenant/data";
|
|
import { listData } from "@/api/system/tenant/data";
|
|
import { getToken } from "@/utils/auth";
|
|
import { getToken } from "@/utils/auth";
|
|
@@ -626,6 +673,7 @@ import { mapState } from "vuex";
|
|
import moment from "moment";
|
|
import moment from "moment";
|
|
import Deliver from "@/views/orderMange/components/dialogForm/Deliver.vue";
|
|
import Deliver from "@/views/orderMange/components/dialogForm/Deliver.vue";
|
|
import RetailProvide from "@/views/orderMange/components/dialogForm/RetailProvide.vue";
|
|
import RetailProvide from "@/views/orderMange/components/dialogForm/RetailProvide.vue";
|
|
|
|
+import OutStock from "@/views/orderMange/components/dialogForm/OutStock.vue";
|
|
import OutBound from "@/views/orderMange/components/dialogForm/OutBound.vue";
|
|
import OutBound from "@/views/orderMange/components/dialogForm/OutBound.vue";
|
|
import outBoundPrint from "@/utils/print/outBoundPrint";
|
|
import outBoundPrint from "@/utils/print/outBoundPrint";
|
|
import { listCustomer } from "@/api/system/customer";
|
|
import { listCustomer } from "@/api/system/customer";
|
|
@@ -645,9 +693,11 @@ export default {
|
|
Deliver,
|
|
Deliver,
|
|
OutBound,
|
|
OutBound,
|
|
RetailProvide,
|
|
RetailProvide,
|
|
|
|
+ OutStock,
|
|
},
|
|
},
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
|
|
+ outStockShow: false, //出库详情弹窗
|
|
totalMoney: "", //合计金额 小写
|
|
totalMoney: "", //合计金额 小写
|
|
createById: "", //创建者id
|
|
createById: "", //创建者id
|
|
salesmanList: [], //销售员列表
|
|
salesmanList: [], //销售员列表
|
|
@@ -914,6 +964,22 @@ export default {
|
|
}),
|
|
}),
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
|
|
+ // 出库单回调
|
|
|
|
+ async myPrintOutBoundHandler(row) {
|
|
|
|
+ console.log("row", row);
|
|
|
|
+ this.currentRow = row;
|
|
|
|
+ this.outBoundShow = true;
|
|
|
|
+ this.$nextTick(() => {
|
|
|
|
+ this.$refs.outBoundRef.getTableData(row);
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ // 出库详情回调
|
|
|
|
+ handleOutDetail(row) {
|
|
|
|
+ this.outStockShow = true;
|
|
|
|
+ this.$nextTick(() => {
|
|
|
|
+ this.$refs.outStockRef.getOutStockDetail(row);
|
|
|
|
+ });
|
|
|
|
+ },
|
|
// 业务员改变回调
|
|
// 业务员改变回调
|
|
salemanChange(val) {
|
|
salemanChange(val) {
|
|
if (!val) {
|
|
if (!val) {
|
|
@@ -979,7 +1045,7 @@ export default {
|
|
console.log(res);
|
|
console.log(res);
|
|
if (res.flag) {
|
|
if (res.flag) {
|
|
res.data.form.printUser = this.nickName;
|
|
res.data.form.printUser = this.nickName;
|
|
- outBoundPrint(res.data, "printDom");
|
|
|
|
|
|
+ outBoundPrint(res.data, "printDom", true);
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
|
|
@@ -1261,6 +1327,12 @@ export default {
|
|
console.log(res);
|
|
console.log(res);
|
|
if (res.code == 200) {
|
|
if (res.code == 200) {
|
|
this.tableList = res.rows;
|
|
this.tableList = res.rows;
|
|
|
|
+ console.log(this.dict.type.sales_order_status);
|
|
|
|
+ this.tableList.forEach((item) => {
|
|
|
|
+ item.listClass = this.dict.type.sales_order_status.find(
|
|
|
|
+ (i) => i.value == item.status
|
|
|
|
+ ).raw.listClass;
|
|
|
|
+ });
|
|
this.total = res.total;
|
|
this.total = res.total;
|
|
} else {
|
|
} else {
|
|
this.$message.error(res.msg);
|
|
this.$message.error(res.msg);
|
|
@@ -1843,6 +1915,44 @@ export default {
|
|
this.$refs.deliverRef.productInvoiceInfo(row);
|
|
this.$refs.deliverRef.productInvoiceInfo(row);
|
|
});
|
|
});
|
|
},
|
|
},
|
|
|
|
+ // 取消提交
|
|
|
|
+ async handleSubmitCancel(row) {
|
|
|
|
+ console.log(row);
|
|
|
|
+ this.$confirm("此操作将撤回该次提交, 是否继续?", "提示", {
|
|
|
|
+ confirmButtonText: "确定",
|
|
|
|
+ cancelButtonText: "取消",
|
|
|
|
+ type: "warning",
|
|
|
|
+ })
|
|
|
|
+ .then(async () => {
|
|
|
|
+ // this.$message({
|
|
|
|
+ // type: 'success',
|
|
|
|
+ // message: '删除成功!'
|
|
|
|
+ // });
|
|
|
|
+ try {
|
|
|
|
+ let { saleNo } = row;
|
|
|
|
+ let payLoad = {
|
|
|
|
+ saleOrderNo: saleNo,
|
|
|
|
+ status: 1,
|
|
|
|
+ };
|
|
|
|
+ let res = await cancelRetailOrder(payLoad);
|
|
|
|
+ if (res.code == 200) {
|
|
|
|
+ this.$message.success("取消成功");
|
|
|
|
+ this.getList();
|
|
|
|
+ } else {
|
|
|
|
+ this.$message.error("取消失败");
|
|
|
|
+ console.log(res);
|
|
|
|
+ }
|
|
|
|
+ } catch (error) {
|
|
|
|
+ console.log(error);
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ .catch(() => {
|
|
|
|
+ this.$message({
|
|
|
|
+ type: "info",
|
|
|
|
+ message: "已取消",
|
|
|
|
+ });
|
|
|
|
+ });
|
|
|
|
+ },
|
|
// 获取打印dom
|
|
// 获取打印dom
|
|
getPrintDom(data) {
|
|
getPrintDom(data) {
|
|
let {
|
|
let {
|
|
@@ -2177,35 +2287,58 @@ export default {
|
|
let res = await this.$refs.deliverRef.getAllData();
|
|
let res = await this.$refs.deliverRef.getAllData();
|
|
let { flag, isEdit, data } = res;
|
|
let { flag, isEdit, data } = res;
|
|
if (flag) {
|
|
if (flag) {
|
|
- if (isEdit) {
|
|
|
|
- //编辑
|
|
|
|
- let payLoad = {
|
|
|
|
- ...data.formData,
|
|
|
|
- saleProductInfoList: data.tableData,
|
|
|
|
- };
|
|
|
|
- let res = await updateProductInvoice(payLoad);
|
|
|
|
- if (res.code == 200) {
|
|
|
|
- this.$message.success("修改成功");
|
|
|
|
- this.deliverShow = false;
|
|
|
|
- this.getList();
|
|
|
|
- } else {
|
|
|
|
- this.$message.error("网络异常");
|
|
|
|
- }
|
|
|
|
|
|
+ // if (isEdit) {
|
|
|
|
+ // //编辑
|
|
|
|
+ // let payLoad = {
|
|
|
|
+ // ...data.formData,
|
|
|
|
+ // saleProductInfoList: data.tableData,
|
|
|
|
+ // };
|
|
|
|
+ // let res = await updateProductInvoice(payLoad);
|
|
|
|
+ // if (res.code == 200) {
|
|
|
|
+ // this.$message.success("修改成功");
|
|
|
|
+ // this.deliverShow = false;
|
|
|
|
+ // this.getList();
|
|
|
|
+ // } else {
|
|
|
|
+ // this.$message.error("网络异常");
|
|
|
|
+ // }
|
|
|
|
+ // } else {
|
|
|
|
+ //新增
|
|
|
|
+ let payLoad = {
|
|
|
|
+ ...data.formData,
|
|
|
|
+ saleProductInfoList: data.tableData,
|
|
|
|
+ };
|
|
|
|
+ payLoad.status = 5;
|
|
|
|
+ // let res = await addProductInvoice(payLoad);
|
|
|
|
+ let res = await submitRetailOrder(payLoad);
|
|
|
|
+ if (res.code == 200) {
|
|
|
|
+ this.$message.success("提交成功");
|
|
|
|
+ this.deliverShow = false;
|
|
|
|
+ this.getList();
|
|
} else {
|
|
} else {
|
|
- //新增
|
|
|
|
- let payLoad = {
|
|
|
|
- ...data.formData,
|
|
|
|
- saleProductInfoList: data.tableData,
|
|
|
|
- };
|
|
|
|
- let res = await addProductInvoice(payLoad);
|
|
|
|
- if (res.code == 200) {
|
|
|
|
- this.$message.success("保存成功");
|
|
|
|
- this.deliverShow = false;
|
|
|
|
- this.getList();
|
|
|
|
- } else {
|
|
|
|
- this.$message.error("网络异常");
|
|
|
|
- }
|
|
|
|
|
|
+ this.$message.error("网络异常");
|
|
|
|
+ }
|
|
|
|
+ // }
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ // 保存提交数据
|
|
|
|
+ async btnSave() {
|
|
|
|
+ let res = await this.$refs.deliverRef.getAllData();
|
|
|
|
+ let { flag, isEdit, data } = res;
|
|
|
|
+ if (flag) {
|
|
|
|
+ let payLoad = {
|
|
|
|
+ ...data.formData,
|
|
|
|
+ saleProductInfoList: data.tableData,
|
|
|
|
+ };
|
|
|
|
+ payLoad.status = 1;
|
|
|
|
+ let res = await updateProductInvoice(payLoad);
|
|
|
|
+ if (res.code == 200) {
|
|
|
|
+ this.$message.success("保存成功");
|
|
|
|
+ this.deliverShow = false;
|
|
|
|
+ this.getList();
|
|
|
|
+ } else {
|
|
|
|
+ this.$message.error("网络异常");
|
|
}
|
|
}
|
|
|
|
+ // }
|
|
}
|
|
}
|
|
},
|
|
},
|
|
// 去掉表名 开头字母小写
|
|
// 去掉表名 开头字母小写
|