|
|
@@ -79,16 +79,21 @@
|
|
|
<el-tab-pane label="采购明细" name="sale_detail">
|
|
|
<avue-crud :option="optionContacts" v-model="formContacts" ref="formContacts"
|
|
|
:data="form.orderItemsList" :key="key" @row-save="rowSave" @row-update="rowUpdate"
|
|
|
- @row-close="rowClose" :before-close="beforeClose"
|
|
|
+ @row-close="rowClose" :before-close="beforeClose" @selection-change="selectionContacts"
|
|
|
@resetColumn="resetColumnTwo('formContacts', 'optionContacts', 'optionContactsBack', 269.1)"
|
|
|
@saveColumn="saveColumnTwo('formContacts', 'optionContacts', 'optionContactsBack', 269.1)">
|
|
|
<template slot-scope="{scope,row}" slot="menuLeft">
|
|
|
<el-button type="primary" icon="el-icon-plus" size="small" :disabled="isAddBtn"
|
|
|
@click="rowAdd(row)">添加商品</el-button>
|
|
|
- <el-button type="success" size="small" :disabled="isAddBtn" icon="el-icon-bottom" @click="excelBox = true">导入
|
|
|
+ <el-button type="success" size="small" :disabled="isAddBtn" icon="el-icon-bottom"
|
|
|
+ @click="excelDialogfun('名称')">名称导入
|
|
|
+ </el-button>
|
|
|
+ <el-button type="success" size="small" :disabled="isAddBtn" icon="el-icon-bottom"
|
|
|
+ @click="excelDialogfun('code')">Code导入
|
|
|
</el-button>
|
|
|
<el-button type="primary" icon="el-icon-printer" size="small"
|
|
|
@click="handlePrint">打印</el-button>
|
|
|
+ <el-button type="danger" plain size="small" @click="batchDelete" >一键删除</el-button>
|
|
|
</template>
|
|
|
<template slot="goodsId" slot-scope="{ row }">
|
|
|
<!--<el-select v-if="row.$cellEdit" v-model="row.goodsId" allow-create filterable default-first-option >-->
|
|
|
@@ -195,6 +200,7 @@
|
|
|
:close-on-click-modal="false" :destroy-on-close="true" :close-on-press-escape="false" v-dialog-drag>
|
|
|
<check-schedule :checkId="checkId" :batchNo="batchNo" @choceScheduleFun="choceScheduleFun"></check-schedule>
|
|
|
</el-dialog>
|
|
|
+
|
|
|
<el-dialog title="导入明细" append-to-body :visible.sync="excelBox" v-if="excelBox" width="555px"
|
|
|
:close-on-click-modal="false" v-dialog-drag>
|
|
|
<avue-form :option="excelOption" v-model="excelForm" table-loading="excelLoading" :upload-before="uploadBefore"
|
|
|
@@ -209,6 +215,7 @@
|
|
|
温馨提示 第一次导入时请先下载模板
|
|
|
</p>
|
|
|
</el-dialog>
|
|
|
+
|
|
|
</div>
|
|
|
|
|
|
<el-dialog title="选择商品" append-to-body class="el-dialogDeep" :visible.sync="dialogVisible" width="80%"
|
|
|
@@ -432,6 +439,7 @@ export default {
|
|
|
}
|
|
|
]
|
|
|
},
|
|
|
+ templateUrl:'/api/blade-sales-part/ship/export-item', // 模板url
|
|
|
form: {
|
|
|
orderItemsList: [],
|
|
|
paymentRecordsList: [],
|
|
|
@@ -652,8 +660,6 @@ export default {
|
|
|
border: true,
|
|
|
align: 'center',
|
|
|
index: true,
|
|
|
- showSummary: true,
|
|
|
-
|
|
|
addBtnText: "添加商品",
|
|
|
updateBtnText: '保存',
|
|
|
refreshBtn: false,
|
|
|
@@ -674,6 +680,7 @@ export default {
|
|
|
dialogWidth: "80%",
|
|
|
summaryText: "合计",
|
|
|
showSummary: true,
|
|
|
+ selection:true,
|
|
|
sumColumnList: [{
|
|
|
name: "goodsNum",
|
|
|
type: "sum"
|
|
|
@@ -888,6 +895,7 @@ export default {
|
|
|
}
|
|
|
]
|
|
|
},
|
|
|
+ selectionMultilist:[], // 多选数据
|
|
|
optionPaymentDetails: {},
|
|
|
optionPaymentDetailsBack: {
|
|
|
align: 'center',
|
|
|
@@ -2012,7 +2020,6 @@ export default {
|
|
|
type: "warning"
|
|
|
}).then(() => {
|
|
|
if (row.id) {
|
|
|
-
|
|
|
delOrderItem({ ids: row.id }).then(res => {
|
|
|
this.form.orderItemsList.splice(index, 1);
|
|
|
this.$message.success("操作成功!");
|
|
|
@@ -2024,6 +2031,41 @@ export default {
|
|
|
}
|
|
|
);
|
|
|
},
|
|
|
+ // 明细信息多选
|
|
|
+ selectionContacts(list){
|
|
|
+ this.selectionMultilist = list
|
|
|
+ },
|
|
|
+ // 一键删除
|
|
|
+ batchDelete(){
|
|
|
+ if (this.selectionMultilist.length == 0) {
|
|
|
+ return this.$message.warning('请选择要删除的数据')
|
|
|
+ }
|
|
|
+ this.$confirm("确定将选择数据删除?", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning"
|
|
|
+ }).then(()=>{
|
|
|
+ let multiList = this.selectionMultilist
|
|
|
+ let arr = this.form.orderItemsList
|
|
|
+ // 获取有id 的数据
|
|
|
+ const itemsWithId = multiList.filter(item => item.hasOwnProperty('id'));
|
|
|
+ let arrIds = itemsWithId.map(item=>item.id) // 获取id 数据
|
|
|
+ // 把选中的删除掉
|
|
|
+ multiList.forEach((item)=>{
|
|
|
+ for (let index in arr) {
|
|
|
+ if (JSON.stringify(item) == JSON.stringify(arr[index])) {
|
|
|
+ arr.splice(Number(index),1)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ // 有id 的处理
|
|
|
+ if(itemsWithId.length != 0) {
|
|
|
+ delOrderItem({ ids: arrIds.join(',') }).then(res => {
|
|
|
+ this.$message.success("操作成功!");
|
|
|
+ });
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
rowSave(form, done, loading) {
|
|
|
form.subTotalMoney = form.goodsNum * form.price
|
|
|
form.goodsName = form.$goodsId
|
|
|
@@ -2072,7 +2114,7 @@ export default {
|
|
|
},
|
|
|
derivation() {
|
|
|
window.open(
|
|
|
- `/api/blade-sales-part/ship/export-item?${this.website.tokenHeader
|
|
|
+ `${this.templateUrl}?${this.website.tokenHeader
|
|
|
}=${getToken()}`
|
|
|
);
|
|
|
},
|
|
|
@@ -2080,6 +2122,17 @@ export default {
|
|
|
done();
|
|
|
loading = true;
|
|
|
},
|
|
|
+ // 采购明细 导入按钮
|
|
|
+ excelDialogfun(name){
|
|
|
+ if (name == '名称') {
|
|
|
+ this.findObject(this.excelOption.column, "excelFile").action = '/api/blade-sales-part/ship/import-item'
|
|
|
+ this.templateUrl = '/api/blade-sales-part/ship/export-item'
|
|
|
+ }else if (name == 'code') {
|
|
|
+ this.findObject(this.excelOption.column, "excelFile").action = '/api/blade-sales-part/ship/import-item-code'
|
|
|
+ this.templateUrl = '/api/blade-sales-part/ship/export-item-code'
|
|
|
+ }
|
|
|
+ this.excelBox = true
|
|
|
+ },
|
|
|
//打印
|
|
|
handlePrint() {
|
|
|
this.switchDialog = !this.switchDialog;
|