|
|
@@ -0,0 +1,915 @@
|
|
|
+<template>
|
|
|
+ <van-overlay class="backgroundSty" z-index="2002" :show="showPop" :lock-scroll="false">
|
|
|
+ <div style="height:5%">
|
|
|
+ <van-sticky>
|
|
|
+ <van-nav-bar
|
|
|
+ :title="'调班 ' + (typeValue == '4'? '修改':typeValue == '3'? '申请': typeValue == '2'? '审批': typeValue == '1'? '详情': '')"
|
|
|
+ :right-text="typeValue == '4' ? '退回原因' : ''"
|
|
|
+ @click-left="closePop()"
|
|
|
+ @click-right="getBack()"
|
|
|
+ >
|
|
|
+ <template #left>
|
|
|
+ <van-icon name="cross" class="ibps-nav-bar__close-icon" />
|
|
|
+ </template>
|
|
|
+ </van-nav-bar>
|
|
|
+ </van-sticky>
|
|
|
+ </div>
|
|
|
+ <div class="scrollView">
|
|
|
+ <van-form>
|
|
|
+ <van-field
|
|
|
+ required
|
|
|
+ label="选择排班:"
|
|
|
+ :placeholder="list.length>0?'请选择排班记录':'当前没有可选择的排班记录'"
|
|
|
+ label-width="6em"
|
|
|
+ :value="form.paiBan"
|
|
|
+ readonly
|
|
|
+ @click="typeValue == 3 || typeValue == 4 ? sheetShow = true:''"
|
|
|
+ />
|
|
|
+ <van-popup v-if="list.length>0 && (typeValue == 3 || typeValue == 4 )" v-model="sheetShow" position="bottom">
|
|
|
+ <van-picker
|
|
|
+ show-toolbar
|
|
|
+ :columns="list"
|
|
|
+ @confirm="actionSheetCallback"
|
|
|
+ @cancel="sheetShow = false"
|
|
|
+ />
|
|
|
+ </van-popup>
|
|
|
+ <van-field
|
|
|
+ v-model="form.tiaoBanYuanYin"
|
|
|
+ required
|
|
|
+ autosize
|
|
|
+ type="textarea"
|
|
|
+ label="调班原因:"
|
|
|
+ placeholder="请输入调班原因"
|
|
|
+ label-width="6em"
|
|
|
+ clearable
|
|
|
+ :readonly="typeValue != 3 && typeValue != 4 ? true : false"
|
|
|
+ />
|
|
|
+ </van-form>
|
|
|
+ <div v-if="Object.keys(showDateArr).length>0&&showDateArr[userInfo.user.id].dateKeyArr.length>0&&tabChildShow" class="tabChildClass">
|
|
|
+ <div class="tabAdd"><van-button plain hairline round size="mini" icon="plus" type="primary" @click="addEvent">添加</van-button></div>
|
|
|
+ <van-collapse v-if="tabChildActiveArr.length>0" v-model="tabChildActive">
|
|
|
+ <van-collapse-item v-for="(item, index) in tabChildActiveArr" :key="index" :title="'序号'+ (index+1)" :name="index+''" >
|
|
|
+ <van-field
|
|
|
+ required
|
|
|
+ label="调班日期:"
|
|
|
+ :placeholder="form.paiBan===''?'请先选择排班记录':'请选择调班日期'"
|
|
|
+ label-width="6em"
|
|
|
+ :value="tabChildActiveArr[index].tiaobanBenRenRiQi"
|
|
|
+ readonly
|
|
|
+ @click="typeValue == 3 || typeValue == 4 ? tbbrrqShow = true:''"
|
|
|
+ />
|
|
|
+ <van-popup v-if="Object.keys(showDateArr[userInfo.user.id]).length>0 && (typeValue == 3 || typeValue == 4 )" v-model="tbbrrqShow" position="bottom">
|
|
|
+ <van-picker
|
|
|
+ :ref="'tbrq'+index"
|
|
|
+ show-toolbar
|
|
|
+ :columns="showDateArr[userInfo.user.id].dateKeyArr"
|
|
|
+ @confirm="actionTbbrrqCallback(index)"
|
|
|
+ @cancel="tbbrrqShow = false"
|
|
|
+ />
|
|
|
+ </van-popup>
|
|
|
+ <van-field
|
|
|
+ required
|
|
|
+ label="调班班次:"
|
|
|
+ :placeholder="tabChildActiveArr[index].tiaobanBenRenRiQi===''?'请先选择调班日期':'请选择调班班次'"
|
|
|
+ label-width="6em"
|
|
|
+ :value="tabChildActiveArr[index].tiaobanBenRenBanCi"
|
|
|
+ readonly
|
|
|
+ @click="(typeValue == 3 || typeValue == 4) && tabChildActiveArr[index].tiaobanBenRenRiQi!=='' ? tbbrbcShow = true:''"
|
|
|
+ />
|
|
|
+ <van-popup v-if="tabChildActiveArr[index].tiaobanBenRenRiQi!==''&& (typeValue == 3 || typeValue == 4 )" v-model="tbbrbcShow" position="bottom">
|
|
|
+ <van-picker
|
|
|
+ :ref="'tbbc'+index"
|
|
|
+ show-toolbar
|
|
|
+ :columns="getBanCi(showDateArr[userInfo.user.id]['dateKeyValArr'][tabChildActiveArr[index].tiaobanBenRenRiQi])"
|
|
|
+ @confirm="actionTbbrbcCallback(index)"
|
|
|
+ @cancel="tbbrbcShow = false"
|
|
|
+ />
|
|
|
+ </van-popup>
|
|
|
+ <van-field
|
|
|
+ required
|
|
|
+ label="目标人员:"
|
|
|
+ :placeholder="form.paiBan===''?'请先选择排班记录':'请选择目标人员'"
|
|
|
+ label-width="6em"
|
|
|
+ :value="tabChildActiveArr[index].tiaobanMuBiaoRenYuan"
|
|
|
+ readonly
|
|
|
+ @click="typeValue == 3 || typeValue == 4 ? tbmbryShow = true:''"
|
|
|
+ />
|
|
|
+ <van-popup v-if="Object.keys(showDateArr).length>1 && (typeValue == 3 || typeValue == 4 )" v-model="tbmbryShow" position="bottom">
|
|
|
+ <van-picker
|
|
|
+ :ref="'mbry'+index"
|
|
|
+ show-toolbar
|
|
|
+ :columns="getAllPer(showDateArr)"
|
|
|
+ @confirm="actionTbmbryCallback(index)"
|
|
|
+ @cancel="tbmbryShow = false"
|
|
|
+ />
|
|
|
+ </van-popup>
|
|
|
+ <van-field
|
|
|
+ required
|
|
|
+ label="目标日期:"
|
|
|
+ :placeholder="tabChildActiveArr[index].tiaobanMuBiaoRenYuan===''?'请先选择目标人员':'请选择目标日期'"
|
|
|
+ label-width="6em"
|
|
|
+ :value="tabChildActiveArr[index].tiaobanMuBiaoRiQi"
|
|
|
+ readonly
|
|
|
+ @click="(typeValue == 3 || typeValue == 4) && tabChildActiveArr[index].tiaobanMuBiaoRenYuan!=='' ? tbmbrqShow = true:''"
|
|
|
+ />
|
|
|
+ <van-popup v-if="tabChildActiveArr[index].tiaobanMuBiaoRenYuan!==''&& (typeValue == 3 || typeValue == 4 )" v-model="tbmbrqShow" position="bottom">
|
|
|
+ <van-picker
|
|
|
+ :ref="'mbrq'+index"
|
|
|
+ show-toolbar
|
|
|
+ :columns="showDateArr[tabChildActiveArr[index].tiaobanMuBiaoRenYuanId].dateKeyArr"
|
|
|
+ @confirm="actionTbmbrqCallback(index)"
|
|
|
+ @cancel="tbmbrqShow = false"
|
|
|
+ />
|
|
|
+ </van-popup>
|
|
|
+ <van-field
|
|
|
+ required
|
|
|
+ label="目标班次:"
|
|
|
+ :placeholder="tabChildActiveArr[index].tiaobanMuBiaoRiQi===''?'请先选择目标日期':'请选择目标班次'"
|
|
|
+ label-width="6em"
|
|
|
+ :value="tabChildActiveArr[index].tiaobanMuBiaoBanCi"
|
|
|
+ readonly
|
|
|
+ @click="(typeValue == 3 || typeValue == 4) && tabChildActiveArr[index].tiaobanMuBiaoRiQi!=='' ? tbmbbcShow = true:''"
|
|
|
+ />
|
|
|
+ <van-popup v-if="tabChildActiveArr[index].tiaobanMuBiaoRiQi!==''&& (typeValue == 3 || typeValue == 4 )" v-model="tbmbbcShow" position="bottom">
|
|
|
+ <van-picker
|
|
|
+ :ref="'mbbc'+index"
|
|
|
+ show-toolbar
|
|
|
+ :columns="getBanCi(showDateArr[tabChildActiveArr[index].tiaobanMuBiaoRenYuanId]['dateKeyValArr'][tabChildActiveArr[index].tiaobanMuBiaoRiQi])"
|
|
|
+ @confirm="actionTbmbbcCallback(index)"
|
|
|
+ @cancel="tbmbbcShow = false"
|
|
|
+ />
|
|
|
+ </van-popup>
|
|
|
+ </van-collapse-item>
|
|
|
+ </van-collapse>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <van-cell-group v-if="typeValue != 3 && typeValue != 4">
|
|
|
+ <div class="verticalLine" style="width:4em;padding: 1em 0;">
|
|
|
+ 意见
|
|
|
+ </div>
|
|
|
+ <van-field
|
|
|
+ v-model="form.gouTongQueDingNei"
|
|
|
+ autosize
|
|
|
+ type="textarea"
|
|
|
+ label=""
|
|
|
+ placeholder="请输入意见和建议"
|
|
|
+ label-width="0"
|
|
|
+ clearable
|
|
|
+ :readonly="typeValue != 2"
|
|
|
+ />
|
|
|
+ </van-cell-group>
|
|
|
+
|
|
|
+ <div v-if="typeValue == '3'" class="padding flex flex-direction">
|
|
|
+ <van-button
|
|
|
+ type="success"
|
|
|
+ class="btn btn-back-color"
|
|
|
+ @click="onSubmit"
|
|
|
+ >提交
|
|
|
+ </van-button>
|
|
|
+ </div>
|
|
|
+ <div v-if="typeValue == '2'" class="padding flex flex-direction">
|
|
|
+ <van-button
|
|
|
+ type="success"
|
|
|
+ class="btn btn-back-color"
|
|
|
+ @click="onAgree('已完成', '同意', '确定')"
|
|
|
+ >同意
|
|
|
+ </van-button>
|
|
|
+ </div>
|
|
|
+ <div v-if="typeValue == '4'" class="padding flex flex-direction">
|
|
|
+ <van-button
|
|
|
+ type="success"
|
|
|
+ class="btn btn-back-color"
|
|
|
+ @click="onAgree('已编制', '重新提交', '提交')"
|
|
|
+ >修改
|
|
|
+ </van-button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </van-overlay>
|
|
|
+</template>
|
|
|
+<script>
|
|
|
+import random from '@/mixins/random'
|
|
|
+import bpmnStatus from '@/mixins/bpmnStatus'
|
|
|
+import IbpsUploader from '@/business/platform/file/uploader'
|
|
|
+
|
|
|
+import {
|
|
|
+ getNextIdByAlias,
|
|
|
+ findFormJsonByBo,
|
|
|
+ snapshot
|
|
|
+} from '@/api/platform/form/transfer'
|
|
|
+import { agree } from '@/api/platform/bpmn/bpmTask'
|
|
|
+
|
|
|
+export default {
|
|
|
+ components: {
|
|
|
+ IbpsUploader
|
|
|
+ },
|
|
|
+ mixins: [random, bpmnStatus],
|
|
|
+ props: {
|
|
|
+ showPop: {
|
|
|
+ type: Boolean,
|
|
|
+ default: false
|
|
|
+ },
|
|
|
+ typeValue: {
|
|
|
+ type: String,
|
|
|
+ default: '3'
|
|
|
+ },
|
|
|
+ id: {
|
|
|
+ type: String,
|
|
|
+ default: ''
|
|
|
+ }
|
|
|
+ },
|
|
|
+ data() {
|
|
|
+ const { useId, userInfo, userList } = this.$store.getters
|
|
|
+ return {
|
|
|
+ useId,
|
|
|
+ userInfo,
|
|
|
+ userList,
|
|
|
+ tabChildActive: ['0'],
|
|
|
+ tabChildActiveArr: [],
|
|
|
+ show: this.showPop,
|
|
|
+ showDateArr: {},
|
|
|
+ // typeValue: '3',
|
|
|
+ sheetShow: false,
|
|
|
+ tbbrrqShow: false,
|
|
|
+ tbbrbcShow: false,
|
|
|
+ tbmbryShow: false,
|
|
|
+ tbmbrqShow: false,
|
|
|
+ tbmbbcShow: false,
|
|
|
+ taskId: '',
|
|
|
+ form: {
|
|
|
+ // xuanZeKeHu: '',
|
|
|
+ // biaoDanBianHao: '',
|
|
|
+ // buMenName: '',
|
|
|
+ // keHuDanWeiMin: '',
|
|
|
+ // keHuLianXiRen: '',
|
|
|
+ tiaoBanYuanYin: '',
|
|
|
+ // lianXiDianHua: '',
|
|
|
+ // yangPinMingCheng: '',
|
|
|
+ // yangPinBianHao: '',
|
|
|
+ // yangPinLeiXing: '',
|
|
|
+ // baoGaoBianHao: '',
|
|
|
+ paiBan: '',
|
|
|
+ paiBanId: '',
|
|
|
+ // gouTongNeiRong: '',
|
|
|
+ // keHu: '',
|
|
|
+ gouTongQueDingNei: ''
|
|
|
+ // leiXing: '2',
|
|
|
+ // yongHuYouXiang: '',
|
|
|
+ // qiTa: ''
|
|
|
+ },
|
|
|
+ // fuJianShangChuanArray: [],
|
|
|
+ // popupShow: false,
|
|
|
+ list: [],
|
|
|
+ // kehuXinXinList: [],
|
|
|
+
|
|
|
+ // weiTuoList: [],
|
|
|
+ // bianZhiRenName: '',
|
|
|
+ // queDingRenName: '',
|
|
|
+ backShow: false,
|
|
|
+ option: '',
|
|
|
+ content: '',
|
|
|
+ // timeShow: false,
|
|
|
+ // params: {
|
|
|
+ // year: true,
|
|
|
+ // month: true,
|
|
|
+ // day: true,
|
|
|
+ // hour: true,
|
|
|
+ // minute: true,
|
|
|
+ // second: false
|
|
|
+ // },
|
|
|
+ level: null,
|
|
|
+ mainPosition: {
|
|
|
+ id: ''
|
|
|
+ },
|
|
|
+ // xuanzeTime: null,
|
|
|
+ nowDate: new Date(),
|
|
|
+ tabChildShow: false,
|
|
|
+ dateArr: []
|
|
|
+ }
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ rightText() {
|
|
|
+ return this.checkMode
|
|
|
+ ? this.$t('common.button.cancel')
|
|
|
+ : this.$t('common.button.manage')
|
|
|
+ },
|
|
|
+ selectedIds() {
|
|
|
+ return this.checkedIds.join(',')
|
|
|
+ }
|
|
|
+ },
|
|
|
+ watch: {
|
|
|
+ showPop: {
|
|
|
+ handler: function(val, oldVal) {
|
|
|
+ if (val === true) {
|
|
|
+ this.form = {
|
|
|
+ // xuanZeKeHu: '',
|
|
|
+ // biaoDanBianHao: '',
|
|
|
+ // buMenName: '',
|
|
|
+ // keHuDanWeiMin: '',
|
|
|
+ // keHuLianXiRen: '',
|
|
|
+ tiaoBanYuanYin: '',
|
|
|
+ // lianXiDianHua: '',
|
|
|
+ // yangPinMingCheng: '',
|
|
|
+ // yangPinBianHao: '',
|
|
|
+ // yangPinLeiXing: '',
|
|
|
+ // baoGaoBianHao: '',
|
|
|
+ paiBan: '',
|
|
|
+ paiBanId: '',
|
|
|
+ // gouTongNeiRong: '',
|
|
|
+ // keHu: '',
|
|
|
+ gouTongQueDingNei: ''
|
|
|
+ // leiXing: '2',
|
|
|
+ // yongHuYouXiang: '',
|
|
|
+ // qiTa: ''
|
|
|
+ }
|
|
|
+ this.tabChildActive = ['0']
|
|
|
+ this.tabChildActiveArr = []
|
|
|
+ this.getKehu()
|
|
|
+ this.level = this.$store.getters.level
|
|
|
+ const mid = JSON.parse(localStorage.getItem('mainPosition'))
|
|
|
+ const mainPosition =
|
|
|
+ mid ||
|
|
|
+ (this.userInfo && this.userInfo.mainPosition
|
|
|
+ ? this.userInfo.mainPosition
|
|
|
+ : null)
|
|
|
+ this.mainPosition = mainPosition
|
|
|
+ this.getList(this.userInfo.user.id)
|
|
|
+ if (this.id && this.id !== '') {
|
|
|
+ this.getDe(this.id)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ immediate: true
|
|
|
+ },
|
|
|
+ form: {
|
|
|
+ handler: function(val, oldVal) {
|
|
|
+ if (val.paiBan !== '') {
|
|
|
+ this.tabChildShow = true
|
|
|
+ if (this.tabChildActiveArr.length === 0) {
|
|
|
+ this.tabChildActiveArr.push({ tiaobanBenRenRiQi: '', tiaobanBenRenBanCi: '', tiaobanMuBiaoRenYuan: '', tiaobanMuBiaoRenYuanId: '', tiaobanMuBiaoRiQi: '', tiaobanMuBiaoBanCi: '' })
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ this.tabChildShow = false
|
|
|
+ this.tabChildActiveArr = []
|
|
|
+ }
|
|
|
+ },
|
|
|
+ deep: true,
|
|
|
+ immediate: true
|
|
|
+ }
|
|
|
+ },
|
|
|
+ mounted() {
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ closePop() {
|
|
|
+ this.$emit('updataSet', false)
|
|
|
+ },
|
|
|
+ getList(val) {
|
|
|
+ this.list = []
|
|
|
+ const sql = `select a.* from t_schedule a LEFT JOIN t_schedule_detail b on a.id_=b.parent_id_ where a.status_='已发布' and b.user_id_ = '${val}' and CAST(a.end_date_ AS DATE)>='${this.$common.getFormatDate('string', 10, this.nowDate)}'`
|
|
|
+
|
|
|
+ this.$common.request('sql', sql).then(res => {
|
|
|
+ if (res.state === 200) {
|
|
|
+ const data = res.variables.data || []
|
|
|
+ data.forEach((item, i) => {
|
|
|
+ this.list.push({ text: item.title_, id: item.id_, obj: item })
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ getPlanList(val) {
|
|
|
+ const sql = `select a.id_ as fid, a.start_date_, a.end_date_, a.config_, a.overview_, b.* from t_schedule a JOIN t_schedule_detail b on a.id_=b.parent_id_ where a.status_='已发布' and a.id_ = '${val}'`
|
|
|
+ Object.assign(this.showDateArr, {})
|
|
|
+ const showData = {}
|
|
|
+ this.$common.request('sql', sql).then(res => {
|
|
|
+ if (res.state === 200) {
|
|
|
+ const data = res.variables.data || []
|
|
|
+ data.forEach((item, i) => {
|
|
|
+ if (showData.hasOwnProperty(item.user_id_)) {
|
|
|
+ this.dateArr.forEach((e, n) => {
|
|
|
+ if (item['d' + (n + 1) + '_']) {
|
|
|
+ showData[item.user_id_]['dateKeyValArr'][e] = showData[item.user_id_]['dateKeyValArr'][e] + (item['d' + (n + 1) + '_'] !== '' && showData[item.user_id_]['dateKeyValArr'][e] !== '' ? ',' : '') + (item['d' + (n + 1) + '_'] ? item['d' + (n + 1) + '_'] : '')
|
|
|
+ }
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ showData[item.user_id_] = { dateKeyArr: [], dateKeyValArr: {}}
|
|
|
+ this.dateArr.forEach((e, n) => {
|
|
|
+ if (item['d' + (n + 1) + '_']) {
|
|
|
+ showData[item.user_id_]['dateKeyValArr'][e] = item['d' + (n + 1) + '_']
|
|
|
+ showData[item.user_id_]['dateKeyArr'].push({ text: e })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ this.showDateArr = showData
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ actionSheetCallback(e) {
|
|
|
+ this.dateArr = this.generationDate(e.obj.start_date_, e.obj.end_date_)
|
|
|
+ this.getPlanList(e.id)
|
|
|
+ this.form.paiBan = e.text
|
|
|
+ this.form.paiBanId = e.id
|
|
|
+ this.sheetShow = false
|
|
|
+ },
|
|
|
+ actionTbbrrqCallback(index) {
|
|
|
+ const obj = this.$refs['tbrq' + index][0].getValues()
|
|
|
+ this.tabChildActiveArr[index].tiaobanBenRenRiQi = obj[0].text
|
|
|
+ this.tbbrrqShow = false
|
|
|
+ },
|
|
|
+ actionTbbrbcCallback(index) {
|
|
|
+ const obj = this.$refs['tbbc' + index][0].getValues()
|
|
|
+ this.tabChildActiveArr[index].tiaobanBenRenBanCi = obj[0]
|
|
|
+ this.tbbrbcShow = false
|
|
|
+ },
|
|
|
+ actionTbmbryCallback(index) {
|
|
|
+ const obj = this.$refs['mbry' + index][0].getValues()
|
|
|
+ this.tabChildActiveArr[index].tiaobanMuBiaoRenYuan = obj[0].text
|
|
|
+ this.tabChildActiveArr[index].tiaobanMuBiaoRenYuanId = obj[0].id
|
|
|
+ this.tbmbryShow = false
|
|
|
+ },
|
|
|
+ actionTbmbrqCallback(index) {
|
|
|
+ const obj = this.$refs['mbrq' + index][0].getValues()
|
|
|
+ this.tabChildActiveArr[index].tiaobanMuBiaoRiQi = obj[0].text
|
|
|
+ this.tbmbrqShow = false
|
|
|
+ },
|
|
|
+ actionTbmbbcCallback(index) {
|
|
|
+ const obj = this.$refs['mbbc' + index][0].getValues()
|
|
|
+ this.tabChildActiveArr[index].tiaobanMuBiaoBanCi = obj[0]
|
|
|
+ this.tbmbbcShow = false
|
|
|
+ },
|
|
|
+ // 获取排班人员
|
|
|
+ getAllPer(val) {
|
|
|
+ const data = Object.keys(val)
|
|
|
+ const returnArr = []
|
|
|
+ data.forEach((item, i) => {
|
|
|
+ const mid = this.userList.findIndex(t => t.userId === item)
|
|
|
+ if (mid !== -1) {
|
|
|
+ returnArr.push({ text: this.userList[mid].userName, id: this.userList[mid].userId })
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
+ return returnArr
|
|
|
+ },
|
|
|
+ // 获取班次数组
|
|
|
+ getBanCi(val) {
|
|
|
+ return val.split(',')
|
|
|
+ },
|
|
|
+ // 根据起止日期输出范围内所有日期
|
|
|
+ generationDate(start, end, type = 'string') {
|
|
|
+ const dateArr = []
|
|
|
+ const startArr = type === 'date' ? this.$common.getFormatDate('string', 10, start).split('-') : start.split('-')
|
|
|
+ const endArr = type === 'date' ? this.$common.getFormatDate('string', 10, end).split('-') : end.split('-')
|
|
|
+ const db = new Date()
|
|
|
+ db.setUTCFullYear(startArr[0], startArr[1] - 1, startArr[2])
|
|
|
+ const de = new Date()
|
|
|
+ de.setUTCFullYear(endArr[0], endArr[1] - 1, endArr[2])
|
|
|
+ const unixDb = db.getTime()
|
|
|
+ const unixDe = de.getTime()
|
|
|
+ let stamp
|
|
|
+ const oneDay = 24 * 60 * 60 * 1000
|
|
|
+ for (stamp = unixDb; stamp <= unixDe;) {
|
|
|
+ dateArr.push(this.$common.getFormatDate('string', 10, new Date(parseInt(stamp))))
|
|
|
+ stamp = stamp + oneDay
|
|
|
+ }
|
|
|
+ return dateArr
|
|
|
+ },
|
|
|
+ addEvent() {
|
|
|
+ this.tabChildActive.push(this.tabChildActiveArr.length + '')
|
|
|
+ this.tabChildActiveArr.push({ tiaobanBenRenRiQi: '', tiaobanBenRenBanCi: '', tiaobanMuBiaoRenYuan: '', tiaobanMuBiaoRenYuanId: '', tiaobanMuBiaoRiQi: '', tiaobanMuBiaoBanCi: '' })
|
|
|
+ },
|
|
|
+ getKehu() {
|
|
|
+ const info = this.$store.getters.userInfo
|
|
|
+ if (info) {
|
|
|
+ // this.form.keHuDanWeiMin = info.user.qq
|
|
|
+ // this.form.lianXiDianHua = info.user.mobile
|
|
|
+ // this.form.keHuDanWeiMingChe = info.user.id
|
|
|
+ // this.form.keHuLianXiRen = info.user.fullname
|
|
|
+ this.form.paiBan = ''
|
|
|
+ this.form.gouTongRiQi = this.$methCommon.time(16)
|
|
|
+ // this.xuanzeTime = new Date()
|
|
|
+ // this.form.yongHuYouXiang = info.user.email
|
|
|
+ }
|
|
|
+ },
|
|
|
+ getDe(id) {
|
|
|
+ const sql = `select c.*,d.title_ from (select a.id_ as fid, a.schedule_id_,a.reason_,a.status,b.* from t_adjustment_detail b join t_adjustment a on a.id_ = b.parent_id_ where a.id_ = '${id}') c join t_schedule d on c.schedule_id_ = d.id_`
|
|
|
+
|
|
|
+ this.$common.request('sql', sql).then(res => {
|
|
|
+ if (res.state === 200) {
|
|
|
+ const data = res.variables.data
|
|
|
+ this.form = {
|
|
|
+ id: data[0].id_,
|
|
|
+ tiaoBanYuanYin: data[0].reason_,
|
|
|
+ paiBan: data[0].title_,
|
|
|
+ paiBanId: data[0].schedule_id_,
|
|
|
+ gouTongQueDingNei: data[0].gou_tong_que_ding,
|
|
|
+ bianZhiShiJian: data[0].bian_zhi_shi_jian,
|
|
|
+ gouTongRiQi: data[0].gou_tong_ri_qi_
|
|
|
+ }
|
|
|
+ data.forEach((item, i) => {
|
|
|
+ this.tabChildActiveArr.push(
|
|
|
+ {
|
|
|
+ tiaobanBenRenRiQi: item.before_date_,
|
|
|
+ tiaobanBenRenBanCi: item.before_adjust_,
|
|
|
+ tiaobanMuBiaoRenYuan: '',
|
|
|
+ tiaobanMuBiaoRenYuanId: '',
|
|
|
+ tiaobanMuBiaoRiQi: item.after_date_,
|
|
|
+ tiaobanMuBiaoBanCi: item.after_adjust_
|
|
|
+ }
|
|
|
+ )
|
|
|
+ })
|
|
|
+ if (this.typeValue === '2' || this.typeValue === '4') {
|
|
|
+ this.getTaskId(data.id_)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ onSubmit() {
|
|
|
+ if (!this.getYanZheng()) {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ // const tmpArray = []
|
|
|
+ // this.fuJianShangChuanArray.forEach(item => {
|
|
|
+ // tmpArray.push(item.id)
|
|
|
+ // })
|
|
|
+
|
|
|
+ const info = this.$store.getters.userInfo
|
|
|
+ const useId = info.user.id
|
|
|
+ const detpId = info.employee.positions
|
|
|
+ const para = {
|
|
|
+ parameters: [
|
|
|
+ {
|
|
|
+ key: 'defId',
|
|
|
+ value: '1056942070293331968'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ key: 'version',
|
|
|
+ value: '0'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ key: 'data',
|
|
|
+ value: ''
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ // this.form.fuJian = tmpArray.join(',')
|
|
|
+ this.form.bianZhiRen = useId
|
|
|
+ this.form.bianZhiShiJian = this.$methCommon.time(16)
|
|
|
+ this.form.bianZhiBuMen = this.mainPosition === null ? detpId : this.mainPosition.id
|
|
|
+ // this.form.bianZhiBuMen = detpId
|
|
|
+
|
|
|
+ this.form.shiFouGuoShen = '已编制'
|
|
|
+ this.form.diDian = this.level.second
|
|
|
+ // this.form.xuanZeKeHu = useId
|
|
|
+ para.parameters[2].value = JSON.stringify(this.form)
|
|
|
+ const that = this
|
|
|
+
|
|
|
+ findFormJsonByBo(para)
|
|
|
+ .then(res => {
|
|
|
+ if (res.state === 200) {
|
|
|
+ that.$toast.success('提交成功!')
|
|
|
+ setTimeout(() => {
|
|
|
+ that.closePop()
|
|
|
+ }, 1000)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .catch(() => {})
|
|
|
+ },
|
|
|
+ onAgree(shiFouGuoShen, opinion, type) {
|
|
|
+ if (this.typeValue !== '2' && !this.getYanZheng()) {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ // const info = this.$store.getters.userInfo
|
|
|
+ // const useId = info.user.id
|
|
|
+ // const detpId = info.employee.positions
|
|
|
+ // const tmpArray = []
|
|
|
+ // this.fuJianShangChuanArray.forEach(item => {
|
|
|
+ // tmpArray.push(item.id)
|
|
|
+ // })
|
|
|
+ // this.form.fuJian = tmpArray.join(',')
|
|
|
+ this.form.shiFouGuoShen = shiFouGuoShen
|
|
|
+ this.form.diDian = this.level.second
|
|
|
+ this.form.shiFouGuoShen = shiFouGuoShen
|
|
|
+ const editData = {
|
|
|
+ data: JSON.stringify(this.form),
|
|
|
+ opinion: opinion,
|
|
|
+ taskId: this.taskId
|
|
|
+ }
|
|
|
+ agree(editData).then(res => {
|
|
|
+ if (res.state === 200) {
|
|
|
+ if (this.typeValue === '2') {
|
|
|
+ setTimeout(() => {
|
|
|
+ this.getPath(this.id)
|
|
|
+ }, 1000)
|
|
|
+ } else {
|
|
|
+ this.$toast.success(type + '成功!')
|
|
|
+ this.closePop()
|
|
|
+ }
|
|
|
+ this.$toast.success(type + '成功!')
|
|
|
+ setTimeout(() => {
|
|
|
+ this.closePop()
|
|
|
+ }, 1000)
|
|
|
+ } else {
|
|
|
+ this.$toast.fail(type + '异常!')
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 生成快照
|
|
|
+ getPath(id) {
|
|
|
+ const org = this.level.first
|
|
|
+
|
|
|
+ const url = this.$common.getRequest.downloadReport(
|
|
|
+ '咨询活动/客户沟通记录表.rpx',
|
|
|
+ `id_=${id}&org_=${org}`
|
|
|
+ )
|
|
|
+ const data = {
|
|
|
+ url,
|
|
|
+ name: '用户沟通记录表' + this.$methCommon.time(19),
|
|
|
+ type: 'pdf'
|
|
|
+ }
|
|
|
+ snapshot(data).then(res => {
|
|
|
+ const result = res.data
|
|
|
+ if (result.state === 200) {
|
|
|
+ this.updateData(id, result.data.id)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ updateData(id, fileId) {
|
|
|
+ const pp = {
|
|
|
+ updList: [
|
|
|
+ {
|
|
|
+ where: {
|
|
|
+ id_: id
|
|
|
+ },
|
|
|
+ param: {
|
|
|
+ kuai_zhao_: fileId,
|
|
|
+ shi_fou_guo_shen_: '已完成'
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ tableName: 't_khgtjlb'
|
|
|
+ }
|
|
|
+ const data = this.$sig(pp)
|
|
|
+ this.$common.request('update', data).then(res => {
|
|
|
+ this.$methCommon.getPrompt('提交成功', 'success')
|
|
|
+ setTimeout(() => {
|
|
|
+ this.closePop()
|
|
|
+ }, 1000)
|
|
|
+ })
|
|
|
+ },
|
|
|
+ getYanZheng() {
|
|
|
+ const suList = [
|
|
|
+ // 'keHuLianXiRen',
|
|
|
+ // 'keHuDanWeiMin',
|
|
|
+ // 'lianXiDianHua',
|
|
|
+ // 'yongHuYouXiang',
|
|
|
+ 'tiaoBanYuanYin'
|
|
|
+ // 'gouTongNeiRong'
|
|
|
+ ]
|
|
|
+ const suListName = [
|
|
|
+ '用户姓名',
|
|
|
+ '用户单位',
|
|
|
+ '联系电话',
|
|
|
+ '用户邮箱',
|
|
|
+ '沟通事项',
|
|
|
+ '沟通内容'
|
|
|
+ ]
|
|
|
+ for (const item in suList) {
|
|
|
+ if (!this.form[suList[item]]) {
|
|
|
+ this.$toast({
|
|
|
+ duration: 2000, // 持续展示 toast
|
|
|
+ message: '请输入' + suListName[item]
|
|
|
+ })
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ const selList = ['gouTongRiQi', 'paiBan']
|
|
|
+ const selListName = ['沟通时间', '沟通类型']
|
|
|
+ for (const item in selList) {
|
|
|
+ if (!this.form[selList[item]]) {
|
|
|
+ this.$toast({
|
|
|
+ duration: 2000, // 持续展示 toast
|
|
|
+ message: '请选择' + selListName[item]
|
|
|
+ })
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ // if (!this.form.keHu) {
|
|
|
+ // this.$toast({
|
|
|
+ // duration: 2000, // 持续展示 toast
|
|
|
+ // message: '请填写签名'
|
|
|
+ // })
|
|
|
+ // return false
|
|
|
+ // }
|
|
|
+
|
|
|
+ if (this.form.paiBan === '') {
|
|
|
+ this.$toast({
|
|
|
+ duration: 2000, // 持续展示 toast
|
|
|
+ message: '请填写其他类型'
|
|
|
+ })
|
|
|
+ return false
|
|
|
+ }
|
|
|
+
|
|
|
+ return true
|
|
|
+ },
|
|
|
+ // 根据委托单id查询 taskId
|
|
|
+ getTaskId(id) {
|
|
|
+ let sql = ``
|
|
|
+ if (this.typeValue === '2') {
|
|
|
+ sql = `select TASK_ID_,PROC_INST_ID_ from ibps_bpm_tasks where NAME_ = '确认' and NODE_ID_ = 'Activity_02lroj1' and PROC_DEF_KEY_ = 'Process_0pjp1fy' and EXEC_ID_ = (select PROC_INST_ID_ from act_ru_execution where ACT_ID_ = 'Activity_02lroj1' and BUSINESS_KEY_ = '${id}') ORDER BY CREATE_TIME_ desc`
|
|
|
+ } else if (this.typeValue === '4') {
|
|
|
+ sql = `select TASK_ID_,PROC_INST_ID_ from ibps_bpm_tasks where NAME_ = '沟通' and NODE_ID_ = 'Activity_0qy1dd7' and PROC_DEF_KEY_ = 'Process_0pjp1fy' and EXEC_ID_ = (select PROC_INST_ID_ from act_ru_execution where ACT_ID_ = 'Activity_0qy1dd7' and BUSINESS_KEY_ = '${id}') ORDER BY CREATE_TIME_ desc`
|
|
|
+ }
|
|
|
+ this.$common.request('sql', sql).then(res => {
|
|
|
+ if (res.state === 200) {
|
|
|
+ const result = res.variables.data[0]
|
|
|
+ this.taskId = result.TASK_ID_
|
|
|
+
|
|
|
+ this.getProcInstId(result.PROC_INST_ID_)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 根据委托单id查询 taskId
|
|
|
+ getProcInstId(id) {
|
|
|
+ const sql = `select OPTION_ from ibps_bpm_oper_log where PROC_INST_ID_ = '${id}' order by create_time_ desc limit 1`
|
|
|
+ this.$common.request('sql', sql).then(res => {
|
|
|
+ if (res.state === 200) {
|
|
|
+ const result = res.variables.data[0]
|
|
|
+ this.option = result.OPTION_
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 退回原因
|
|
|
+ getBack() {
|
|
|
+ this.content = this.option
|
|
|
+ this.backShow = true
|
|
|
+ this.$dialog
|
|
|
+ .alert({
|
|
|
+ title: '退回原因',
|
|
|
+ message: this.option,
|
|
|
+ theme: 'round-button',
|
|
|
+ confirmButtonColor: '#1989fa'
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ // on close
|
|
|
+ })
|
|
|
+ },
|
|
|
+ cancel() {
|
|
|
+ this.backShow = false
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+</script>
|
|
|
+<style lang="scss" scoped>
|
|
|
+::v-deep .van-cell__title {
|
|
|
+ width: 65%;
|
|
|
+
|
|
|
+ .van-cell__label {
|
|
|
+ overflow-wrap: break-word;
|
|
|
+ }
|
|
|
+}
|
|
|
+.sectionBox {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ margin-bottom: 2px;
|
|
|
+ font-size: 14px;
|
|
|
+ color: rgba(128, 138, 135, 0.9);
|
|
|
+
|
|
|
+ .left {
|
|
|
+ width: 90px;
|
|
|
+ }
|
|
|
+}
|
|
|
+.sectionBox::before {
|
|
|
+ content: '';
|
|
|
+ width: 5px;
|
|
|
+ height: 14px;
|
|
|
+ border-radius: 2px;
|
|
|
+ margin-right: 5px;
|
|
|
+}
|
|
|
+.btn-back-color {
|
|
|
+ background-color: #1989fa !important;
|
|
|
+ border: none;
|
|
|
+}
|
|
|
+.btn-sty {
|
|
|
+ padding: 0 13px;
|
|
|
+ border-radius: 5px;
|
|
|
+}
|
|
|
+.u-m-r-15 {
|
|
|
+ margin-right: 8px !important;
|
|
|
+}
|
|
|
+.verticalLine {
|
|
|
+ color: #000;
|
|
|
+ font-size: 13px;
|
|
|
+ margin-bottom: 20px;
|
|
|
+}
|
|
|
+.verticalLine::before {
|
|
|
+ content: '';
|
|
|
+ width: 5px;
|
|
|
+ height: 14px;
|
|
|
+ background-color: #2979ff;
|
|
|
+ border-radius: 2px;
|
|
|
+ margin-right: 5px;
|
|
|
+}
|
|
|
+.suspensionBtn {
|
|
|
+ width: 80px;
|
|
|
+ height: 80px;
|
|
|
+ position: fixed;
|
|
|
+ top: 75%;
|
|
|
+ right: 2%;
|
|
|
+ img {
|
|
|
+ width: 100%;
|
|
|
+ height: 100%;
|
|
|
+ }
|
|
|
+}
|
|
|
+.backgroundSty {
|
|
|
+ height: 100%;
|
|
|
+ background-color: #fff;
|
|
|
+}
|
|
|
+.cu-form-group .title {
|
|
|
+ min-width: 180px;
|
|
|
+}
|
|
|
+.padding {
|
|
|
+ padding-bottom: 15px;
|
|
|
+ padding-top: 5px;
|
|
|
+ background-color: #f8f8f8;
|
|
|
+ display: flex;
|
|
|
+ justify-content: center;
|
|
|
+}
|
|
|
+.btn {
|
|
|
+ width: 90%;
|
|
|
+ padding: 15px;
|
|
|
+ border-radius: 5px;
|
|
|
+}
|
|
|
+
|
|
|
+.fileBox {
|
|
|
+ line-height: 50px;
|
|
|
+ color: #888888;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: space-between;
|
|
|
+ border: 1px solid #dddddd;
|
|
|
+ border-radius: 8px;
|
|
|
+ padding: 5px;
|
|
|
+ margin-top: 10px;
|
|
|
+}
|
|
|
+
|
|
|
+.u-update-content {
|
|
|
+ font-size: 26px;
|
|
|
+ // color: $u-content-color;
|
|
|
+ line-height: 1.7;
|
|
|
+ padding: 30px;
|
|
|
+}
|
|
|
+.verticalLine {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: center;
|
|
|
+ font-size: 14px;
|
|
|
+ color: rgb(51, 51, 51);
|
|
|
+}
|
|
|
+.verticalLine::before {
|
|
|
+ content: '';
|
|
|
+ width: 5px;
|
|
|
+ height: 14px;
|
|
|
+ background-color: #2979ff;
|
|
|
+ border-radius: 2px;
|
|
|
+ margin-right: 5px;
|
|
|
+}
|
|
|
+.scrollView {
|
|
|
+ overflow-y: scroll;
|
|
|
+ height: 95%;
|
|
|
+ background-color: #f8f8f8;
|
|
|
+ .tabChildClass{
|
|
|
+ margin-top: 1vh;
|
|
|
+ .tabAdd{
|
|
|
+ text-align: right;
|
|
|
+ margin-bottom: 1vh;
|
|
|
+ margin-right: 2vw;
|
|
|
+ }
|
|
|
+ ::v-deep .tabAdd .van-button--primary{
|
|
|
+ background-color: #f8f8f8;
|
|
|
+ padding: 0 2vw;
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+.scrollView::-webkit-scrollbar {
|
|
|
+ display: none;
|
|
|
+}
|
|
|
+::v-deep .yonghu .van-cell--borderless {
|
|
|
+ padding-left: 8px;
|
|
|
+}
|
|
|
+::v-deep .yonghu .van-cell .van-field__label {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: left;
|
|
|
+ font-size: 14px;
|
|
|
+ color: rgb(51, 51, 51);
|
|
|
+}
|
|
|
+::v-deep .yonghu .van-cell .van-field__label::before {
|
|
|
+ content: '';
|
|
|
+ width: 5px;
|
|
|
+ height: 14px;
|
|
|
+ background-color: #2979ff;
|
|
|
+ border-radius: 2px;
|
|
|
+ margin-right: 5px;
|
|
|
+}
|
|
|
+</style>
|