<template>
|
<view class="container">
|
<cu-custom :bgColor="NavBarColor" :isBack="true" backRouterName="productionTask">
|
<block slot="backText">返回</block>
|
<block slot="content">{{title}}</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="divider"><text>基本信息</text></view>
|
<!-- <view class="text-gray margin-bottom-lg">—————————— 基本信息 ——————————</view> -->
|
<uni-forms-item :label-width="80" name="num" label="工单号:">
|
<uni-easyinput v-model="formData.orderNum" :disabled="true" />
|
</uni-forms-item>
|
<uni-forms-item :label-width="80" required name="num" label="设备编号:">
|
<uni-data-select v-model="formData.num" :localdata="equipmentList" @change="changeEquipmentList"
|
placeholder="请选择" :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="80" name="remark" label="备注:">
|
<uni-easyinput v-model="formData.remark" :disabled="true" />
|
</uni-forms-item>
|
<uni-forms-item :label-width="80" name="outNum" label="保养图片:">
|
<uni-file-picker limit="9" :value="fileLists" :image-styles="imageStyles"
|
:sourceType="sourceType" @select="select" @progress="progress" @success="success"
|
@fail="fail" @delete="deletea" :readonly="readonly" />
|
</uni-forms-item>
|
|
</uni-group>
|
</uni-forms>
|
<!-- <view class="text-gray margin-bottom-lg">—————————— 保养项信息 ——————————</view> -->
|
<view class="divider"><text>保养项信息</text></view>
|
<uni-collapse>
|
<uni-collapse-item :show-animation="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 class="flex-sub bg-white padding-xs margin-xs radius text-right">{{index+1}}
|
</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 text-bold radius text-right">
|
{{item.itemName}}
|
</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">
|
{{item.subItemName}}
|
</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>
|
{{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">
|
{{item.itemDemand}}
|
</view>
|
<!-- <zb-tooltip placement="left" ref="tooltip7" >
|
<view slot="content">
|
<view class="flex-sub bg-white padding-xs margin-xs radius text-right">
|
{{item.itemDemand}}
|
</view>
|
</view>
|
<view >
|
<button size="mini">更多</button >
|
</view>
|
</zb-tooltip> -->
|
<!-- <view class="flex-sub bg-white padding-xs margin-xs radius text-right" v-else>
|
{{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="handType($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 bg-white padding-xs text-right margin-xs radius">
|
<uni-data-select :localdata="item.restle" v-model="item.maintenanceResult"
|
@change="handleCode($event, index)" :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 bg-white padding-xs text-right margin-xs radius">
|
<uni-easyinput v-model="item.exceptionDescription" :disabled="item.istrue" />
|
</view>
|
</view>
|
</uni-card>
|
</uni-collapse-item>
|
</uni-collapse>
|
|
|
<uni-forms ref="form" :modelValue="ScanData" validate-trigger="bind" err-show-type="undertext">
|
<uni-group top="1">
|
<view class="divider"><text>班组长确认信息</text></view>
|
<!-- <view class="text-gray margin-bottom-lg">—————————班组长确认信息——————————</view> -->
|
<uni-forms-item :label-width="80" required name="typeName" label="确认类型:">
|
<uni-data-select v-model="ScanData.typeName" :localdata="ScanData.handlingType"
|
@change="changehandlingType" placeholder="请选择" :disabled="isShowSure" />
|
</uni-forms-item>
|
<uni-forms-item :label-width="80" required name="handlingSuggestion" label="确认意见:">
|
<uni-easyinput type="textarea" v-model="ScanData.handlingSuggestion" :disabled="isShowSure" />
|
</uni-forms-item>
|
|
</uni-group>
|
</uni-forms>
|
<uni-forms v-show="isHideFist" ref="form" :modelValue="ScanData" validate-trigger="bind"
|
err-show-type="undertext">
|
<uni-group top="1">
|
<view class="divider"><text>初验收信息</text></view>
|
|
<uni-forms-item :label-width="80" required name="initialAcceptanceComment" label="初审意见:">
|
<uni-easyinput type="textarea" v-model="ScanData.initialAcceptanceComment" placeholder="请输入意见"
|
:disabled="isShowLast" />
|
</uni-forms-item>
|
<uni-forms-item :label-width="80" required name="randomInspectionFlag" label="抽检标记:">
|
<uni-data-select v-model="ScanData.InspectionFlagName"
|
:localdata="ScanData.randomInspectionFlagList" @change="changehandlingInspectionFlag"
|
placeholder="请选择" :disabled="isShowSure" />
|
</uni-forms-item>
|
<uni-forms-item :label-width="80" name="outNum" label="初验收附件:">
|
<uni-file-picker limit="9" :value="fileList" :image-styles="imageStyles"
|
:sourceType="sourceType" @select="selectFirst" @progress="progress" @success="success"
|
@fail="fail" @delete="deleteFirst" :readonly="readonlyFirst" />
|
</uni-forms-item>
|
</uni-group>
|
</uni-forms>
|
<uni-forms v-show="isHideLast" ref="form" :modelValue="ScanData" validate-trigger="bind"
|
err-show-type="undertext">
|
<uni-group top="1">
|
<view class="divider"><text>终验收信息</text></view>
|
<uni-forms-item :label-width="80" required name="finalAcceptanceComment" label="终验收意见:">
|
<uni-easyinput type="textarea" v-model="ScanData.finalAcceptanceComment" placeholder="请输入意见"
|
:disabled="isfinal" />
|
</uni-forms-item>
|
<uni-forms-item :label-width="80" required name="finalFlagName" label="抽检标记:">
|
<uni-data-select v-model="ScanData.finalFlagName" :localdata="ScanData.finalInspectionFlagList"
|
@change="changehandlingFinalFlag" placeholder="请选择" :disabled="isfinal" />
|
</uni-forms-item>
|
<uni-forms-item :label-width="80" name="outNum" label="终验收附件:">
|
<uni-file-picker limit="9" :value="fileListFanl" :image-styles="imageStyles"
|
:sourceType="sourceType" @select="selectFirstFanl" @progress="progress" @success="success"
|
@fail="fail" @delete="deleteFanl" :readonly="readonlyFirstFanl" />
|
</uni-forms-item>
|
</uni-group>
|
</uni-forms>
|
<view v-show="isShowBtn" class="padding flex flex-direction">
|
<view class="flex-sub bg-blue padding-sm margin-xl radius text-sm text-center text-white"
|
@click.stop="ProductionTask()" hover-class="is-hover">确定</view>
|
</view>
|
|
</view>
|
</view>
|
</template>
|
|
<script>
|
import configService from "@/common/service/config.service.js";
|
import MescrollMixin from "@/components/mescroll-uni/mescroll-mixins.js";
|
export default {
|
mixins: [MescrollMixin], // 使用mixin
|
data() {
|
return {
|
readonly: false,
|
readonlyFirstFanl: false,
|
readonlyFirst: false,
|
// 图片回显
|
fileLists: [],
|
fileList: [],
|
fileListFanl: [],
|
// 上传图片的样式
|
imageStyles: {
|
width: 90,
|
height: 90,
|
},
|
// uni.chooseImage值,从相册选择,拍摄
|
sourceType: ['album', 'camera'],
|
title: '',
|
isShowBtn: true,
|
isHideLast: false,
|
isHideFist: false,
|
isShowSure: false,
|
scrollLeft: 0,
|
isfinal: false,
|
searchValue: '',
|
imgList: [],
|
imgListinitialAccept: [],
|
imgListfinalAcceptanceFilesResult: [],
|
equipmentList: [],
|
uploadUrl: "/sys/common/upload",
|
ScanData: {
|
InspectionFlagName: '',
|
finalFlagName: '',
|
typeName: '',
|
initialAcceptanceComment: '',
|
handlingType: [{
|
text: "通过",
|
value: "1"
|
},
|
{
|
text: "驳回",
|
value: "2"
|
}
|
],
|
randomInspectionFlagList: [{
|
text: "否",
|
value: '0'
|
},
|
{
|
text: "是",
|
value: '1'
|
}
|
],
|
finalInspectionFlagList: [{
|
text: "否",
|
value: '0'
|
},
|
{
|
text: "是",
|
value: '1'
|
}
|
],
|
handlingSuggestion: ''
|
},
|
formData: {
|
avatar: [],
|
avatarFile: [],
|
avatarFinal: [],
|
initialAcceptanceFiles: [],
|
finalAcceptanceFiles: [],
|
id: '',
|
maintenanceStatus: ''
|
},
|
istrue: true,
|
ipAndPort: configService.staticURL,
|
partTakeAdviceDetailList: [],
|
NavBarColor: this.NavBarColor,
|
url: {
|
upload: "/eam/sysFiles/batch_upload",
|
stallList: "/eam/weekMaintenanceOrder/queryById",
|
getEquipmentList: 'eam/equipment/list',
|
BaoList: '/eam/weekMaintenanceOrderDetail/queryList',
|
approval: 'eam/weekMaintenanceOrder/approval'
|
},
|
id: '',
|
taskId: '',
|
inspectionResult: '',
|
upOption: {
|
page: {
|
num: 0, // 当前页码,默认0,回调之前会加1,即callback(page)会从1开始
|
size: 10 // 每页数据的数量
|
},
|
noMoreSize: 4, //如果列表已无数据,可设置列表的总数量要大于半页才显示无更多数据;避免列表数据过少(比如只有一条数据),显示无更多数据会不好看; 默认5
|
empty: {
|
tip: '~ 暂无数据 ~', // 提示
|
},
|
loading: '',
|
text: '全部',
|
isShowNoMore: false,
|
textNoMore: '我是有底线的 >_<'
|
},
|
styles: {
|
color: '#2979FF',
|
borderColor: '#2979FF'
|
},
|
isShowLast: false,
|
msg1Count: 0,
|
msg2Count: 0,
|
msg1Title: "",
|
procInstId: '',
|
values: '',
|
flag: '',
|
imageFiles: '',
|
imageObjectInIt: [],
|
imageFilesList: [],
|
imageObjectFinal: [],
|
imageFilesnitialAcceptList: []
|
}
|
},
|
computed: {
|
top() {
|
return this.CustomBar * 2 + 160
|
},
|
style() {
|
var StatusBar = this.StatusBar;
|
var CustomBar = this.CustomBar;
|
var style = `height:${CustomBar}px;padding-top:${StatusBar}px;`;
|
return style
|
},
|
},
|
onLoad(options) {
|
const annItem = JSON.parse(decodeURIComponent(options.item));
|
this.flag = options.flag
|
console.log(this.flag)
|
this.variables = annItem.variables
|
this.id = annItem.dataId
|
this.taskId = annItem.id
|
this.procInstId = annItem.procInstId
|
this.assignee = annItem.assignee
|
},
|
created() {
|
this.getEquipment();
|
this.getList();
|
this.upCallback();
|
},
|
|
methods: {
|
|
changehandlingFinalFlag(e) {
|
this.ScanData.finalFlagName = e;
|
},
|
changehandlingType(e) {
|
this.ScanData.typeName = e;
|
},
|
changehandlingInspectionFlag(e) {
|
this.ScanData.InspectionFlagName = e;
|
},
|
handType(e, index) {
|
console.log(e)
|
|
},
|
ProductionTask() {
|
if (this.formData.maintenanceStatus == 'WAIT_FINAL_ACCEPTANCE') {
|
|
if (this.ScanData.finalAcceptanceComment == undefined || this.ScanData.finalAcceptanceComment ==
|
null || this.ScanData.finalAcceptanceComment ==
|
'') {
|
|
uni.showToast({
|
icon: 'none',
|
title: '请输入终验收意见!'
|
});
|
return false;
|
}
|
}
|
if (this.formData.maintenanceStatus == 'WAIT_INITIAL_ACCEPTANCE') {
|
|
if (this.ScanData.initialAcceptanceComment == undefined || this.ScanData.initialAcceptanceComment ==
|
null || this.ScanData.acceptanceComment ==
|
'') {
|
|
uni.showToast({
|
icon: 'none',
|
title: '请输入初验收意见!'
|
});
|
return false;
|
}
|
}
|
if (this.formData.maintenanceStatus == 'WAIT_CONFIRM' && this.flag != 'task') {
|
|
if (this.ScanData.typeName == undefined || this.ScanData.typeName == null || this.ScanData.typeName ==
|
'') {
|
|
uni.showToast({
|
icon: 'none',
|
title: '确认类型不能为空'
|
});
|
return false;
|
}
|
if (this.ScanData.handlingSuggestion == undefined || this.ScanData.handlingSuggestion == null || this
|
.ScanData.handlingSuggestion ==
|
'') {
|
|
uni.showToast({
|
icon: 'none',
|
title: '确认意见不能为空'
|
});
|
return false;
|
}
|
|
}
|
uni.showLoading({
|
mask: true,
|
title: "加载中....",
|
})
|
this.$http.put(this.url.approval, {
|
finalAcceptanceFilesResult: this.formData.avatarFinal,
|
finalAcceptanceComment: this.ScanData.finalAcceptanceComment,
|
initialAcceptanceFilesResult: this.formData.avatarFile,
|
initialAcceptanceComment: this.ScanData.initialAcceptanceComment,
|
confirmComment: this.ScanData.handlingSuggestion,
|
confirmDealType: this.ScanData.typeName,
|
id: this.formData.id,
|
dataId: this.id,
|
randomInspectionFlag: this.ScanData.InspectionFlagName,
|
instanceId: this.procInstId,
|
tableDetailList: this.partTakeAdviceDetailList,
|
taskId: this.taskId,
|
userId: this.assignee,
|
finalRandomInspectionFlag: this.ScanData.finalFlagName,
|
maintenanceDate: this.formData.maintenanceDate,
|
equipmentId: this.formData.num,
|
imageFilesResult: this.imageFilesList,
|
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.replace({
|
// name: 'ToDoList'
|
// })
|
this.$Router.replaceAll({
|
name: 'ToDoList'
|
})
|
}
|
}).catch(() => {
|
this.$tip.loaded();
|
uni.showToast({
|
icon: "error",
|
title: '提交失败',
|
duration: 2000
|
});
|
});
|
},
|
|
changeEquipmentList(e) {
|
this.formData.num = e;
|
},
|
handleCode(e, index) {
|
console.log(index);
|
// 根据 e 的值来判断是否需要更新 isTrue 的状态
|
if (e == '2') {
|
this.partTakeAdviceDetailList[index].istrue = false;
|
} else if (e == '1') {
|
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("联网失败")
|
})
|
},
|
getList() {
|
this.$http.get(this.url.BaoList, {
|
params: {
|
orderId: this.id
|
},
|
|
}).then(res => {
|
this.partTakeAdviceDetailList = res.data.result;
|
const restle = [];
|
this.partTakeAdviceDetailList.forEach(item => {
|
item.restle = [{
|
text: "正常",
|
value: '1'
|
},
|
{
|
text: "异常",
|
value: '2'
|
}
|
]; // 新字段,值为一个空数组
|
item.type = [{
|
text: "否",
|
value: '0'
|
},
|
{
|
text: "是",
|
value: '1'
|
}
|
]; // 新字段,值为一个空数组
|
item.istrue = true;
|
});
|
console.log("url", res)
|
//设置列表数据
|
if (res.data.success) {
|
console.log("res", res.data.result)
|
|
}
|
}).catch(() => {
|
//联网失败, 结束加载
|
})
|
},
|
|
|
|
|
selectFirst(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'
|
})
|
.then(uploadRes => {
|
// 假设服务器返回的结果中包含文件路径
|
const serverFilePath = uploadRes.data.result[0];
|
this.formData.avatarFile.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: '部分上传失败111',
|
icon: 'none'
|
});
|
console.error('上传异常:', err);
|
});
|
},
|
selectFirstFanl(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'
|
})
|
.then(uploadRes => {
|
// 假设服务器返回的结果中包含文件路径
|
const serverFilePath = uploadRes.data.result[0];
|
this.formData.avatarFinal.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: '部分上传失败222',
|
icon: 'none'
|
});
|
console.error('上传异常:', err);
|
});
|
},
|
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'
|
})
|
.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);
|
});
|
},
|
|
// 删除
|
deletea(e) {
|
console.log('删除图片', e);
|
},
|
|
// 删除
|
deleteFirst(e) {
|
console.log('删除图片', e);
|
},
|
|
deleteFanl(e) {
|
console.log('删除图片', e);
|
},
|
upCallback() {
|
console.log(configService.staticURL)
|
this.$http.get(this.url.stallList, {
|
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.remark = this.announcement1.remark
|
this.ScanData.finalAcceptanceComment = this.announcement1.finalAcceptanceComment
|
if (this.announcement1.randomInspectionFlag != null) {
|
this.ScanData.InspectionFlagName = this.announcement1.randomInspectionFlag
|
}
|
|
if (this.announcement1.finalRandomInspectionFlag != null) {
|
this.ScanData.finalFlagName = this.announcement1.finalRandomInspectionFlag
|
}
|
this.formData.maintenanceStatus = this.announcement1.maintenanceStatus
|
|
switch (this.formData.maintenanceStatus) {
|
/**
|
* 初检
|
*/
|
case 'WAIT_INITIAL_ACCEPTANCE':
|
if (this.flag == 'task') {
|
this.title = '详情'
|
this.readonly = true;
|
this.readonlyFirst = true;
|
this.isShowSure = true;
|
this.isHideFist = true;
|
this.isShowLast = true;
|
this.isShowBtn = false;
|
} else {
|
this.title = '初检'
|
this.readonly = true
|
this.isShowSure = true;
|
this.isHideFist = true;
|
}
|
|
break
|
/**
|
* 终验
|
*/
|
case 'WAIT_FINAL_ACCEPTANCE':
|
if (this.flag == 'task') {
|
this.title = '终验'
|
this.readonly = true
|
this.readonlyFirst = true
|
this.isHideFist = true;
|
this.isShowLast = true;
|
this.isShowSure = true;
|
this.isHideLast = true;
|
this.isShowBtn = false;
|
this.isfinal = true;
|
this.readonlyFirstFanl = true;
|
} else {
|
this.title = '设能部终验'
|
this.readonly = true
|
this.readonlyFirst = true
|
this.isHideFist = true;
|
this.isShowLast = true;
|
this.isShowSure = true;
|
this.isHideLast = true;
|
}
|
|
break
|
/**
|
* 执行
|
*/
|
case 'WAIT_CONFIRM':
|
|
if (this.flag == 'task') {
|
this.title = '详情'
|
this.readonly = true
|
this.isHideLast = false
|
this.isHideFist = false
|
this.isShowBtn = false
|
this.isShowSure = true
|
} else {
|
this.title = '班组长确认'
|
this.isHideLast = false
|
this.readonly = true
|
this.isHideFist = false
|
this.isShowBtn = true
|
this.isShowSure = false
|
}
|
|
break
|
case 'COMPLETE':
|
this.isShowSure = true;
|
this.isHideLast = true
|
this.isHideFist = true
|
this.isShowLast = true
|
this.isfinal = true
|
this.readonlyFirst = true
|
this.readonly = true
|
this.readonlyFirstFanl = true
|
this.isShowBtn = false
|
this.title = '详情'
|
break
|
}
|
this.ScanData.initialAcceptanceComment = this.announcement1.initialAcceptanceComment
|
this.ScanData.typeName = this.announcement1.confirmDealType
|
this.formData.id = this.announcement1.id
|
this.ScanData.handlingSuggestion = this.announcement1.confirmComment
|
if (this.announcement1.imageFiles) {
|
try {
|
const parsedDataFile = JSON.parse(this.announcement1.imageFiles);
|
this.imageFilesList = parsedDataFile;
|
|
this.imgList = parsedDataFile.map(imageObj => {
|
return `${this.ipAndPort}${imageObj.filePath}`;
|
});
|
|
this.fileLists = this.imgList.map(url => ({
|
url: url,
|
extname: 'png',
|
name: 'eam'
|
}));
|
} catch (error) {
|
console.error('JSON 解析失败:', error);
|
this.imageObjectFinal = [];
|
this.imgListfinalAcceptanceFilesResult = [];
|
this.fileListFanl = [];
|
}
|
} else {
|
// 当值为 null 或空字符串时初始化为空数组
|
this.imageObjectFinal = [];
|
this.imgListfinalAcceptanceFilesResult = [];
|
this.fileListFanl = [];
|
}
|
|
|
|
|
|
if (this.announcement1.initialAcceptanceFiles) {
|
try {
|
const parsedDataIn = JSON.parse(this.announcement1.initialAcceptanceFiles);
|
this.imageObjectInIt = parsedDataIn;
|
|
this.imgListinitialAccept = parsedDataIn.map(imageObj => {
|
return `${this.ipAndPort}${imageObj.filePath}`;
|
});
|
|
this.fileList = this.imgListinitialAccept.map(url => ({
|
url: url,
|
extname: 'png',
|
name: 'eam'
|
}));
|
} catch (error) {
|
console.error('JSON 解析失败:', error);
|
this.imageObjectInIt = [];
|
this.imgListinitialAccept = [];
|
this.fileList = [];
|
}
|
} else {
|
// 处理空值情况
|
this.imageObjectInIt = [];
|
this.imgListinitialAccept = [];
|
this.fileList = [];
|
}
|
|
|
console.log('finalAcceptanceFiles:', this.announcement1.finalAcceptanceFiles);
|
|
// 判断是否为 null 或 空字符串
|
if (this.announcement1.finalAcceptanceFiles) {
|
try {
|
const parsedData = JSON.parse(this.announcement1.finalAcceptanceFiles);
|
this.imageObjectFinal = parsedData;
|
|
this.imgListfinalAcceptanceFilesResult = parsedData.map(imageObj => {
|
return `${this.ipAndPort}${imageObj.filePath}`;
|
});
|
|
this.fileListFanl = this.imgListfinalAcceptanceFilesResult.map(url => ({
|
url: url,
|
extname: 'png',
|
name: 'eam'
|
}));
|
} catch (error) {
|
console.error('JSON 解析失败:', error);
|
this.imageObjectFinal = [];
|
this.imgListfinalAcceptanceFilesResult = [];
|
this.fileListFanl = [];
|
}
|
} else {
|
// 当值为 null 或空字符串时初始化为空数组
|
this.imageObjectFinal = [];
|
this.imgListfinalAcceptanceFilesResult = [];
|
this.fileListFanl = [];
|
}
|
|
}
|
}).catch(() => {
|
//联网失败, 结束加载
|
})
|
},
|
|
|
|
/* 检索 */
|
getSera(res) {
|
this.msgList = [];
|
if (keyword == 0) {
|
this.$http.get(this.url.stallList, {
|
params: {
|
pageNo: 1,
|
pageSize: 999,
|
order: "desc",
|
column: "createTime",
|
equipmentCode: res
|
}
|
}).then(res => {
|
//联网成功的回调,隐藏下拉刷新和上拉加载的状态;
|
|
this.announcement1 = res.data.result.records
|
this.mescroll.endSuccess(this.announcement1.length);
|
console.log("url", res)
|
//设置列表数据
|
if (res.data.success) {
|
console.log("res", res.data)
|
this.msg1Count = res.data.result.total
|
this.msg1Title = "通知(" + res.data.result.total + ")";
|
for (let annItem of this.announcement1) {
|
this.msgList.push(annItem)
|
}
|
}
|
if (page.num == 1) {
|
this.msgList = []; //如果是第一页需手动制空列表
|
this.msgList = this.msgList.concat(this.announcement1); //追加新数据
|
}
|
|
}).catch(() => {
|
//联网失败, 结束加载
|
this.mescroll.endErr();
|
})
|
}
|
},
|
|
mescrollInit(mescroll) {
|
console.log('mescrollInit')
|
this.mescroll = mescroll;
|
},
|
},
|
|
}
|
</script>
|
|
<style>
|
.is-hover {
|
color: rgba(255, 255, 255, 0.6);
|
background-color: #55aaff;
|
border-color: #55aaff;
|
}
|
|
|
|
.content {
|
margin-top: 5px;
|
}
|
|
.content scroll-view {
|
scrollIndicator: "none"
|
}
|
|
.popupView {
|
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>
|