diff --git a/pages/apply/subPages/FO2/techEdit.vue b/pages/apply/subPages/FO2/techEdit.vue index df59add..335c1eb 100644 --- a/pages/apply/subPages/FO2/techEdit.vue +++ b/pages/apply/subPages/FO2/techEdit.vue @@ -14,7 +14,7 @@ - + @@ -24,7 +24,6 @@ - @@ -44,9 +43,67 @@ - - - + + + + + + + + + + + + + + + + + {{index + 1 + '. ' +item.Nav_User.NAME}} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {{index + 1 + '. ' +item.Nav_RelatedUser.NAME}} + + + + + + + + + + + + + + + @@ -59,9 +116,11 @@ - - - + + + + @@ -90,12 +149,11 @@ saveTechRecord } from '../../../../services/apply/FOServices/FOServices.js' import config from '../../../../config/common' - // 引入 jobShow 组件 - import jobShow from './jobShow.vue' - import jobFireShow from './../FO/jobFireShow.vue' + // 引入 jobShow 组件 + import jobShow from './jobShow.vue' + import jobFireShow from './../FO/jobFireShow.vue' export default { - // 注册组件 components: { jobShow, jobFireShow @@ -112,7 +170,6 @@ tableKey: 0, formatter: null, userLists: [], - // 弹窗控制 showJobPopup: false, jobShowId: null, popupHeight: 500, // 弹窗内容高度 @@ -178,17 +235,16 @@ onLoad(opt) { this.handleGetTechGet(opt) // 计算弹窗高度 - this.calcPopupHeight() + this.calcPopupHeight() }, methods: { - // 计算弹窗高度 - calcPopupHeight() { - const systemInfo = uni.getSystemInfoSync() - const windowHeight = systemInfo.windowHeight - // 弹窗占屏幕高度的 70%,减去头部高度 - this.popupHeight = Math.floor(windowHeight * 0.7) - 60 - }, - // 打开工作票弹窗 + // 计算弹窗高度 + calcPopupHeight() { + const systemInfo = uni.getSystemInfoSync() + const windowHeight = systemInfo.windowHeight + // 弹窗占屏幕高度的 70%,减去头部高度 + this.popupHeight = Math.floor(windowHeight * 0.7) - 60 + }, naviJob(id) { if (!id) { uni.$showErrorInfo('未找到关联的工作票') @@ -198,13 +254,13 @@ this.showJobPopup = true }, // 关闭弹窗 - closeJobPopup() { - this.showJobPopup = false - // 延迟清空 id,避免组件销毁问题 - setTimeout(() => { - this.jobShowId = null - }, 300) - }, + closeJobPopup() { + this.showJobPopup = false + // 延迟清空 id,避免组件销毁问题 + setTimeout(() => { + this.jobShowId = null + }, 300) + }, handleGetTechGet(opt) { this.TaskID = opt.taskID ? opt.taskID : ''; this.ID = opt.ID ? opt.ID : ''; @@ -235,10 +291,185 @@ this.isLoadOK = true }) }, - // ... 其他原有方法保持不变 ... + //显示时间控件 + showCheckDate() { + if (this.dataModel.DISCLOSURE_DATE == null) { + this.dataModel.DISCLOSURE_DATE = uni.$u.timeFormat(new Date(), + 'yyyy-mm-dd hh:MM:ss') + } + this.dateTimePickerInfo = { + showCheckDate: true, + defaultDateTime: this.dataModel.DISCLOSURE_DATE, + } + }, + //隐藏控件 显示时间 + handleCheckDate(e) { + this.dataModel.DISCLOSURE_DATE = uni.$u.timeFormat(e.value, + 'yyyy-mm-dd hh:MM:ss') + this.dateTimePickerInfo.showCheckDate = false + }, + handleSearchUser(val, pageIndex) { + const orgId = uni.getStorageSync('orgId') + const json = initFilter(orgId, "", "NAME", '', pageIndex) + extendInclude(json, "Nav_Department") + extendRule(json, 'ENABLE_STATUS', 1, '0') + if (val !== 'init') { + const tempGroup = initFilterGroup(false); + extendGroupRule(tempGroup, 'NAME', 9, val) + extendFilterGroup(json, tempGroup); + } + json.Limit = 20 + if (pageIndex) { + json.Start = (pageIndex - 1) * 20; + } - // 注意:原来的 naviJob 方法已被替换为弹窗版本 - // 如果还需要保留跳转功能,可以重命名为 naviJobToPage + getUserLists(json).then(res => { + if (res.IsSuccessful) { + this.userLists = res.Data.map(i => { + return { + ...i, + name: i.NAME, + code: i.CODE + } + }) + this.curTotal = res.TotalCount + } + }) + }, + handleSelectedUser(val) { + this.showPopup = false + this.lists = [] + const result = this.dataModel.Nav_Person.map((obj) => { + const { + Nav_User + } = obj + if (Nav_User.CODE === this.currentOperateUser.CODE) { + return Object.assign({}, obj, { + Nav_User: val, + }) + } + return obj + }) + + this.dataModel.Nav_Person = result + }, + handleClosePopup() { + this.showPopup = false + }, + handleChangeUser(user) { + this.currentOperateUser = user + this.showPopup = true + this.handleSearchUser('init') + }, + handleAddUser() { + const identifyUser = JSON.parse(JSON.stringify(this.subDataModel.Nav_Person)) + this.dataModel.Nav_Person.unshift(identifyUser) + // this.dataModel.Nav_Person.unshift(this.subDataModel) + }, + handleDelRowBefore(index) { + this.showDelModalIndex = index + }, + confirmDel() { + this.dataModel.Nav_Person.splice(this.showDelModalIndex, 1) + this.showDelModalIndex = undefined + }, + onConfirmPicker(e) { + const { + name, + dataIndex, + formIndex + } = this.comPickerInfo + if (formIndex === "sForm1") { + const result = this.dataModel.Nav_Person.map((obj, index) => { + if (index === dataIndex) { + return Object.assign({}, obj, { + // ATTEND_STATUS: e.value[0].ID, + }) + } + return obj + }) + this.dataModel.Nav_Person = result + } else { + + } + this.comPickerInfo.showSheet = false + }, + closePicker() { + this.comPickerInfo = { + showSheet: false, + columns: [], + title: '', + name: '', + dataIndex: undefined, + formIndex: undefined + } + }, + handleDelAction({ + name + }) { + uni.showModal({ + title: '是否删除数据?', + success: (res) => { + if (res.confirm) { + + } + } + }) + }, + submit() { + const ele = this.$refs + this.dataModel.PUBLISH = "SaveAndNotify"; + if (this.TaskID !== null) { + this.dataModel.TaskID = this.TaskID; + } + this.dataModel.ID = this.ID ? this.ID : guid(); + this.dataModel.ORG_ID = uni.getStorageSync('orgId') + ele['wForm'].validate().then(res => { + saveTechRecord(this.dataModel).then(res => { + uni.$showMsgFunc('操作成功!', () => { + // if (this.tableKey == null || this.tableKey == 0) { + // uni.navigateTo({ + // url: 'techRecord' + // }) + // } else { + uni.navigateBack() + // } + }, 'success', 1000) + }) + }).catch(err => { + uni.$showErrorInfo('请检查必填项,必填项不能为空') + }) + }, + uploadFilePromise(url) { + const appInfoData = uni.getStorageSync('appInfo') + const userId = appInfoData?.User?.ID || '' + const orgId = uni.getStorageSync('orgId') + const tenant = uni.getStorageSync('Tenant') || '' + const remoteUrl = config.serviceHost('/PF/File/UploadFile') + return new Promise((resolve, reject) => { + uni.uploadFile({ + url: remoteUrl, + filePath: url, + fileList: url, + name: 'file', + formData: { + OrgId: orgId + }, + header: { + Tenant: tenant, + userid: userId + }, + success: (res) => { + if (res.statusCode === 200) { + const uploadResult = JSON.parse(res.data) + if (uploadResult.IsSuccessful) { + resolve(uploadResult.Data) + } + } + } + }); + }) + }, } } @@ -284,42 +515,41 @@ .page-wrap>>>.u-upload__button { margin-bottom: 0; } - /* 弹窗样式 */ - .job-popup-wrap { - width: 92vw; - max-width: 600px; - background: #ffffff; - border-radius: 12px; - overflow: hidden; - display: flex; - flex-direction: column; - } - - .job-popup-header { - padding: 16px 20px; - border-bottom: 1px solid #f0f0f0; - flex-shrink: 0; - text-align: center; - } - - .job-popup-title { - font-size: 18px; - font-weight: 600; - color: #333333; - } - - .job-popup-body { - /* padding: 0 16px 16px; */ - } - - /* 弹窗内部滚动条样式 */ - .job-popup-body::-webkit-scrollbar { - width: 4px; - } - - .job-popup-body::-webkit-scrollbar-thumb { - background: #ddd; - border-radius: 4px; - } + .job-popup-wrap { + width: 92vw; + max-width: 600px; + background: #ffffff; + border-radius: 12px; + overflow: hidden; + display: flex; + flex-direction: column; + } + + .job-popup-header { + padding: 16px 20px; + border-bottom: 1px solid #f0f0f0; + flex-shrink: 0; + text-align: center; + } + + .job-popup-title { + font-size: 18px; + font-weight: 600; + color: #333333; + } + + .job-popup-body { + /* padding: 0 16px 16px; */ + } + + /* 弹窗内部滚动条样式 */ + .job-popup-body::-webkit-scrollbar { + width: 4px; + } + + .job-popup-body::-webkit-scrollbar-thumb { + background: #ddd; + border-radius: 4px; + } \ No newline at end of file