| | |
| | | <view class="container"> |
| | | <cu-custom :bgColor="NavBarColor" :isBack="true" backRouterName="productionTask"> |
| | | <block slot="backText">返回</block> |
| | | <block slot="content">执行</block> |
| | | <block slot="content">周保执行</block> |
| | | </cu-custom> |
| | | <view class="container"> |
| | | |
| | | |
| | | <uni-forms ref="form" :modelValue="formData" validate-trigger="bind" err-show-type="undertext"> |
| | | <uni-group top="1"> |
| | | <view class="text-gray margin-bottom-lg">—————————— 基本信息 ——————————</view> |
| | | <view class="divider"><text>基本信息</text></view> |
| | | <!-- <view class="text-gray margin-bottom-lg">—————————— 基本信息 ——————————</view> --> |
| | | <uni-forms-item :label-width="80" name="orderNum" label="工单号:"> |
| | | <uni-easyinput v-model="formData.orderNum" :disabled="true" /> |
| | | </uni-forms-item> |
| | |
| | | <uni-data-select v-model="formData.num" :localdata="equipmentList" @change="changeEquipmentList" |
| | | placeholder="请选择" :disabled="true" /> |
| | | </uni-forms-item> |
| | | |
| | | <uni-forms-item :label-width="80" required name="maintenanceStatus_dictText" label="工单状态:"> |
| | | <uni-easyinput v-model="formData.maintenanceStatus_dictText" :disabled="true" /> |
| | | </uni-forms-item> |
| | | <uni-forms-item :label-width="80" required name="installationPosition_dictText" label="安装位置:"> |
| | | <uni-easyinput v-model="formData.installationPosition_dictText" :disabled="true" /> |
| | | </uni-forms-item> |
| | | <uni-forms-item :label-width="80" name="maintenanceDate" label="保养日期:"> |
| | | <uni-easyinput v-model="formData.maintenanceDate" :disabled="true" /> |
| | | </uni-forms-item> |
| | | <uni-forms-item :label-width="80" name="operator" label="保养人:"> |
| | | <uni-easyinput v-model="formData.operator" :disabled="true" /> |
| | | </uni-forms-item> |
| | | <uni-forms-item :label-width="100" name="operatorPhone_dictText" label="保养人电话:"> |
| | | <uni-easyinput v-model="formData.operatorPhone_dictText" :disabled="true" /> |
| | | </uni-forms-item> |
| | | <uni-forms-item :label-width="80" name="remark" label="备注:"> |
| | | <uni-easyinput v-model="formData.remark" placeholder="请输入备注" :disabled="true" /> |
| | | </uni-forms-item> |
| | | <uni-forms-item :label-width="80" name="outNum" label="保养图片:"> |
| | | <view class="grid col-4 grid-square flex-sub"> |
| | | <view class="bg-img" v-for="(item,index) in imgList" :key="index" @tap="ViewImage" |
| | | :data-url="imgList[index]"> |
| | | <image :src="imgList[index]" mode="aspectFill"></image> |
| | | <view class="cu-tag bg-red radius" @tap.stop="DelImg" :data-index="index"> |
| | | <text class='cuIcon-close'></text> |
| | | </view> |
| | | </view> |
| | | <view class="solids" @tap="ChooseImage" v-if="imgList.length<1"> |
| | | <text class='cuIcon-cameraadd'></text> |
| | | </view> |
| | | </view> |
| | | |
| | | <uni-file-picker limit="9" :value="fileLists" :image-styles="imageStyles" |
| | | :sourceType="sourceType" @select="select" @progress="progress" @success="success" |
| | | @fail="fail" @delete="deletea" /> |
| | | </uni-forms-item> |
| | | <!-- <view class="text-gray margin-bottom-lg">—————————— 班组长确认 ——————————</view> |
| | | <uni-forms-item name="outNum" required label="确认类型:"> |
| | | <uni-data-select :localdata="formData.msListCategory" popup-title="请选择" @change="changeType" |
| | | :clear="false"> |
| | | </uni-data-select> |
| | | </uni-forms-item> |
| | | <uni-forms-item name="outNum" required label="确认意见:"> |
| | | <uni-easyinput type="textarea" v-model="formData.ttitle" placeholder="请输入内容"></uni-easyinput> |
| | | </uni-forms-item> --> |
| | | |
| | | </uni-group> |
| | | </uni-forms> |
| | | |
| | |
| | | |
| | | |
| | | |
| | | |
| | | <view class="text-gray margin-bottom-lg">——————————保养项信息—————————————</view> |
| | | <view class="divider"><text>保养项信息</text></view> |
| | | <!-- <view class="text-gray margin-bottom-lg">——————————保养项信息———————————</view> --> |
| | | <view class="padding flex flex-direction"> |
| | | <button :disabled="isClick" class="mini-btn" type="primary" @click.stop="batchnsIpection()" |
| | | size="mini">批量保养正常</button> |
| | | </view> |
| | | <uni-collapse @change="change"> |
| | | <uni-collapse-item :show-animation="true" :show-arrow="true" :accordion="true" title="查看保养项" :border="false" |
| | | title-border="none" > |
| | | <uni-collapse-item :show-animation="true" :show-arrow="true" :accordion="true" title="查看保养项" |
| | | :border="false" title-border="none"> |
| | | <uni-card margin="10px" spacing="1px" v-for="(item,index) in partTakeAdviceDetailList" :key="index"> |
| | | <view class="flex"> |
| | | <view class="flex-sub text-light bg-white padding-xs margin-xs radius">行号:</view> |
| | |
| | | </view> |
| | | <view class="flex"> |
| | | <view class="flex-sub text-light bg-white padding-xs margin-xs radius">子保养项:</view> |
| | | <view class="flex-sub bg-white padding-xs margin-xs radius text-right" |
| | | v-if="item.subItemName!=null && item.subItemName.length>10"> |
| | | {{(item.subItemName).toString().substr(0,10)+'...'}} |
| | | </view> |
| | | |
| | | <view class="flex-sub bg-white padding-xs margin-xs radius text-right" v-else> |
| | | <view class="flex-sub bg-white padding-xs margin-xs radius text-right"> |
| | | {{item.subItemName}} |
| | | </view> |
| | | </view> |
| | | <view class="flex"> |
| | | <view class="flex-sub text-light bg-white padding-xs margin-xs radius">保养要求:</view> |
| | | <view class="flex-sub bg-white padding-xs margin-xs radius text-right" |
| | | v-if="item.itemDemand!=null && item.itemDemand.length>10"> |
| | | {{(item.itemDemand).toString().substr(0,10)+'...'}} |
| | | </view> |
| | | |
| | | <view class="flex-sub bg-white padding-xs margin-xs radius text-right" v-else> |
| | | <view class="flex-sub bg-white padding-xs margin-xs radius text-right"> |
| | | {{item.itemDemand}} |
| | | </view> |
| | | |
| | | </view> |
| | | <view class="flex"> |
| | | <view class="flex-sub text-light bg-white padding-xs margin-xs radius">是否报修:</view> |
| | | <view class="flex-sub bg-white padding-xs text-right margin-xs radius"> |
| | | <uni-data-select :localdata="item.type" @change="handleType($event, index)" v-model="item.reportFlag" |
| | | :disabled="item.istrue" /> |
| | | </view> |
| | | </view> |
| | | <view class="flex"> |
| | | <view class="flex-sub text-light bg-white padding-xs margin-xs radius">点检结果:</view> |
| | | <view class="flex-sub text-light bg-white padding-xs margin-xs radius">保养结果:</view> |
| | | <view class="flex-sub bg-white padding-xs text-right margin-xs radius"> |
| | | <uni-data-select :localdata="item.restle" v-model="item.maintenanceResult" |
| | | @change="handleCode($event, index)" /> |
| | | </view> |
| | | </view> |
| | | |
| | | <view class="flex"> |
| | | <view class="flex-sub text-light bg-white padding-xs margin-xs radius">是否报修:</view> |
| | | <view class="flex-sub bg-white padding-xs text-right margin-xs radius"> |
| | | <uni-data-select :localdata="item.type" @change="handleType($event, index)" |
| | | v-model="item.reportFlag" :disabled="item.istrue" /> |
| | | </view> |
| | | </view> |
| | | |
| | |
| | | mixins: [MescrollMixin], // 使用mixin |
| | | data() { |
| | | return { |
| | | // 图片回显 |
| | | fileLists: [], |
| | | // 上传图片的样式 |
| | | imageStyles: { |
| | | width: 90, |
| | | height: 90, |
| | | }, |
| | | // uni.chooseImage值,从相册选择,拍摄 |
| | | sourceType: ['album', 'camera'], |
| | | scrollLeft: 0, |
| | | searchValue: '', |
| | | imgList: [], |
| | |
| | | uploadUrl: "/sys/common/upload", |
| | | formData: { |
| | | avatar: [], |
| | | id:'' |
| | | id: '', |
| | | num: '' |
| | | |
| | | }, |
| | | istrue: true, |
| | |
| | | url: { |
| | | upload: "/eam/sysFiles/batch_upload", |
| | | stallList: "/eam/weekMaintenanceOrder/queryById", |
| | | getEquipmentList:'eam/equipment/list', |
| | | getEquipmentList: 'eam/equipment/list', |
| | | // getEquipmentList: "eam/equipment/asyncLoadEquipment", |
| | | BaoList: '/eam/weekMaintenanceOrderDetail/queryList', |
| | | approval: 'eam/weekMaintenanceOrder/approval' |
| | |
| | | msg1Title: "", |
| | | procInstId: '', |
| | | values: '', |
| | | isClick:false |
| | | isClick: false, |
| | | announcement1: {} |
| | | |
| | | } |
| | | }, |
| | |
| | | |
| | | methods: { |
| | | change(e) { |
| | | console.log(e); |
| | | }, |
| | | console.log(e); |
| | | }, |
| | | batchnsIpection() { |
| | | uni.showModal({ |
| | | title: '提示', |
| | |
| | | |
| | | }, |
| | | ProductionTask() { |
| | | if(this.hasInspectionDateArrived()){ |
| | | for (let i = 0; i < this.partTakeAdviceDetailList.length; i++) { |
| | | if (this.partTakeAdviceDetailList[i].maintenanceResult == undefined || this.partTakeAdviceDetailList[i] |
| | | .maintenanceResult == null || this |
| | | .partTakeAdviceDetailList[i].maintenanceResult == '') { |
| | | /* this.$tip.error("请输入领料数量!"); */ |
| | | uni.showToast({ |
| | | icon: 'none', |
| | | title: '点检结果不能为空' |
| | | }); |
| | | return false; |
| | | if (this.hasInspectionDateArrived()) { |
| | | for (let i = 0; i < this.partTakeAdviceDetailList.length; i++) { |
| | | if (this.partTakeAdviceDetailList[i].maintenanceResult == undefined || this |
| | | .partTakeAdviceDetailList[i] |
| | | .maintenanceResult == null || this |
| | | .partTakeAdviceDetailList[i].maintenanceResult == '') { |
| | | uni.showToast({ |
| | | icon: 'none', |
| | | title: '点检结果不能为空' |
| | | }); |
| | | return false; |
| | | } |
| | | } |
| | | } |
| | | |
| | | this.$http.put(this.url.approval, { |
| | | |
| | | confirmComment: '', |
| | | id:this.formData.id, |
| | | confirmDealType: '', |
| | | dataId: this.id, |
| | | imageFiles: null, |
| | | instanceId: this.procInstId, |
| | | tableDetailList: this.partTakeAdviceDetailList, |
| | | taskId: this.taskId, |
| | | userId: this.assignee, |
| | | values: this.values, |
| | | maintenanceDate: this.formData.maintenanceDate, |
| | | creationMethod: this.formData.creationMethod, |
| | | equipmentCode: this.formData.equipmentCode, |
| | | equipmentId: this.formData.num, |
| | | imageFilesResult: this.formData.avatar, |
| | | orderNum: this.formData.orderNum, |
| | | remark: this.formData.remark, |
| | | standardId: this.formData.standardId, |
| | | standardName: this.formData.standardName |
| | | }).then(res => { |
| | | console.log(res) |
| | | this.$tip.loaded(); |
| | | if (res.data.success) { |
| | | |
| | | |
| | | |
| | | for (let i = 0; i < this.partTakeAdviceDetailList.length; i++) { |
| | | if (this.partTakeAdviceDetailList[i].maintenanceResult === "2") { |
| | | if (this.partTakeAdviceDetailList[i].reportFlag === undefined || this |
| | | .partTakeAdviceDetailList[i].reportFlag === null || this.partTakeAdviceDetailList[i] |
| | | .reportFlag === '') { |
| | | const index = i + 1 |
| | | uni.showModal({ |
| | | title: "提示", |
| | | content: '第' + index + '行号是否报修必选', |
| | | confirmText: '确定', |
| | | showCancel: false, |
| | | }) |
| | | return false; |
| | | |
| | | } |
| | | if (this.partTakeAdviceDetailList[i].exceptionDescription == undefined || this |
| | | .partTakeAdviceDetailList[i].exceptionDescription == null || this |
| | | .partTakeAdviceDetailList[i].exceptionDescription == '') { |
| | | const index = i + 1 |
| | | uni.showModal({ |
| | | title: "提示", |
| | | content: '第' + index + '行号异常描述必填', |
| | | confirmText: '确定', |
| | | showCancel: false, |
| | | }) |
| | | return false; |
| | | |
| | | } |
| | | |
| | | |
| | | } |
| | | } |
| | | uni.showLoading({ |
| | | mask: true, |
| | | title: "加载中....", |
| | | }) |
| | | this.$http.put(this.url.approval, { |
| | | |
| | | confirmComment: null, |
| | | id: this.formData.id, |
| | | confirmDealType: null, |
| | | dataId: this.id, |
| | | imageFiles: null, |
| | | instanceId: this.procInstId, |
| | | tableDetailList: this.partTakeAdviceDetailList, |
| | | taskId: this.taskId, |
| | | userId: this.assignee, |
| | | values: this.values, |
| | | maintenanceDate: this.formData.maintenanceDate, |
| | | creationMethod: this.formData.creationMethod, |
| | | equipmentCode: this.formData.equipmentCode, |
| | | equipmentId: this.formData.num, |
| | | imageFilesResult: this.formData.avatar, |
| | | orderNum: this.formData.orderNum, |
| | | remark: this.formData.remark, |
| | | standardId: this.formData.standardId, |
| | | standardName: this.formData.standardName |
| | | }).then(res => { |
| | | uni.hideLoading() |
| | | if (res.data.success) { |
| | | uni.showToast({ |
| | | icon: "success", |
| | | title: '提交成功', |
| | | duration: 2000 |
| | | }); |
| | | this.$Router.replaceAll({ |
| | | name: 'ToDoList' |
| | | }) |
| | | |
| | | } |
| | | }).catch(() => { |
| | | this.$tip.loaded(); |
| | | uni.showToast({ |
| | | icon: "success", |
| | | title: '提交成功', |
| | | icon: "error", |
| | | title: res.data.message, |
| | | duration: 2000 |
| | | }); |
| | | this.$Router.replaceAll({name: 'ToDoList'}) |
| | | |
| | | } |
| | | }).catch(() => { |
| | | this.$tip.loaded(); |
| | | uni.showToast({ |
| | | icon: "error", |
| | | title: res.data.message, |
| | | duration: 2000 |
| | | }); |
| | | }); |
| | | }else{ |
| | | } else { |
| | | uni.showToast({ |
| | | icon: "error", |
| | | title: '未到保养时间', |
| | | duration: 2000 |
| | | }); |
| | | } |
| | | |
| | | |
| | | }, |
| | | |
| | | changeEquipmentList(e) { |
| | | this.formData.num = e; |
| | | }, |
| | | |
| | | handleType(e,index){ |
| | | |
| | | handleType(e, index) { |
| | | console.log(e); |
| | | }, |
| | | handleCode(e, index) { |
| | |
| | | this.partTakeAdviceDetailList[index].istrue = true; |
| | | } |
| | | }, |
| | | getEquipment() { |
| | | this.$http.get(this.url.getEquipmentList, { |
| | | params: { |
| | | pageNo: 1, |
| | | pageSize: 9999, |
| | | order: 'desc', |
| | | column: 'createTime' |
| | | }, |
| | | |
| | | }).then(res => { |
| | | //设置列表数据 |
| | | if (res.data.success) { |
| | | this.equipmentList = res.data.result.records |
| | | } else { |
| | | uni.showToast({ |
| | | icon: "error", |
| | | title: res.data.message, |
| | | duration: 2000 |
| | | }); |
| | | |
| | | } |
| | | }).catch(() => { |
| | | this.$tip.error("联网失败") |
| | | }) |
| | | }, |
| | | // getEquipment() { |
| | | // this.$http.get(this.url.getEquipmentList).then(res => { |
| | | // //设置列表数据 |
| | | // if (res.data.success) { |
| | | // this.equipmentList = res.data.result |
| | | // } else { |
| | | // uni.showToast({ |
| | | // icon: "error", |
| | | // title: res.data.message, |
| | | // duration: 2000 |
| | | // }); |
| | | getEquipment() { |
| | | this.$http.get(this.url.getEquipmentList, { |
| | | params: { |
| | | pageNo: 1, |
| | | pageSize: 9999, |
| | | order: 'desc', |
| | | column: 'createTime' |
| | | }, |
| | | |
| | | // } |
| | | // }).catch(() => { |
| | | // this.$tip.error("联网失败") |
| | | // }) |
| | | // }, |
| | | }).then(res => { |
| | | //设置列表数据 |
| | | if (res.data.success) { |
| | | this.equipmentList = res.data.result.records |
| | | } else { |
| | | uni.showToast({ |
| | | icon: "error", |
| | | title: res.data.message, |
| | | duration: 2000 |
| | | }); |
| | | |
| | | } |
| | | }).catch(() => { |
| | | this.$tip.error("联网失败") |
| | | }) |
| | | }, |
| | | getList() { |
| | | this.$http.get(this.url.BaoList, { |
| | | params: { |
| | |
| | | //联网失败, 结束加载 |
| | | }) |
| | | }, |
| | | ChooseImage() { |
| | | var that = this; |
| | | uni.chooseImage({ |
| | | count: 4, |
| | | sizeType: ['original', 'compressed'], // 可以指定是原图还是压缩图,默认二者都有 |
| | | sourceType: ['album'], // 从相册选择 |
| | | success: (res) => { |
| | | // 存储选择的图片路径 |
| | | that.imgList = res.tempFilePaths; |
| | | |
| | | // 初始化 formData.avatar 为空字符串 |
| | | that.formData.avatar = []; |
| | | |
| | | // 创建上传任务的 Promise 数组 |
| | | const uploadPromises = res.tempFilePaths.map((filePath, index) => { |
| | | return new Promise((resolve, reject) => { |
| | | that.$http.upload(that.url.upload, { |
| | | filePath: filePath, |
| | | name: 'file' |
| | | }) |
| | | .then(uploadRes => { |
| | | // 假设服务器返回的结果中包含文件路径 |
| | | const filePath = uploadRes.data.result[0]; |
| | | this.formData.avatar.push(filePath); |
| | | resolve(filePath); |
| | | }) |
| | | .catch(err => { |
| | | console.error('图片' + index + '上传失败:', err); |
| | | reject(err); |
| | | }); |
| | | }); |
| | | }); |
| | | |
| | | // 并发执行所有上传任务 |
| | | Promise.all(uploadPromises) |
| | | .then((uploadedFilePaths) => { |
| | | console.log('所有图片上传成功:', that.formData.avatar); |
| | | select(e) { |
| | | const tempFilePaths = e.tempFilePaths; |
| | | uni.showLoading({ |
| | | title: '上传中...' |
| | | }); |
| | | const uploadPromises = tempFilePaths.map((filePath, index) => { |
| | | return new Promise((resolve, reject) => { |
| | | this.$http.upload(this.url.upload, { |
| | | filePath: filePath, |
| | | name: 'file' |
| | | }) |
| | | .catch((err) => { |
| | | console.error('图片上传失败:', err); |
| | | that.$tip.error('图片上传失败'); |
| | | .then(uploadRes => { |
| | | // 假设服务器返回的结果中包含文件路径 |
| | | const serverFilePath = uploadRes.data.result[0]; |
| | | this.formData.avatar.push(serverFilePath); |
| | | resolve(uploadRes); // 返回结果给 Promise.all |
| | | }) |
| | | .catch(err => { |
| | | console.error(`图片 ${index + 1} 上传失败:`, err); |
| | | reject(err); |
| | | }); |
| | | } |
| | | }); |
| | | }); |
| | | |
| | | Promise.all(uploadPromises) |
| | | .then(() => { |
| | | uni.hideLoading(); |
| | | uni.showToast({ |
| | | title: '全部上传成功' |
| | | }); |
| | | }) |
| | | .catch(err => { |
| | | uni.hideLoading(); |
| | | uni.showToast({ |
| | | title: '部分上传失败', |
| | | icon: 'none' |
| | | }); |
| | | console.error('上传异常:', err); |
| | | }); |
| | | }, |
| | | ViewImage(e) { |
| | | uni.previewImage({ |
| | | urls: this.imgList, |
| | | current: e.currentTarget.dataset.url |
| | | }); |
| | | }, |
| | | DelImg(e) { |
| | | uni.showModal({ |
| | | title: '提示', |
| | | content: '确定要删除这段回忆吗?', |
| | | cancelText: '再看看', |
| | | confirmText: '再见', |
| | | success: res => { |
| | | if (res.confirm) { |
| | | this.imgList.splice(e.currentTarget.dataset.index, 1) |
| | | } |
| | | } |
| | | }) |
| | | |
| | | |
| | | |
| | | // 删除 |
| | | deletea(e) { |
| | | console.log('删除图片', e); |
| | | }, |
| | | |
| | | upCallback() { |
| | |
| | | params: { |
| | | id: this.id |
| | | }, |
| | | |
| | | }).then(res => { |
| | | this.announcement1 = res.data.result |
| | | console.log("url", res) |
| | | //设置列表数据 |
| | | if (res.data.success) { |
| | | console.log("res", res.data.result.equipmentCode) |
| | | this.formData.num = this.announcement1.equipmentId, |
| | | this.formData.orderNum = this.announcement1.orderNum, |
| | | this.formData.operator = this.announcement1.operator_dictText, |
| | | this.formData.maintenanceDate = this.announcement1.maintenanceDate, |
| | | this.formData.id=this.announcement1.id, |
| | | this.formData.remark = this.announcement1.remark |
| | | this.hasInspectionDateArrived(); |
| | | this.formData.num = this.announcement1.equipmentId |
| | | this.formData.orderNum = this.announcement1.orderNum |
| | | this.formData.operator = this.announcement1.operator_dictText |
| | | this.formData.installationPosition_dictText = this.announcement1 |
| | | .installationPosition_dictText |
| | | this.formData.maintenanceStatus_dictText = this.announcement1.maintenanceStatus_dictText |
| | | this.formData.operatorPhone_dictText = this.announcement1.operatorPhone_dictText |
| | | this.formData.maintenanceDate = this.announcement1.maintenanceDate |
| | | this.formData.id = this.announcement1.id |
| | | this.formData.remark = this.announcement1.remark |
| | | this.hasInspectionDateArrived(); |
| | | } |
| | | }).catch(() => { |
| | | //联网失败, 结束加载 |
| | |
| | | margin-top: 85px; |
| | | height: auto; |
| | | } |
| | | |
| | | .divider { |
| | | display: flex; |
| | | align-items: center; |
| | | text-align: center; |
| | | color: gray; |
| | | /* 文字颜色 */ |
| | | margin: 20px 0; |
| | | /* 上下间距 */ |
| | | } |
| | | |
| | | .divider::before, |
| | | .divider::after { |
| | | content: ''; |
| | | flex: 1; |
| | | border-bottom: 1px solid gray; |
| | | /* 横线颜色 */ |
| | | margin: 0 16px; |
| | | /* 横线与文字之间的间距 */ |
| | | } |
| | | |
| | | .divider text { |
| | | white-space: nowrap; |
| | | /* 防止文字换行 */ |
| | | } |
| | | </style> |