|
@@ -158,7 +158,7 @@ export default {
|
|
|
label: "dictValue",
|
|
|
value: "dictValue"
|
|
|
},
|
|
|
- value:'网络支付'
|
|
|
+ value: '网络支付'
|
|
|
}, {
|
|
|
label: '联系人',
|
|
|
prop: "contacts",
|
|
@@ -218,17 +218,6 @@ export default {
|
|
|
refreshBtn: false,
|
|
|
dialogDrag: true,
|
|
|
addBtn: true,
|
|
|
- btns: [
|
|
|
- {
|
|
|
- text: "录入明细",
|
|
|
- type: "primary"
|
|
|
- },
|
|
|
- {
|
|
|
- text: "打印",
|
|
|
- type: "default",
|
|
|
- click: "handlePrint"
|
|
|
- }
|
|
|
- ],
|
|
|
span: 8,
|
|
|
height: 500,
|
|
|
addRowBtn: false,
|
|
@@ -272,6 +261,10 @@ export default {
|
|
|
label: '商品名称',
|
|
|
prop: 'goodsId',
|
|
|
width: 200,
|
|
|
+ disabled: function (row) {
|
|
|
+ // 根据行数据进行条件判断
|
|
|
+ return row.businessSource === '外部销售'; // 如果销售类型为外部销售,禁止编辑
|
|
|
+ },
|
|
|
overHidden: true,
|
|
|
type: 'select',
|
|
|
props: {
|
|
@@ -283,10 +276,18 @@ export default {
|
|
|
label: '物料编码',
|
|
|
prop: 'goodsNo',
|
|
|
overHidden: true,
|
|
|
+ disabled: function (row) {
|
|
|
+ // 根据行数据进行条件判断
|
|
|
+ return row.businessSource === '外部销售'; // 如果销售类型为外部销售,禁止编辑
|
|
|
+ },
|
|
|
width: 100
|
|
|
}, {
|
|
|
label: '品牌',
|
|
|
prop: 'brandId',
|
|
|
+ disabled: function (row) {
|
|
|
+ // 根据行数据进行条件判断
|
|
|
+ return row.businessSource === '外部销售'; // 如果销售类型为外部销售,禁止编辑
|
|
|
+ },
|
|
|
width: 100,
|
|
|
overHidden: true,
|
|
|
type: 'select',
|
|
@@ -299,26 +300,46 @@ export default {
|
|
|
label: '规格型号',
|
|
|
prop: 'propertyName',
|
|
|
overHidden: true,
|
|
|
+ disabled: function (row) {
|
|
|
+ // 根据行数据进行条件判断
|
|
|
+ return row.businessSource === '外部销售'; // 如果销售类型为外部销售,禁止编辑
|
|
|
+ },
|
|
|
width: 100
|
|
|
}, {
|
|
|
label: '花纹',
|
|
|
prop: 'pattern',
|
|
|
overHidden: true,
|
|
|
+ disabled: function (row) {
|
|
|
+ // 根据行数据进行条件判断
|
|
|
+ return row.businessSource === '外部销售'; // 如果销售类型为外部销售,禁止编辑
|
|
|
+ },
|
|
|
width: 100
|
|
|
}, {
|
|
|
label: '商品描述',
|
|
|
prop: 'goodsDescription',
|
|
|
+ disabled: function (row) {
|
|
|
+ // 根据行数据进行条件判断
|
|
|
+ return row.businessSource === '外部销售'; // 如果销售类型为外部销售,禁止编辑
|
|
|
+ },
|
|
|
overHidden: true,
|
|
|
width: 100
|
|
|
}, {
|
|
|
label: '数量',
|
|
|
prop: 'goodsNum',
|
|
|
overHidden: true,
|
|
|
+ disabled: function (row) {
|
|
|
+ // 根据行数据进行条件判断
|
|
|
+ return row.businessSource === '外部销售'; // 如果销售类型为外部销售,禁止编辑
|
|
|
+ },
|
|
|
width: 100
|
|
|
}, {
|
|
|
label: '单位',
|
|
|
prop: 'units',
|
|
|
type: "select",
|
|
|
+ disabled: function (row) {
|
|
|
+ // 根据行数据进行条件判断
|
|
|
+ return row.businessSource === '外部销售'; // 如果销售类型为外部销售,禁止编辑
|
|
|
+ },
|
|
|
props: {
|
|
|
label: "dictValue",
|
|
|
value: "dictValue"
|
|
@@ -350,39 +371,43 @@ export default {
|
|
|
{
|
|
|
label: '发货数量',
|
|
|
prop: 'sendNum',
|
|
|
+ disabled: function (row) {
|
|
|
+ // 根据行数据进行条件判断
|
|
|
+ return row.businessSource === '外部销售'; // 如果销售类型为外部销售,禁止编辑
|
|
|
+ },
|
|
|
overHidden: true,
|
|
|
width: 100
|
|
|
},
|
|
|
- // {
|
|
|
- // label: '毛利',
|
|
|
- // prop: 'grossProfit',
|
|
|
- // overHidden: true,
|
|
|
- // width: 100
|
|
|
- // },
|
|
|
- // {
|
|
|
- // label: '利润',
|
|
|
- // prop: 'profit',
|
|
|
- // overHidden: true,
|
|
|
- // width: 100
|
|
|
- // }
|
|
|
- // , {
|
|
|
- // label: '小计',
|
|
|
- // prop: 'subTotalMoney',
|
|
|
- // overHidden: true,
|
|
|
- // width: 100
|
|
|
- // }, {
|
|
|
- // label: '返利',
|
|
|
- // prop: 'thisAmount',
|
|
|
- // overHidden: true,
|
|
|
- // width: 100
|
|
|
- // },
|
|
|
- // {
|
|
|
- // label: '成本',
|
|
|
- // prop: 'costprie',
|
|
|
- // overHidden: true,
|
|
|
- // width: 100
|
|
|
- // }
|
|
|
- ]
|
|
|
+ // {
|
|
|
+ // label: '毛利',
|
|
|
+ // prop: 'grossProfit',
|
|
|
+ // overHidden: true,
|
|
|
+ // width: 100
|
|
|
+ // },
|
|
|
+ // {
|
|
|
+ // label: '利润',
|
|
|
+ // prop: 'profit',
|
|
|
+ // overHidden: true,
|
|
|
+ // width: 100
|
|
|
+ // }
|
|
|
+ // , {
|
|
|
+ // label: '小计',
|
|
|
+ // prop: 'subTotalMoney',
|
|
|
+ // overHidden: true,
|
|
|
+ // width: 100
|
|
|
+ // }, {
|
|
|
+ // label: '返利',
|
|
|
+ // prop: 'thisAmount',
|
|
|
+ // overHidden: true,
|
|
|
+ // width: 100
|
|
|
+ // },
|
|
|
+ // {
|
|
|
+ // label: '成本',
|
|
|
+ // prop: 'costprie',
|
|
|
+ // overHidden: true,
|
|
|
+ // width: 100
|
|
|
+ // }
|
|
|
+ ]
|
|
|
},
|
|
|
optionPaymentDetails: {},
|
|
|
optionPaymentDetailsBack: {
|
|
@@ -579,16 +604,33 @@ export default {
|
|
|
},
|
|
|
//打印
|
|
|
handlePrint() {
|
|
|
- const salesDetail = this.form.orderItemsList;
|
|
|
- // 调用 Avue 的打印方法
|
|
|
- this.$print({
|
|
|
- title: '销售明细打印', // 打印页面的标题
|
|
|
- printBody: [
|
|
|
- // 构建打印内容,可以根据实际需求进行调整
|
|
|
- { type: 'html', value: '<h1>销售明细</h1>' },
|
|
|
- { type: 'table', value: salesDetail }
|
|
|
- ]
|
|
|
- });
|
|
|
+ // 获取表格的表头和内容的HTML代码
|
|
|
+ const tableHeader = this.$refs.formContacts.$el.querySelector('.el-table__header-wrapper').outerHTML;
|
|
|
+ const tableContent = this.$refs.formContacts.$el.querySelector('.el-table__body-wrapper').outerHTML;
|
|
|
+
|
|
|
+ // 创建一个新的打印页面
|
|
|
+ const printWindow = window.open('', '_blank');
|
|
|
+
|
|
|
+ // 将新窗口的内容设置为表头和内容的HTML代码
|
|
|
+ printWindow.document.open();
|
|
|
+ printWindow.document.write(`
|
|
|
+ <html>
|
|
|
+ <head>
|
|
|
+ <style>
|
|
|
+ /* 添加打印样式 */
|
|
|
+ </style>
|
|
|
+ </head>
|
|
|
+ <body>
|
|
|
+ ${tableHeader}
|
|
|
+ ${tableContent}
|
|
|
+ </body>
|
|
|
+ </html>
|
|
|
+ `);
|
|
|
+ printWindow.document.close();
|
|
|
+
|
|
|
+ // 在新窗口中调用浏览器的打印功能
|
|
|
+ printWindow.print();
|
|
|
+ printWindow.close();
|
|
|
},
|
|
|
//自定义列保存
|
|
|
async saveColumnTwo(ref, option, optionBack, code) {
|