|
@@ -0,0 +1,271 @@
|
|
|
+<template>
|
|
|
+ <view class="my-page">
|
|
|
+ <scroll-view :scroll-top="scrollTop" scroll-y="true" class="scroll-Y">
|
|
|
+ <view class="my-page-main">
|
|
|
+ <RadiusCell :title="title" @click="showPopup1 = true"></RadiusCell>
|
|
|
+ <RadiusCell title="SOP项目计划变更说明" @click="showPopup2 = true"></RadiusCell>
|
|
|
+ <view class="my-card">
|
|
|
+ <u-form :model="formData" ref="formRef" :border-bottom="false" label-position="top">
|
|
|
+ <template v-if="!IS_NEW_MODE">
|
|
|
+ <u-form-item label="报备申请人"> {{ sopInfo.createRealName }}</u-form-item>
|
|
|
+ <u-form-item label="报备申请时间">
|
|
|
+ {{ sopInfo.createTime | timeFormat }}
|
|
|
+ </u-form-item>
|
|
|
+ </template>
|
|
|
+
|
|
|
+ <u-form-item label="变更类型" requiredMark>
|
|
|
+ <view style="padding-top: 3px">
|
|
|
+ <my-select v-model="formData.type" :disabled="readonly" :list="dictToOptionList(PLAN_CHANGE_TYPE)"></my-select>
|
|
|
+ <div class="sub-title gray">
|
|
|
+ <p>1.关键信息及计划变更:项目关键信息里填写的项目关键信息或时间计划内容调整;</p>
|
|
|
+ <p>2.项目取消:若项目取消,则只需填写变更原因后提交。</p>
|
|
|
+ </div>
|
|
|
+ </view>
|
|
|
+ </u-form-item>
|
|
|
+
|
|
|
+ <u-form-item label="变更原因" prop="reason">
|
|
|
+ <u-input :disabled="readonly" v-model="formData.reason" placeholder="50字以内" :maxlength="50"></u-input>
|
|
|
+ </u-form-item>
|
|
|
+
|
|
|
+ <u-form-item label="项目信息及计划变更明细" prop="contentJson" requiredMark>
|
|
|
+ <dynamic-table ref="dTable" v-model="formData.contentJson" :columns="columns" :readonly="readonly"></dynamic-table>
|
|
|
+ </u-form-item>
|
|
|
+
|
|
|
+ <template v-if="!IS_NEW_MODE">
|
|
|
+ <view class="form-group-title">变更处理结果</view>
|
|
|
+ <u-form-item label="处理结果">
|
|
|
+ <my-select v-model="formData.projectExchangeApprove" :list="approveList"></my-select>
|
|
|
+ </u-form-item>
|
|
|
+
|
|
|
+ <u-form-item label="变更备注" prop="remark">
|
|
|
+ <u-input type="textarea" v-model="formData.remark"></u-input>
|
|
|
+ </u-form-item>
|
|
|
+ </template>
|
|
|
+ </u-form>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view class="my-page-footer">
|
|
|
+ <u-row gutter="16">
|
|
|
+ <u-col :span="6"> <u-button type="default" @click="cancelHandle">取消</u-button> </u-col>
|
|
|
+ <u-col :span="6"><u-button type="primary" @click="submitHandle">保存</u-button></u-col>
|
|
|
+ </u-row>
|
|
|
+ </view>
|
|
|
+ </scroll-view>
|
|
|
+
|
|
|
+ <u-popup v-model="showPopup2" mode="bottom" :mask-close-able="false" :closeable="true" :border-radius="28">
|
|
|
+ <view class="popup-box1">
|
|
|
+ <view class="title">{{ title }}</view>
|
|
|
+ <view class="content">
|
|
|
+ <view
|
|
|
+ >SOP项目计划需要变更时,可手动发起一个或多个申请,质控专员审核后,在SOP流程中进行计划变更调整,完成变更后,申请流程结束并通知到发起申请人。</view
|
|
|
+ >
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </u-popup>
|
|
|
+
|
|
|
+ <u-popup v-model="showPopup1" mode="bottom" :mask-close-able="false" :closeable="true" :border-radius="28">
|
|
|
+ <view class="popup-box2">
|
|
|
+ <view class="title">SOP项目计划变更说明</view>
|
|
|
+ <view class="content">
|
|
|
+ <view class="item">项目单号:{{ sopInfo.crmNo }}</view>
|
|
|
+ <view class="item">项目名称:{{ sopInfo.crmName }}</view>
|
|
|
+ <view class="item">派单时间:{{ sopInfo.crmBeginTime }}</view>
|
|
|
+ <view class="item">客户经理:{{ sopInfo.customManagerName }}</view>
|
|
|
+ <view class="item">客户类型:{{ CUSTOMER_TYPE[sopInfo.customType] }}</view>
|
|
|
+ <view class="item">客户名称:{{ sopInfo.customName }}</view>
|
|
|
+ <view class="item">考试时间:{{ sopInfo.examStartTime + ' 至 ' + sopInfo.examEndTime }}</view>
|
|
|
+ <view class="item">实施产品:{{ sopInfo.productName }}</view>
|
|
|
+ <view class="item">服务单元:{{ sopInfo.serviceUnitName }}</view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </u-popup>
|
|
|
+
|
|
|
+ <u-toast ref="uToast" />
|
|
|
+ </view>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+ import { createPlanChange, approvePlanChange, planChangeDetail } from '@/api/sop'
|
|
|
+ import { objAssign, dictToOptionList } from '@/utils/utils'
|
|
|
+ import { omit } from 'lodash'
|
|
|
+ import { CUSTOMER_TYPE, PLAN_CHANGE_TYPE } from '@/utils/constants'
|
|
|
+ import RadiusCell from '@/components/radius-cell.vue'
|
|
|
+ import MySelect from '@/components/my-select.vue'
|
|
|
+ import DynamicTable from '@/components/dynamic-table.vue'
|
|
|
+
|
|
|
+ export default {
|
|
|
+ name: 'PlanChangeDetail',
|
|
|
+ components: { RadiusCell, MySelect, DynamicTable },
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ sopInfo: {},
|
|
|
+ CUSTOMER_TYPE,
|
|
|
+ PLAN_CHANGE_TYPE,
|
|
|
+ formData: {
|
|
|
+ serviceId: '',
|
|
|
+ sopNo: '',
|
|
|
+ crmNo: '',
|
|
|
+ type: 'PLAN',
|
|
|
+ flowDeploymentId: '',
|
|
|
+ reason: '',
|
|
|
+ contentJson: [],
|
|
|
+ projectExchangeApprove: 'FINISH',
|
|
|
+ remark: ''
|
|
|
+ },
|
|
|
+ approveList: [
|
|
|
+ {
|
|
|
+ label: '已完成',
|
|
|
+ value: 'FINISH'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '经沟通,取消变更(原因请填写变更备注)',
|
|
|
+ value: 'NOT_UPDATE'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '经沟通,部分变更(详情请填写变更备注)',
|
|
|
+ value: 'PARTIAL_UPDATE'
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ columns: [
|
|
|
+ {
|
|
|
+ colKey: 'before',
|
|
|
+ title: '变更字段(全称)',
|
|
|
+ comp: {
|
|
|
+ type: 'text',
|
|
|
+ attrs: {
|
|
|
+ clearable: true
|
|
|
+ }
|
|
|
+ },
|
|
|
+ rules: [{ required: true, message: '不能为空', trigger: 'change' }]
|
|
|
+ },
|
|
|
+ {
|
|
|
+ colKey: 'after',
|
|
|
+ title: '变更后内容',
|
|
|
+ comp: {
|
|
|
+ type: 'text',
|
|
|
+ attrs: {
|
|
|
+ clearable: true
|
|
|
+ }
|
|
|
+ },
|
|
|
+ rules: [
|
|
|
+ {
|
|
|
+ required: true,
|
|
|
+ message: '不能为空',
|
|
|
+ trigger: 'change'
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ {
|
|
|
+ colKey: 'remark',
|
|
|
+ title: '备注',
|
|
|
+ comp: {
|
|
|
+ type: 'text',
|
|
|
+ attrs: {
|
|
|
+ clearable: true
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ rules: {
|
|
|
+ reason: [
|
|
|
+ {
|
|
|
+ required: true,
|
|
|
+ message: '请填写变更原因',
|
|
|
+ type: 'error',
|
|
|
+ trigger: 'change'
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ contentJson: [
|
|
|
+ {
|
|
|
+ validator: (rule, value, callback) => {
|
|
|
+ if (!value || !value.length) return callback(new Error('请至少填写一行数据'))
|
|
|
+
|
|
|
+ return callback()
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ remark: [
|
|
|
+ {
|
|
|
+ validator: (rule, value, callback) => {
|
|
|
+ if (!value && this.formData.projectExchangeApprove !== 'FINISH') {
|
|
|
+ return callback(new Error('请填写备注'))
|
|
|
+ }
|
|
|
+ return callback()
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ IS_NEW_MODE() {
|
|
|
+ return this.$Route.query.type === 'new'
|
|
|
+ },
|
|
|
+ readonly() {
|
|
|
+ return this.$Route.query.type !== 'new'
|
|
|
+ },
|
|
|
+ title() {
|
|
|
+ return `项目派单信息(${this.sopInfo.crmNo})`
|
|
|
+ }
|
|
|
+ },
|
|
|
+ mounted() {
|
|
|
+ this.sopInfo = { ...(this.$Route.query.sop || {}) }
|
|
|
+ this.initData()
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ dictToOptionList,
|
|
|
+ async initData() {
|
|
|
+ if (this.IS_NEW_MODE) {
|
|
|
+ this.formData.serviceId = this.sopInfo.serviceId
|
|
|
+ this.formData.sopNo = this.sopInfo.sopNo
|
|
|
+ this.formData.crmNo = this.sopInfo.crmNo
|
|
|
+ this.formData.flowDeploymentId = this.sopInfo.flowDeploymentId
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ // audit
|
|
|
+ const res = await planChangeDetail(this.sopInfo.id)
|
|
|
+ this.sopInfo.beginTime = res.crmInfo.crmBeginTime
|
|
|
+ this.sopInfo.customManagerName = res.crmInfo.customManagerName
|
|
|
+ this.sopInfo.customManagerTypeStr = this.sopInfo.customTypeStr
|
|
|
+ this.sopInfo.examStartTime = ''
|
|
|
+ this.sopInfo.examEndTime = ''
|
|
|
+ this.sopInfo.productName = res.crmInfo.productName
|
|
|
+
|
|
|
+ this.formData = objAssign(this.formData, res.tbProjectExchange)
|
|
|
+ this.formData.contentJson = JSON.parse(this.formData.contentJson)
|
|
|
+ },
|
|
|
+ async submitHandle() {
|
|
|
+ const valid = await this.$refs.formRef.validate()
|
|
|
+ if (!valid) return
|
|
|
+
|
|
|
+ if (this.IS_NEW_MODE) {
|
|
|
+ const res = await createPlanChange({
|
|
|
+ ...omit(this.formData, ['projectExchangeApprove', 'remark']),
|
|
|
+ contentJson: JSON.stringify(this.formData.contentJson),
|
|
|
+ flowApprove: 'START'
|
|
|
+ }).catch(() => {})
|
|
|
+ if (!res) return
|
|
|
+ } else {
|
|
|
+ // 流程审批
|
|
|
+ const res = await approvePlanChange({
|
|
|
+ flowApprove: 'PASS',
|
|
|
+ projectExchangeApprove: this.formData.projectExchangeApprove,
|
|
|
+ remark: this.formData.remark,
|
|
|
+ taskId: this.sopInfo.taskId
|
|
|
+ }).catch(() => {})
|
|
|
+ if (!res) return
|
|
|
+ }
|
|
|
+
|
|
|
+ this.$refs.uToast.show({
|
|
|
+ title: '提交成功',
|
|
|
+ type: 'success'
|
|
|
+ })
|
|
|
+ this.$Router.back()
|
|
|
+ },
|
|
|
+ cancelHandle() {
|
|
|
+ this.$Router.back()
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+</script>
|