|
|
@@ -64,20 +64,6 @@
|
|
|
v-if="btnShow(row) && $hasPermission('eom:aftersalesdemand:submit')"
|
|
|
>提交</el-link
|
|
|
>
|
|
|
- <!-- <el-popconfirm
|
|
|
- v-if="row.demandStatus == 1"
|
|
|
- class="ele-action"
|
|
|
- title="确定要撤回此售后需求吗?"
|
|
|
- @confirm="handleCommand('handleRevoke', row)"
|
|
|
- >
|
|
|
- <template v-slot:reference>
|
|
|
- <el-link
|
|
|
- type="primary"
|
|
|
- :underline="false"
|
|
|
- >撤回</el-link
|
|
|
- >
|
|
|
- </template>
|
|
|
- </el-popconfirm> -->
|
|
|
<el-popconfirm
|
|
|
v-if="btnShow(row) && $hasPermission('eom:aftersalesdemand:close')"
|
|
|
class="ele-action"
|
|
|
@@ -89,20 +75,6 @@
|
|
|
</template>
|
|
|
</el-popconfirm>
|
|
|
|
|
|
- <!-- <el-dropdown
|
|
|
- @command="(command) => handleCommand(command, row)"
|
|
|
- v-if="row.demandStatus == 0"
|
|
|
- >
|
|
|
- <span class="el-dropdown-link">
|
|
|
- 操作菜单
|
|
|
- <i class="el-icon-arrow-down el-icon--right"></i>
|
|
|
- </span>
|
|
|
- <el-dropdown-menu slot="dropdown">
|
|
|
- <el-dropdown-item command="handleRevoke">撤回</el-dropdown-item>
|
|
|
- <el-dropdown-item command="handleAudit">提交</el-dropdown-item>
|
|
|
- </el-dropdown-menu>
|
|
|
- </el-dropdown> -->
|
|
|
-
|
|
|
<el-link
|
|
|
v-if="dispatchShow(row)"
|
|
|
type="primary"
|
|
|
@@ -120,64 +92,19 @@
|
|
|
:dialogTitle="addDialogTitle"
|
|
|
@refresh="reload"
|
|
|
/>
|
|
|
- <!-- 审核弹窗 -->
|
|
|
- <!-- <ele-modal
|
|
|
- :centered="true"
|
|
|
- :visible.sync="auditDialog"
|
|
|
- title="审核"
|
|
|
- :close-on-click-modal="false"
|
|
|
- width="25%"
|
|
|
- append-to-body
|
|
|
- @close="handleClose"
|
|
|
- >
|
|
|
- <el-form ref="form" :model="formData">
|
|
|
- <el-form-item
|
|
|
- prop="approvalResult"
|
|
|
- label="审核结果"
|
|
|
- :rules="{
|
|
|
- required: true,
|
|
|
- message: '请选择',
|
|
|
- trigger: 'change'
|
|
|
- }"
|
|
|
- >
|
|
|
- <el-select
|
|
|
- v-model="formData.approvalResult"
|
|
|
- placeholder="请选择"
|
|
|
- style="width: 100%"
|
|
|
- clearable
|
|
|
- >
|
|
|
- <el-option
|
|
|
- v-for="item in approvalResultOptions"
|
|
|
- :key="item.value"
|
|
|
- :label="item.label"
|
|
|
- :value="item.value"
|
|
|
- ></el-option>
|
|
|
- </el-select>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item
|
|
|
- prop="rejectCause"
|
|
|
- label="审核意见"
|
|
|
- :rules="{
|
|
|
- required: formData.approvalResult == 0,
|
|
|
- message: '请输入',
|
|
|
- trigger: 'change'
|
|
|
- }"
|
|
|
- >
|
|
|
- <el-input
|
|
|
- v-model="formData.rejectCause"
|
|
|
- placeholder="请输入"
|
|
|
- type="textarea"
|
|
|
- ></el-input>
|
|
|
- </el-form-item>
|
|
|
- </el-form>
|
|
|
- <div slot="footer" class="footer">
|
|
|
- <el-button type="primary" @click="handleSubmit">确认</el-button>
|
|
|
- <el-button @click="handleClose">取消</el-button>
|
|
|
- </div>
|
|
|
- </ele-modal> -->
|
|
|
+
|
|
|
<SubmitDialog ref="submitRef" @savExit="reload" />
|
|
|
-
|
|
|
<dispatchDialog ref="dispatchRef" @savExit="reload" />
|
|
|
+
|
|
|
+ <!-- 流程提交对话框 -->
|
|
|
+ <process-submit-dialog
|
|
|
+ :isNotNeedProcess="false"
|
|
|
+ :processSubmitDialogFlag.sync="processSubmitDialogFlag"
|
|
|
+ v-if="processSubmitDialogFlag"
|
|
|
+ ref="processSubmitDialogRef"
|
|
|
+ @reload="reload"
|
|
|
+ :callBack="processCallBack"
|
|
|
+ ></process-submit-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
@@ -197,24 +124,27 @@ import {
|
|
|
auditSalesDemand,
|
|
|
revokeSalesDemand,
|
|
|
closeDemand,
|
|
|
- getSalesDemandById
|
|
|
+ getSalesDemandById,
|
|
|
+ demandSubmit
|
|
|
} from '@/api/salesServiceManagement/index.js';
|
|
|
import search from './components/searchTable.vue';
|
|
|
import AddDialog from './components/addDialog.vue';
|
|
|
import { getByCode } from '@/api/system/dictionary-data';
|
|
|
import dictMixins from '@/mixins/dictMixins';
|
|
|
import SubmitDialog from './components/submitDialog.vue';
|
|
|
-
|
|
|
import dispatchDialog from './components/dispatchDialog.vue';
|
|
|
-
|
|
|
import { contactDetail } from '@/api/saleManage/contact';
|
|
|
+import processSubmitDialog from '@/BIZComponents/processSubmitDialog/processSubmitDialog.vue';
|
|
|
+import { getCurrentUser } from '@/utils/token-util';
|
|
|
+
|
|
|
export default {
|
|
|
mixins: [dictMixins],
|
|
|
components: {
|
|
|
search,
|
|
|
AddDialog,
|
|
|
SubmitDialog,
|
|
|
- dispatchDialog
|
|
|
+ dispatchDialog,
|
|
|
+ processSubmitDialog
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
@@ -351,8 +281,6 @@ export default {
|
|
|
infoData: {},
|
|
|
repairInfoLogs: [],
|
|
|
addDialogTitle: '新建售后需求',
|
|
|
- // auditDialog: false,
|
|
|
-
|
|
|
rowData: {},
|
|
|
formData: {
|
|
|
approvalResult: null,
|
|
|
@@ -375,22 +303,23 @@ export default {
|
|
|
associationType: '1'
|
|
|
},
|
|
|
kkform: {},
|
|
|
-
|
|
|
afterSalesTypeMap: {},
|
|
|
- afterSalesTypeList: []
|
|
|
+ afterSalesTypeList: [],
|
|
|
+ // 流程对话框相关
|
|
|
+ processSubmitDialogFlag: false,
|
|
|
+ processedData: null,
|
|
|
+ currentRow: null
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
|
btnShow() {
|
|
|
return (row) => {
|
|
|
- // let flag = row.demandStatus == 0;
|
|
|
return row.demandStatus == 0;
|
|
|
};
|
|
|
},
|
|
|
dispatchShow() {
|
|
|
return (row) => {
|
|
|
return !row.planStatus && row.afterSalesType !== 3;
|
|
|
- // console.log(row);
|
|
|
};
|
|
|
}
|
|
|
},
|
|
|
@@ -469,35 +398,76 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
handleAudit(row) {
|
|
|
- this.$refs.submitRef.open(row, 'list', '列表');
|
|
|
- // this.auditDialog = true;
|
|
|
- // this.rowData = row;
|
|
|
+ // 判断售后类型是否为3
|
|
|
+ if (row.afterSalesType === '3' || row.afterSalesType === 3) {
|
|
|
+ this.currentRow = row;
|
|
|
+ this.prepareProcessSubmit();
|
|
|
+ } else {
|
|
|
+ this.$refs.submitRef.open(row, 'list', '列表');
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 准备流程提交
|
|
|
+ async prepareProcessSubmit() {
|
|
|
+ try {
|
|
|
+ const detailRes = await getSalesDemandById(this.currentRow.id);
|
|
|
+ if (!detailRes) {
|
|
|
+ this.$message.error('获取详情失败');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ this.processedData = {
|
|
|
+ id: this.currentRow.id,
|
|
|
+ submitSource: 3 // 标识来自列表提交
|
|
|
+ };
|
|
|
+
|
|
|
+ this.processSubmitDialogFlag = true;
|
|
|
+ this.$nextTick(() => {
|
|
|
+ const processParams = {
|
|
|
+ businessKey: 'after_sale_quality_issues_feedback',
|
|
|
+ formCreateUserId: getCurrentUser().id
|
|
|
+ };
|
|
|
+ this.$refs.processSubmitDialogRef.init(processParams);
|
|
|
+ });
|
|
|
+ } catch (error) {
|
|
|
+ this.$message.error('准备提交失败:' + (error.message || '未知错误'));
|
|
|
+ }
|
|
|
},
|
|
|
- // handleClose() {
|
|
|
- // this.auditDialog = false;
|
|
|
- // },
|
|
|
- // async handleSubmit() {
|
|
|
- // this.$refs.form.validate(async (valid) => {
|
|
|
- // if (valid) {
|
|
|
- // const data = this.$store.state.user.info;
|
|
|
+ // 流程对话框的回调函数
|
|
|
+ async processCallBack() {
|
|
|
+ try {
|
|
|
+ if (!this.processedData || !this.currentRow) {
|
|
|
+ this.$message.error('未获取到提交数据');
|
|
|
+ return 1;
|
|
|
+ }
|
|
|
+
|
|
|
+ // 调用提交接口
|
|
|
+ const businessId = await demandSubmit(this.processedData);
|
|
|
+ if (!businessId) {
|
|
|
+ this.$message.error('提交失败,未获取到业务ID');
|
|
|
+ return 1;
|
|
|
+ }
|
|
|
+
|
|
|
+ // 获取详情
|
|
|
+ const detailRes = await getSalesDemandById(businessId);
|
|
|
+ if (!detailRes) {
|
|
|
+ this.$message.error('获取详情失败');
|
|
|
+ return 1;
|
|
|
+ }
|
|
|
+
|
|
|
+ // 更新流程对话框的表单数据
|
|
|
+ this.$refs.processSubmitDialogRef.form.businessId = businessId;
|
|
|
+ this.$refs.processSubmitDialogRef.form.variables = {
|
|
|
+ businessCode: detailRes.code,
|
|
|
+ businessName: detailRes.name,
|
|
|
+ businessType: '质量问题反馈'
|
|
|
+ };
|
|
|
|
|
|
- // let pdata = {
|
|
|
- // id: this.rowData.id,
|
|
|
- // approvalResult: this.formData.approvalResult,
|
|
|
- // rejectCause: this.formData.rejectCause,
|
|
|
- // approvalUserId: data.userId,
|
|
|
- // approvalUserName: data.name
|
|
|
- // };
|
|
|
- // const res = await auditSalesDemand(pdata);
|
|
|
- // if (res) {
|
|
|
- // this.$message.success('审核成功!');
|
|
|
- // this.auditDialog = false;
|
|
|
- // this.reload();
|
|
|
- // }
|
|
|
- // }
|
|
|
- // });
|
|
|
- // },
|
|
|
- //
|
|
|
+ return 0; // 返回0表示成功
|
|
|
+ } catch (error) {
|
|
|
+ this.$message.error('提交失败:' + (error.message || '未知错误'));
|
|
|
+ return 1; // 返回1表示失败
|
|
|
+ }
|
|
|
+ },
|
|
|
async closeRevoke(row) {
|
|
|
const res = await closeDemand(row.id);
|
|
|
if (!res) return;
|
|
|
@@ -511,7 +481,6 @@ export default {
|
|
|
this.reload();
|
|
|
},
|
|
|
handleCommand(command, row) {
|
|
|
- console.log(command,row)
|
|
|
if (command === 'handleRevoke') {
|
|
|
this.handleRevoke(row);
|
|
|
}
|
|
|
@@ -523,7 +492,6 @@ export default {
|
|
|
const res = await getSalesDemandById(id);
|
|
|
|
|
|
this.dispatchForm = res;
|
|
|
- // detailForm = res;
|
|
|
let productDetail = res.productDetail ? res.productDetail : [];
|
|
|
let faultLevel = res.faultLevel ? String(res.faultLevel) : '';
|
|
|
let faultDetailList = res.faultDetailList ? res.faultDetailList : [];
|
|
|
@@ -544,9 +512,6 @@ export default {
|
|
|
? String(res.associationType)
|
|
|
: '1';
|
|
|
this.$set(this.dispatchForm, 'faultDetailList', faultDetailList);
|
|
|
- // if (faultDetailList.length > 0) {
|
|
|
- // this.isOrder = true;
|
|
|
- // }
|
|
|
},
|
|
|
|
|
|
async dispatchFn(row) {
|
|
|
@@ -573,23 +538,17 @@ export default {
|
|
|
: '1';
|
|
|
this.$set(this.dispatchForm, 'faultDetailList', faultDetailList);
|
|
|
|
|
|
- // await this.dispatchFormFn(row.id);
|
|
|
let pData = await this.handleParameter();
|
|
|
|
|
|
if (!pData) {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
- console.log(pData);
|
|
|
-
|
|
|
this.$refs.dispatchRef.open(pData, 'dispatch');
|
|
|
-
|
|
|
- // console.log(this.$refs.addDialogRef);
|
|
|
},
|
|
|
savExit() {},
|
|
|
async contactDetail(id, type) {
|
|
|
if (!id) {
|
|
|
- // this.contractInfo = {};
|
|
|
return;
|
|
|
}
|
|
|
let { base, other, linkList } = await contactDetail(id);
|
|
|
@@ -610,7 +569,6 @@ export default {
|
|
|
return false;
|
|
|
}
|
|
|
try {
|
|
|
- // let valid = await this.$refs.infoRef.getValidate();
|
|
|
let expectedTime = data.expectedTime
|
|
|
? this.formatDate(data.expectedTime)
|
|
|
: '';
|
|
|
@@ -632,7 +590,6 @@ export default {
|
|
|
contactInfoVOS: data.contactInfoVOS,
|
|
|
associationType: data.associationType
|
|
|
};
|
|
|
- // 如果选的销售订单并且 没有售后对象数据
|
|
|
if (pData.associationType == '2' && pData.productDetail.length == 0) {
|
|
|
delete pData.productDetail;
|
|
|
pData.faultDetailList = data.faultDetailList;
|
|
|
@@ -644,7 +601,6 @@ export default {
|
|
|
return pData;
|
|
|
} catch (err) {}
|
|
|
},
|
|
|
- // 标准时间函数 ***
|
|
|
formatDate(dateString) {
|
|
|
const isStandardFormat = /^\d{4}-\d{1,2}-\d{1,2}$/.test(dateString);
|
|
|
if (isStandardFormat) {
|
|
|
@@ -660,7 +616,7 @@ export default {
|
|
|
const day = String(date.getDate()).padStart(2, '0');
|
|
|
return `${year}-${month}-${day}`;
|
|
|
} catch (error) {
|
|
|
- return dateString; // 转换失败时返回原始字符串
|
|
|
+ return dateString;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -685,4 +641,4 @@ export default {
|
|
|
padding: 0 5px 0 10px;
|
|
|
}
|
|
|
}
|
|
|
-</style>
|
|
|
+</style>
|