|
@@ -28,22 +28,12 @@
|
|
|
height="350"
|
|
height="350"
|
|
|
full-height="calc(100vh - 76px)"
|
|
full-height="calc(100vh - 76px)"
|
|
|
>
|
|
>
|
|
|
- <template v-slot:orderNo="scope">
|
|
|
|
|
- <el-form-item :prop="'datasource.' + scope.$index + '.orderNo'">
|
|
|
|
|
- <el-input v-model="scope.row.orderNo" @click.native="openOrderDialog(scope.row, scope.$index)"></el-input>
|
|
|
|
|
- <!-- <el-select
|
|
|
|
|
- v-model="scope.row.batchStockId"
|
|
|
|
|
- placeholder="请选择"
|
|
|
|
|
- @change="batchNoChange(scope.$index, scope.row)"
|
|
|
|
|
|
|
+ <template v-slot:saleOrderNos="scope">
|
|
|
|
|
+ <el-form-item
|
|
|
|
|
+ :prop="'datasource.' + scope.$index + '.saleOrderNos'"
|
|
|
|
|
+ :rules="[{ required: true, message: '请选择订单', trigger: ['blur'] }]"
|
|
|
>
|
|
>
|
|
|
- <el-option
|
|
|
|
|
- v-for="item in scope.row.batchNoList || []"
|
|
|
|
|
- :key="item.id"
|
|
|
|
|
- :label="item.batchNo"
|
|
|
|
|
- :value="item.id"
|
|
|
|
|
- >
|
|
|
|
|
- </el-option>
|
|
|
|
|
- </el-select> -->
|
|
|
|
|
|
|
+ <el-input v-model="scope.row.saleOrderNos" @click.native="openOrderDialog(scope.row, scope.$index)"></el-input>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
</template>
|
|
</template>
|
|
|
</ele-pro-table>
|
|
</ele-pro-table>
|
|
@@ -72,11 +62,7 @@
|
|
|
|
|
|
|
|
import saleForm from './saleForm.vue';
|
|
import saleForm from './saleForm.vue';
|
|
|
import {
|
|
import {
|
|
|
- getStatementRecordListAPI,
|
|
|
|
|
- infoAccountStatementAPI,
|
|
|
|
|
- createAccountStatementAPI,
|
|
|
|
|
- updateAccountStatementAPI,
|
|
|
|
|
- accountstatementInfoAPI
|
|
|
|
|
|
|
+ batchGenerateStatementAPI
|
|
|
} from '@/api/saleManage/accountstatement';
|
|
} from '@/api/saleManage/accountstatement';
|
|
|
import processSubmitDialog from '@/BIZComponents/processSubmitDialog/processSubmitDialog.vue';
|
|
import processSubmitDialog from '@/BIZComponents/processSubmitDialog/processSubmitDialog.vue';
|
|
|
import OrderListDialog from './orderListDialog.vue';
|
|
import OrderListDialog from './orderListDialog.vue';
|
|
@@ -171,9 +157,9 @@
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
minWidth: 140,
|
|
minWidth: 140,
|
|
|
- prop: 'orderNo',
|
|
|
|
|
|
|
+ prop: 'saleOrderNos',
|
|
|
label: '销售订单号',
|
|
label: '销售订单号',
|
|
|
- slot: 'orderNo',
|
|
|
|
|
|
|
+ slot: 'saleOrderNos',
|
|
|
align: 'center',
|
|
align: 'center',
|
|
|
showOverflowTooltip: true
|
|
showOverflowTooltip: true
|
|
|
}
|
|
}
|
|
@@ -185,17 +171,17 @@
|
|
|
open(dialogType, row) {
|
|
open(dialogType, row) {
|
|
|
this.dialogType = dialogType;
|
|
this.dialogType = dialogType;
|
|
|
console.log('row~~~', row);
|
|
console.log('row~~~', row);
|
|
|
- this.form.datasource = row || [];
|
|
|
|
|
|
|
+ this.form.datasource = JSON.parse(JSON.stringify(row)) || [];
|
|
|
},
|
|
},
|
|
|
//打开订单弹窗
|
|
//打开订单弹窗
|
|
|
openOrderDialog(row, index) {
|
|
openOrderDialog(row, index) {
|
|
|
- let item = { id: row.orderId };
|
|
|
|
|
- this.$refs.orderListDialogRef.open(item, index);
|
|
|
|
|
|
|
+ // let item = { id: row.orderId };
|
|
|
|
|
+ this.$refs.orderListDialogRef.open(row, index);
|
|
|
},
|
|
},
|
|
|
//选择订单信息回调
|
|
//选择订单信息回调
|
|
|
getOrderInfo(arr, index) {
|
|
getOrderInfo(arr, index) {
|
|
|
console.log('arr~~~', arr, index, this.form.datasource[index]);
|
|
console.log('arr~~~', arr, index, this.form.datasource[index]);
|
|
|
- this.form.datasource[index].orderNo = arr.map(item => item.orderNo).join(',');
|
|
|
|
|
|
|
+ this.form.datasource[index].saleOrderNos = arr.map(item => item.orderNo).join(',');
|
|
|
// this.dataForm.sourceType = 3;
|
|
// this.dataForm.sourceType = 3;
|
|
|
// let params = Object.assign({}, this.dataForm, {
|
|
// let params = Object.assign({}, this.dataForm, {
|
|
|
// orderId: obj.id,
|
|
// orderId: obj.id,
|
|
@@ -211,6 +197,8 @@
|
|
|
|
|
|
|
|
//关闭弹窗
|
|
//关闭弹窗
|
|
|
cancel() {
|
|
cancel() {
|
|
|
|
|
+ // this.form.datasource = [];
|
|
|
|
|
+ this.$set(this.form, 'datasource', []);
|
|
|
this.$emit('update:generateStatementFlag', false);
|
|
this.$emit('update:generateStatementFlag', false);
|
|
|
},
|
|
},
|
|
|
|
|
|
|
@@ -218,58 +206,29 @@
|
|
|
async save(is) {
|
|
async save(is) {
|
|
|
if (!this.form.datasource.length)
|
|
if (!this.form.datasource.length)
|
|
|
return this.$message.warning('暂无对账信息');
|
|
return this.$message.warning('暂无对账信息');
|
|
|
- let api =
|
|
|
|
|
- this.dialogType == 'add'
|
|
|
|
|
- ? createAccountStatementAPI
|
|
|
|
|
- : updateAccountStatementAPI;
|
|
|
|
|
- let params = {
|
|
|
|
|
- ...this.dataForm,
|
|
|
|
|
- orderList: this.form.datasource,
|
|
|
|
|
- };
|
|
|
|
|
- console.log('params~~~', params);
|
|
|
|
|
- this.saveLoading = true;
|
|
|
|
|
- try {
|
|
|
|
|
- let data = await api(params);
|
|
|
|
|
- this.saveLoading = false;
|
|
|
|
|
- if (is == 'sub') {
|
|
|
|
|
- await this.submitApprove(data);
|
|
|
|
|
- return;
|
|
|
|
|
- // await submitAccountStatementApproveAPI({
|
|
|
|
|
- // businessId: data,
|
|
|
|
|
- // type: this.dataForm.type
|
|
|
|
|
- // });
|
|
|
|
|
- }
|
|
|
|
|
- this.$message.success('操作成功');
|
|
|
|
|
- this.reload();
|
|
|
|
|
- } catch (error) {
|
|
|
|
|
- this.saveLoading = false;
|
|
|
|
|
- }
|
|
|
|
|
- this.$message.success('操作成功');
|
|
|
|
|
- this.reload();
|
|
|
|
|
- },
|
|
|
|
|
- async submitApprove(res) {
|
|
|
|
|
- let data = await accountstatementInfoAPI(res);
|
|
|
|
|
- this.processSubmitDialogFlag = true;
|
|
|
|
|
- this.$nextTick(() => {
|
|
|
|
|
- let params = {
|
|
|
|
|
- businessId: res,
|
|
|
|
|
- businessKey: 'sales_account_statement_approve',
|
|
|
|
|
- formCreateUserId: data.createUserId,
|
|
|
|
|
- variables: {
|
|
|
|
|
- type: data.type,
|
|
|
|
|
- businessCode: data.statementNo,
|
|
|
|
|
- businessName: data.contactName,
|
|
|
|
|
- businessType: '对账单'
|
|
|
|
|
|
|
+
|
|
|
|
|
+ this.$refs.form.validate(async(valid, obj) => {
|
|
|
|
|
+ if (valid) {
|
|
|
|
|
+ let params = this.form.datasource.map(item => {
|
|
|
|
|
+ return {
|
|
|
|
|
+ allotId: item.id,
|
|
|
|
|
+ saleOrderNos: item.saleOrderNos,
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ console.log('params~~~', params);
|
|
|
|
|
+ this.saveLoading = true;
|
|
|
|
|
+ try {
|
|
|
|
|
+ await batchGenerateStatementAPI(params);
|
|
|
|
|
+ this.saveLoading = false;
|
|
|
|
|
+ this.$message.success('操作成功');
|
|
|
|
|
+ this.reload();
|
|
|
|
|
+ } catch (error) {
|
|
|
|
|
+ this.saveLoading = false;
|
|
|
}
|
|
}
|
|
|
- // callBackMethodType : '1',
|
|
|
|
|
- // callBackMethod : 'proTargetPlanApproveApiImpl.updatePlanApprovalStatus',
|
|
|
|
|
- // pcHandle : '/bpm/handleTask/components/project-manage/plan-manage/submit.vue',
|
|
|
|
|
- // pcView : '/bpm/handleTask/components/project-manage/plan-manage/detailDialog.vue',
|
|
|
|
|
- // miniHandle : '',
|
|
|
|
|
- // miniView : '',
|
|
|
|
|
- };
|
|
|
|
|
- this.$refs.processSubmitDialogRef.init(params);
|
|
|
|
|
|
|
+ }
|
|
|
});
|
|
});
|
|
|
|
|
+ // this.$message.success('操作成功');
|
|
|
|
|
+ // this.reload();
|
|
|
},
|
|
},
|
|
|
reload() {
|
|
reload() {
|
|
|
this.cancel();
|
|
this.cancel();
|