Эх сурвалжийг харах

reactor:知识审批支持同意和不同意;

zhangchong 1 жил өмнө
parent
commit
e3f0e9268f

+ 1 - 9
src/components/OrderDetail/index.vue

@@ -398,7 +398,7 @@
 				<el-button type="primary" @click="onRecord" :loading="state.loading" v-if="state.ruleForm?.workflowId">流程明细</el-button>
 				<!-- 有流程信息就可以撤回 -->
 				<el-button type="primary" @click="onSpecialHandle" :loading="state.loading" v-if="state.ruleForm?.workflowId" v-auth="'business:order:teti'"
-					>撤 回(特提</el-button
+					>特 提</el-button
 				>
 				<!-- 办理中和会签中,可以督办 -->
 				<el-button
@@ -453,14 +453,6 @@
           >补 充</el-button
         >-->
 				<!--				<el-button type="primary" @click="onRevoke" :loading="state.loading">撤 销</el-button>-->
-				<!-- 工单未归档都可以撤回 -->
-				<!--				<el-button
-          type="primary"
-          @click="onSubmit('工单撤回')"
-          :loading="state.loading"
-          v-if="[0].includes(state.ruleForm.workflow?.status)"
-          >撤 回(特提)</el-button
-        >-->
 				<!-- 办理中和会签中并且应该自己办理 -->
 				<el-button
 					type="primary"

+ 32 - 6
src/components/ProcessAudit/index.vue

@@ -329,7 +329,7 @@
 											@input="computeTimeNext"
 											:min="1"
 											:max="99"
-                      disabled
+											disabled
 										></el-input-number>
 									</el-col>
 									<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" v-loading="state.loading">
@@ -347,7 +347,7 @@
 								</el-row>
 							</el-form-item>
 						</el-col>
-<!--						<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12">
+						<!--						<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12">
 							<el-form-item label="工单期满时间">
 								{{ state.ruleForm.endTime }}
 							</el-form-item>
@@ -536,7 +536,7 @@ const { userInfos } = storeToRefs(storesUserInfo); // 用户信息
 const showStepsArr = ['延期申请', '甄别申请', '工单重办']; // 显示步骤条的流程
 const handelArr = ['工单办理']; // 处于办理状态的流程 (如果是汇总节点 需要填写办理对象等  办理流程才有期满时间)
 const returnArr = ['工单退回', '甄别退回', '延期退回']; // 退回流程 (退回流程不需要展示其他 只需要填写意见和附件即可)
-const auditArr = ['甄别审批', '延期审批']; // 审批流程
+const auditArr = ['甄别审批', '延期审批', '知识审批']; // 审批流程 (审批流程需要选择是否通过和下一环节)
 
 const timeType = ref<EmptyArrayType>([]); // 延期申请单位
 const orderRedoReasonOptions = ref<EmptyArrayType>([]); // 重办理由
@@ -1114,7 +1114,7 @@ const onSubmit = (formEl: FormInstance | undefined) => {
 					case '工单退回':
 						orderPrevious({ ...submitObj, files: handleFiles.value })
 							.then(() => {
-								afterSubmit('orderProcessSuccess', true,'退回申请成功');
+								afterSubmit('orderProcessSuccess', true, '退回申请成功');
 							})
 							.catch(() => {
 								afterSubmit('orderProcessFailed');
@@ -1136,12 +1136,38 @@ const onSubmit = (formEl: FormInstance | undefined) => {
 						};
 						KnowledgeAdd(KnowledgeAddRequest)
 							.then(() => {
-								afterSubmit('orderProcessSuccess', true,'新增知识成功');
+								afterSubmit('orderProcessSuccess', true, '新增知识成功');
 							})
 							.catch(() => {
 								afterSubmit('orderProcessFailed');
 							});
 						break;
+					case '知识审批':
+						if (state.ruleForm.isPass) {
+							// 审批通过 下一步
+							workflowNext({ ...submitObj, files: handleFiles.value })
+								.then(() => {
+									afterSubmit('orderProcessSuccess', true);
+								})
+								.catch(() => {
+									afterSubmit('orderProcessFailed');
+								});
+						} else {
+							// 审批拒绝
+							const requestDiscernAudit = {
+								opinion: state.ruleForm.opinion,
+								workflowId: state.workflowId,
+								files: handleFiles.value,
+							};
+								workflowReject(requestDiscernAudit)
+								.then(() => {
+									afterSubmit('orderProcessSuccess', true);
+								})
+								.catch(() => {
+									afterSubmit('orderProcessFailed');
+								});
+						}
+						break;
 					case '更新新增知识':
 						const KnowledgeAddUpdateRequest = {
 							data: { ...state.orderDetail },
@@ -1175,7 +1201,7 @@ const onSubmit = (formEl: FormInstance | undefined) => {
 						};
 						KnowledgeDel(KnowledgeRemoveRequest)
 							.then(() => {
-								afterSubmit('orderProcessSuccess', true,'删除知识申请成功');
+								afterSubmit('orderProcessSuccess', true, '删除知识申请成功');
 							})
 							.catch(() => {
 								afterSubmit('orderProcessFailed');

+ 22 - 7
src/views/quality/done/components/Quality-inspection.vue

@@ -20,13 +20,23 @@
 						{{ state.orderDetail.fromPhone }}
 						<el-button
 							plain
-							title="录音文件"
+							title="工单录音文件"
+							v-if="state.ruleForm?.order?.recordingFileUrl"
 							size="small"
 							type="primary"
 							class="ml8"
-							@click="recordFile(state.orderDetail.callId)"
-							v-if="state.orderDetail.callId"
-							>录音文件</el-button
+							@click="recordFile(state.ruleForm?.order?.recordingFileUrl)"
+							>工单录音</el-button
+						>
+						<el-button
+							plain
+							title="回访录音文件"
+							v-if="state.ruleForm?.visit?.recordingFileUrl"
+							size="small"
+							type="primary"
+							class="ml8"
+							@click="recordFile(state.ruleForm?.visit?.recordingFileUrl)"
+							>回访录音</el-button
 						>
 					</el-form-item>
 				</el-col>
@@ -171,15 +181,19 @@
 			</span>
 		</template>
 	</el-dialog>
+	<!-- 播放录音 -->
+	<play-record ref="playRecordRef" />
 </template>
 <script setup lang="ts" name="qualityInspection">
-import { computed, reactive, ref, watch } from 'vue';
+import { computed, reactive, ref, watch, defineAsyncComponent } from 'vue';
 import { ElInput, ElMessage, ElMessageBox, FormInstance } from 'element-plus';
 import { formatDate, formatDuration } from '@/utils/formatTime';
 import Other from '@/utils/other';
 import { qualityUpdate, qualityDetail } from '@/api/quality';
 import { templateList } from '@/api/quality/template';
 
+// 引入组件
+const PlayRecord = defineAsyncComponent(() => import('@/views/tels/callLog/component/Play-record.vue')); // 播放录音
 // 定义子组件向父组件传值/事件
 const emit = defineEmits(['updateList']);
 const state = reactive<any>({
@@ -291,8 +305,9 @@ const closeItem = () => {
 	ruleItemFormRef.value?.resetFields();
 };
 // 查看录音文件
-const recordFile = (callId: string) => {
-	console.log(callId);
+const playRecordRef = ref<RefType>();
+const recordFile = (url: string) => {
+	playRecordRef.value.openDialog(url);
 };
 // 新增质检项内容
 const onAddItem = () => {

+ 0 - 1
src/views/system/workforce/components/Select-number.vue

@@ -11,7 +11,6 @@
 						value: 'id',
 					}"
 					placeholder="请选择班次"
-					clearable
 					class="w100"
 				/>
 			</el-form-item>

+ 2 - 2
src/views/system/workforce/scheduling.vue

@@ -70,10 +70,10 @@ const queryList = async () => {
 						<el-button
 							type="primary"
 							link
-							title={'点击修改' + scope.row.schedulingUserName + dayjs(month.value).format('YYYY-MM') + '-' + num + '排班'}
+							title={'点击修改' + scope.row?.schedulingUserName + dayjs(month.value).format('YYYY-MM') + '-' + num + '排班'}
 							onClick={() => changeScheduling(scope)}
 						>
-							{scope.row.schedulingTime === `${dayjs(month.value).format('YYYY-MM')}-${num}`
+							{scope.row?.schedulingTime === `${dayjs(month.value).format('YYYY-MM')}-${num}`
 								? `${scope.row[dayjs(month.value).format(`YYYY-MM-${num}`)]}`
 								: ''}
 						</el-button>