|
|
@@ -99,7 +99,7 @@
|
|
|
<el-form :inline="true" @submit.native.prevent>
|
|
|
<el-form-item>
|
|
|
<el-button icon="el-icon-check" type="goon" size="mini" :loading="buttonLoading1"
|
|
|
- v-privilege="activeMenu + 'audit'" @click="audit">审批通过</el-button>
|
|
|
+ v-privilege="activeMenu + 'audit'" @click="auditEnd">审批通过</el-button>
|
|
|
<el-button icon="el-icon-edit" type="goon" size="mini" v-privilege="activeMenu + 'editEntrustType'"
|
|
|
@click="editEntrustType">修改委托类型</el-button>
|
|
|
<!-- <el-button icon="el-icon-check" type="goon" size="mini" :loading='buttonLoading1' v-privilege="activeMenu + 'audit'" @click="audit">审批</el-button> -->
|
|
|
@@ -271,7 +271,7 @@
|
|
|
<el-form :inline="true" @submit.native.prevent>
|
|
|
<el-form-item>
|
|
|
<!-- <el-button icon="el-icon-check" type="danger" size="mini" :loading='buttonLoadingBack' @click="rollback">撤回审核</el-button> -->
|
|
|
- <el-button icon="el-icon-check" type="goon" size="mini" :loading="buttonLoading1" @click="audit1"
|
|
|
+ <el-button icon="el-icon-check" type="goon" size="mini" :loading="buttonLoading1" @click="restartSendMsgSourceByResult"
|
|
|
v-privilege="activeMenu + 'check'">
|
|
|
再次发送电文
|
|
|
</el-button>
|
|
|
@@ -287,6 +287,8 @@
|
|
|
<el-table-column type="index" label="NO" fixed="left" align="center" width="45"></el-table-column>
|
|
|
<el-table-column type="selection" width="45" fixed="left" align="center"></el-table-column>
|
|
|
<!-- <el-table-column sortable show-overflow-tooltip align="center" width="135" prop="CONTRACT_NO" label="合同号"></el-table-column>-->
|
|
|
+ <el-table-column sortable show-overflow-tooltip align="center" min-width="100" prop="releaseValid"
|
|
|
+ label="状态"></el-table-column>
|
|
|
<el-table-column sortable show-overflow-tooltip align="center" min-width="120" prop="RECEIVED_DATE"
|
|
|
label="收样日期"></el-table-column>
|
|
|
<el-table-column sortable show-overflow-tooltip align="center" width="80" prop="ENTR_TYPE_NAME"
|
|
|
@@ -862,6 +864,8 @@ export default {
|
|
|
this.search.matClassNo = "";
|
|
|
this.search.matNo = "";
|
|
|
this.search.sampleNo = "";
|
|
|
+ this.search.carNo = "";
|
|
|
+
|
|
|
let timestamp = new Date().getTime() - 7 * 24 * 60 * 60 * 1000; // 默认前一周
|
|
|
|
|
|
this.search.times = [
|
|
|
@@ -875,6 +879,100 @@ export default {
|
|
|
this.searchData();
|
|
|
},
|
|
|
refresh() { },
|
|
|
+ auditEnd() {
|
|
|
+ // 原有逻辑:勾选数据判断,无数据直接返回
|
|
|
+ if (this.multipleSelection1.length < 1) {
|
|
|
+ this.$message.warning("请先勾选要审批的数据");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ // 原有逻辑:开启按钮加载状态
|
|
|
+ this.buttonLoading1 = true;
|
|
|
+
|
|
|
+ this.axios.post(
|
|
|
+ "pass/testManagement/v1/fullProcess/sampleBatchFullProcess",
|
|
|
+ this.multipleSelection1,
|
|
|
+ { individualType: "json" }
|
|
|
+ ).then((res) => {
|
|
|
+ console.log(res, 'res');
|
|
|
+ // 关键改造1:获取后端返回的核心业务数据(res.data,兼容为空的情况)
|
|
|
+ const result = res
|
|
|
+
|
|
|
+ // 关键改造2:严谨判断操作成功(适配后端status: "succeed",补充非空判断)
|
|
|
+ if (result.status === 'succeed' && result.succeed) {
|
|
|
+ // 关键改造3:替换可选链?. 为 && 层层判断(Vue2兼容写法,避免报错)
|
|
|
+ const successCount = (result.data && result.data.successCount) || 0;
|
|
|
+ const failCount = (result.data && result.data.failCount) || 0;
|
|
|
+
|
|
|
+ if (successCount > 0 && failCount > 0) {
|
|
|
+ this.$message.warning(`审批部分成功:成功${successCount}条,失败${failCount}条,请查看详情`);
|
|
|
+ } else {
|
|
|
+ // 全成功场景,原有成功提示
|
|
|
+ this.$message.success("审批成功");
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ // 关键改造4:优化失败信息提取,补充默认值
|
|
|
+ const errorMsg = result.message || result.resultMessage || "审批失败,请重试";
|
|
|
+ this.$message.error(errorMsg);
|
|
|
+ }
|
|
|
+ }).catch((err) => {
|
|
|
+ // 关键改造5:完善异常捕获,避免空错误信息
|
|
|
+ console.error("审批请求异常:", err);
|
|
|
+ const errMsg = err.message || "网络异常或服务器内部错误,请联系管理员";
|
|
|
+ this.$message.error(errMsg);
|
|
|
+ }).finally(() => {
|
|
|
+ // 原有逻辑:关闭加载状态,刷新列表
|
|
|
+ this.buttonLoading1 = false;
|
|
|
+ this.searchData();
|
|
|
+ });
|
|
|
+ },
|
|
|
+ restartSendMsgSourceByResult() {
|
|
|
+ // 原有逻辑:勾选数据判断,无数据直接返回
|
|
|
+ if (this.multipleSelection2.length < 1) {
|
|
|
+ this.$message.warning("请先勾选要发送的数据");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ // 原有逻辑:开启按钮加载状态
|
|
|
+ this.buttonLoading1 = true;
|
|
|
+
|
|
|
+ this.axios.post(
|
|
|
+ "pass/testManagement/v1/fullProcess/restartSendMsgSourceByResult",
|
|
|
+ this.multipleSelection2,
|
|
|
+ { individualType: "json" }
|
|
|
+ ).then((res) => {
|
|
|
+ console.log(res, 'res');
|
|
|
+ // ========== 关键改造1:获取后端返回的核心业务数据(res.data,兼容为空) ==========
|
|
|
+ const result = res
|
|
|
+
|
|
|
+ // ========== 关键改造2:严谨判断操作成功(适配后端status: "succeed",补充双字段校验) ==========
|
|
|
+ if (result.status === 'succeed' && result.succeed) {
|
|
|
+ // ========== 关键改造3:处理部分成功场景(Vue2兼容写法,无可选链) ==========
|
|
|
+ const successCount = (result.data && result.data.successCount) || 0;
|
|
|
+ const failCount = (result.data && result.data.failCount) || 0;
|
|
|
+
|
|
|
+ if (successCount > 0 && failCount > 0) {
|
|
|
+ this.$message.warning(`电文部分发送成功:成功${successCount}条,失败${failCount}条,请查看详情`);
|
|
|
+ } else {
|
|
|
+ // ========== 关键改造4:修改提示文案,贴合“发送电文”业务(而非“审批成功”) ==========
|
|
|
+ this.$message.success("电文发送成功");
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ // ========== 关键改造5:优化失败信息提取,补充默认值,贴合发送场景 ==========
|
|
|
+ const errorMsg = result.message || result.resultMessage || "电文发送失败,请重试";
|
|
|
+ this.$message.error(errorMsg);
|
|
|
+ }
|
|
|
+ }).catch((err) => {
|
|
|
+ // ========== 关键改造6:完善异常捕获,避免空错误信息 ==========
|
|
|
+ console.error("电文发送请求异常:", err);
|
|
|
+ const errMsg = err.message || "网络异常或服务器内部错误,请联系管理员";
|
|
|
+ this.$message.error(errMsg);
|
|
|
+ }).finally(() => {
|
|
|
+ // 原有逻辑:关闭加载状态,刷新列表
|
|
|
+ this.buttonLoading1 = false;
|
|
|
+ this.searchData();
|
|
|
+ });
|
|
|
+},
|
|
|
// 审批通过
|
|
|
audit() {
|
|
|
if (this.multipleSelection1.length < 1) {
|
|
|
@@ -1293,6 +1391,7 @@ export default {
|
|
|
deptNo: this.search.deptNo,
|
|
|
sectionNo: this.search.sectionNo,
|
|
|
sampleNo: this.search.sampleNo,
|
|
|
+ carNo:this.search.carNo
|
|
|
},
|
|
|
carNo: this.search.carNo,
|
|
|
list: [4],
|
|
|
@@ -1341,6 +1440,7 @@ export default {
|
|
|
deptNo: this.search.deptNo,
|
|
|
sectionNo: this.search.sectionNo,
|
|
|
sampleNo: this.search.sampleNo,
|
|
|
+ carNo:this.search.carNo
|
|
|
},
|
|
|
carNo: this.search.carNo,
|
|
|
list: [5],
|
|
|
@@ -1389,7 +1489,9 @@ export default {
|
|
|
deptNo: this.search.deptNo,
|
|
|
sectionNo: this.search.sectionNo,
|
|
|
sampleNo: this.search.sampleNo,
|
|
|
+ carNo:this.search.carNo
|
|
|
},
|
|
|
+ carNo:this.search.carNo,
|
|
|
list: [4],
|
|
|
startTime: startTime,
|
|
|
endTime: endTime,
|
|
|
@@ -1473,7 +1575,10 @@ export default {
|
|
|
validFlag: "1",
|
|
|
deptNo: this.search.deptNo,
|
|
|
sectionNo: this.search.sectionNo,
|
|
|
+ sampleNo: this.search.sampleNo,
|
|
|
+ carNo:this.search.carNo
|
|
|
},
|
|
|
+ carNo:this.search.carNo,
|
|
|
list: [5],
|
|
|
startTime: startTime,
|
|
|
endTime: endTime,
|