数据更新下载优化
This commit is contained in:
parent
5f4dc9cc68
commit
7be0662788
|
|
@ -3091,9 +3091,13 @@
|
|||
<view> 问题描述:</view>
|
||||
</view>
|
||||
<view class="querybox_title2">
|
||||
<csr-uni-data-select :multiple="false" :filterable="false" v-model="formdata.issue" placeholder="选择问题描述"
|
||||
dataKey="issue" dataValue="issue" :localdata="standardCommonIssueslist" :clear="false"
|
||||
@change="standardCommonIssuechange"></csr-uni-data-select>
|
||||
<!-- <niceui-data-select-input v-model="formdata.issue"
|
||||
:localdata="standardCommonIssueslist"></niceui-data-select-input> -->
|
||||
<!-- <sh-select labelKey="issue" valueKey="issue" :localdata="standardCommonIssueslist"
|
||||
v-model="formdata.issue" search :allowCreate="true" /> -->
|
||||
<csr-uni-data-select :multiple="false" :filterable="true" v-model="formdata.issue" dataKey="issue"
|
||||
dataValue="issue" :localdata="standardCommonIssueslist" :clear="true" :allowCreate="true"
|
||||
:placeholder="formdata.issue||'选择问题描述'" @change="standardCommonIssuechange"></csr-uni-data-select>
|
||||
</view>
|
||||
</view>
|
||||
</uni-col>
|
||||
|
|
@ -3183,6 +3187,7 @@
|
|||
parseObjectToArray,
|
||||
savebendiImage,
|
||||
} from '@/utils/util'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
UniMenu,
|
||||
|
|
@ -3397,7 +3402,8 @@
|
|||
this.formdata.voiceUrl = '';
|
||||
},
|
||||
|
||||
parseStr(str, resultInfo = "") {
|
||||
parseStr(str, resultInfo = "", showval = true) {
|
||||
//str--字符串 resultInfo--值 showval--是否清空值(保存并添加时用的)
|
||||
const regex = /\{(\d+)\}/g;
|
||||
const matches = [];
|
||||
let match;
|
||||
|
|
@ -3434,7 +3440,7 @@
|
|||
|
||||
// 构建list数组
|
||||
const list = matches.map((match, index) => ({
|
||||
value: index < values.length ? values[index] : '',
|
||||
value: showval ? index < values.length ? values[index] : '' : '',
|
||||
maxvalue: parseInt(match.number, 10),
|
||||
dw: index === matches.length - 1 ? dw : ''
|
||||
}));
|
||||
|
|
@ -3483,6 +3489,7 @@
|
|||
let jsonlist = fujianjson.fubiaolist;
|
||||
this.fubiaoobj.jsonmap = jsonlist.filter(item => item.attachmentType == objitem.attachmentType)[0]
|
||||
this.fubiaoobj.datalist = this.parseObjectToArray(this.fubiaoobj.jsonmap.data);
|
||||
console.log('456654645', this.fubiaoobj);
|
||||
} else {
|
||||
let jsonlist = fujianjson.fubiaolist;
|
||||
this.fubiaoobj.jsonmap = jsonlist.filter(item => item.attachmentType == objitem.attachmentType)[0]
|
||||
|
|
@ -3622,6 +3629,21 @@
|
|||
this.$modal.msgError("抽查情况不能为空!")
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.formdata.materialActivityFiles) {
|
||||
let returnshow = false;
|
||||
for (let cc of this.formdata.materialActivityFiles) {
|
||||
if (cc.resultType === '' || cc.resultType === null) {
|
||||
returnshow = true;
|
||||
this.$modal.msgError("现场验收不能为空!")
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (returnshow) return;
|
||||
}
|
||||
|
||||
|
||||
for (let mm of this.locationslist) {
|
||||
mm.selectFlag = null;
|
||||
}
|
||||
|
|
@ -3635,7 +3657,7 @@
|
|||
}
|
||||
}
|
||||
|
||||
if (this.formdata.imgUrlbase64list) {
|
||||
if (this.formdata.imgUrlbase64list && typeof this.formdata.imgUrlbase64list !== "string") {
|
||||
this.formdata.imgUrlbase64list = JSON.stringify(this.formdata.imgUrlbase64list);
|
||||
}
|
||||
this.formdata.locations = JSON.stringify(this.locationslist);
|
||||
|
|
@ -3663,7 +3685,7 @@
|
|||
} else {
|
||||
this.formdata.padstatus = '2'
|
||||
}
|
||||
if (this.formdata.materialActivityFiles) {
|
||||
if (this.formdata.materialActivityFiles && typeof this.formdata.materialActivityFiles !== "string") {
|
||||
this.formdata.materialActivityFiles = JSON.stringify(this.formdata.materialActivityFiles)
|
||||
}
|
||||
if (this.fubiaoobj) {
|
||||
|
|
@ -3788,12 +3810,27 @@
|
|||
this.$modal.msgError("抽查情况不能为空!")
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.formdata.materialActivityFiles) {
|
||||
let returnshow = false;
|
||||
for (let cc of this.formdata.materialActivityFiles) {
|
||||
if (cc.resultType === '' || cc.resultType === null) {
|
||||
returnshow = true;
|
||||
this.$modal.msgError("现场验收不能为空!")
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (returnshow) return;
|
||||
}
|
||||
|
||||
const baocunitem = JSON.parse(JSON.stringify(this.formdata));
|
||||
for (let mm of this.locationslist) {
|
||||
mm.selectFlag = null;
|
||||
}
|
||||
|
||||
if (this.formdata.checkPointids) {
|
||||
for (let m of this.formdata.checkPointids) {
|
||||
if (baocunitem.checkPointids) {
|
||||
for (let m of baocunitem.checkPointids) {
|
||||
let index = this.locationslist.findIndex(element => element.standardLocationId ==
|
||||
m); // 使用 findIndex 直接获取索引
|
||||
if (index != -1) {
|
||||
|
|
@ -3803,12 +3840,12 @@
|
|||
}
|
||||
|
||||
|
||||
if (this.formdata.imgUrlbase64list) {
|
||||
this.formdata.imgUrlbase64list = JSON.stringify(this.formdata.imgUrlbase64list);
|
||||
if (baocunitem.imgUrlbase64list && typeof baocunitem.imgUrlbase64list !== "string") {
|
||||
baocunitem.imgUrlbase64list = JSON.stringify(baocunitem.imgUrlbase64list);
|
||||
}
|
||||
this.formdata.locations = JSON.stringify(this.locationslist);
|
||||
this.formdata.imgUrl = this.imgfileList1.toString();
|
||||
if (this.formdata.tableLevel4Id) {
|
||||
baocunitem.locations = JSON.stringify(this.locationslist);
|
||||
baocunitem.imgUrl = this.imgfileList1.toString();
|
||||
if (baocunitem.tableLevel4Id) {
|
||||
// if (this.formdata.padstatus == '0') {
|
||||
// //padstatus 0--没有tableLevel4Id 1--有tableLevel4Id 2--需要新增的 3--需要修改的 4--删除的
|
||||
// this.formdata.padstatus = '2'
|
||||
|
|
@ -3816,114 +3853,111 @@
|
|||
// //padstatus 0--没有tableLevel4Id 1--有tableLevel4Id 2--需要新增的 3--需要修改的 4--删除的
|
||||
// this.formdata.padstatus = '3'
|
||||
// }
|
||||
this.formdata.padstatus = '3'
|
||||
baocunitem.padstatus = '3'
|
||||
} else {
|
||||
this.formdata.padstatus = '2'
|
||||
baocunitem.padstatus = '2'
|
||||
}
|
||||
|
||||
if (this.formdata.materialActivityFiles) {
|
||||
this.formdata.materialActivityFiles = JSON.stringify(this.formdata.materialActivityFiles)
|
||||
if (baocunitem.materialActivityFiles && typeof baocunitem.materialActivityFiles !== "string") {
|
||||
baocunitem.materialActivityFiles = JSON.stringify(baocunitem.materialActivityFiles)
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (this.formdata.records) {
|
||||
for (let s of this.formdata.records) {
|
||||
if (baocunitem.records) {
|
||||
for (let s of baocunitem.records) {
|
||||
let vallsit = s.infopadobj.list.map(item => item.value);
|
||||
s.resultInfo = vallsit.toString();
|
||||
}
|
||||
this.formdata.records = JSON.stringify(this.formdata.records);
|
||||
baocunitem.records = JSON.stringify(baocunitem.records);
|
||||
}
|
||||
|
||||
if (this.fubiaoobj) {
|
||||
this.formdata.attachmentJson = JSON.stringify(this.fubiaoobj.formdata);
|
||||
baocunitem.attachmentJson = JSON.stringify(this.fubiaoobj.formdata);
|
||||
}
|
||||
|
||||
let updata = {
|
||||
|
||||
createTime: this.formdata.createTime,
|
||||
updateTime: this.formdata.updateTime,
|
||||
createBy: this.formdata.createBy,
|
||||
updateBy: this.formdata.updateBy,
|
||||
tableLevel4Id: this.formdata.tableLevel4Id,
|
||||
tableLevel4Code: this.formdata.tableLevel4Code,
|
||||
parentNo: this.formdata.parentNo,
|
||||
parentId: this.formdata.parentId,
|
||||
buildingId: this.formdata.buildingId,
|
||||
checkPoint: this.formdata.checkPoint,
|
||||
resultType: this.formdata.resultType,
|
||||
resultTypeInfo: this.formdata.resultTypeInfo,
|
||||
issue: this.formdata.issue,
|
||||
standard: this.formdata.standard,
|
||||
term: this.formdata.term,
|
||||
issueType: this.formdata.issueType,
|
||||
issueTypeInfo: this.formdata.issueTypeInfo,
|
||||
rectifyCompanyId: this.formdata.rectifyCompanyId,
|
||||
rectifyCompanyName: this.formdata.rectifyCompanyName,
|
||||
regulatoryCompanyId: this.formdata.regulatoryCompanyId,
|
||||
regulatoryCompanyName: this.formdata.regulatoryCompanyName,
|
||||
expectDeadLineDate: this.formdata.expectDeadLineDate,
|
||||
deadLineWarning: this.formdata.deadLineWarning,
|
||||
attachmentId: this.formdata.attachmentId,
|
||||
imgUrl: this.formdata.imgUrl,
|
||||
voiceUrl: this.formdata.voiceUrl,
|
||||
checkerName: this.formdata.checkerName,
|
||||
checkDate: this.formdata.checkDate,
|
||||
status: this.formdata.status,
|
||||
statusInfo: this.formdata.statusInfo,
|
||||
projectId: this.formdata.projectId,
|
||||
remark: this.formdata.remark,
|
||||
imgNum: this.formdata.imgNum,
|
||||
attachmentJson: this.formdata.attachmentJson,
|
||||
standardTableLevel2Id: this.formdata.standardTableLevel2Id,
|
||||
standardTableLevel1Id: this.formdata.standardTableLevel1Id,
|
||||
standardTableLevel3Id: this.formdata.standardTableLevel3Id,
|
||||
standardTableLevel4Id: this.formdata.standardTableLevel4Id,
|
||||
checkContent: this.formdata.checkContent,
|
||||
phaseTypesControlInfo: this.formdata.phaseTypesControlInfo,
|
||||
checkMethod: this.formdata.checkMethod,
|
||||
allScopeFlag: this.formdata.allScopeFlag,
|
||||
checkScope: this.formdata.checkScope,
|
||||
activeCheckFlag: this.formdata.activeCheckFlag,
|
||||
locationType: this.formdata.locationType,
|
||||
locations: this.formdata.locations,
|
||||
locationInfos: this.formdata.locationInfos,
|
||||
records: this.formdata.records,
|
||||
recordInfos: this.formdata.recordInfos,
|
||||
materialActivityFiles: this.formdata.materialActivityFiles,
|
||||
attachmentType: this.formdata.attachmentType,
|
||||
attachmentName: this.formdata.attachmentName,
|
||||
buildingName: this.formdata.buildingName,
|
||||
buildingMap: this.formdata.buildingMap,
|
||||
standardCommonIssues: this.formdata.standardCommonIssues,
|
||||
companyMap: this.formdata.companyMap,
|
||||
regulatoryCompanyMap: this.formdata.regulatoryCompanyMap,
|
||||
issueTypeMap: this.formdata.issueTypeMap,
|
||||
checkResultTypeMap: this.formdata.checkResultTypeMap,
|
||||
logs: this.formdata.logs,
|
||||
phaseTypes: this.formdata.phaseTypes,
|
||||
syncTime: this.formdata.syncTime,
|
||||
syncTimestamp: this.formdata.syncTimestamp,
|
||||
imgUrlbase64list: this.formdata.imgUrlbase64list,
|
||||
voiceUrllist: this.formdata.voiceUrllist,
|
||||
padstatus: this.formdata.padstatus,
|
||||
createTime: baocunitem.createTime,
|
||||
updateTime: baocunitem.updateTime,
|
||||
createBy: baocunitem.createBy,
|
||||
updateBy: baocunitem.updateBy,
|
||||
tableLevel4Id: baocunitem.tableLevel4Id,
|
||||
tableLevel4Code: baocunitem.tableLevel4Code,
|
||||
parentNo: baocunitem.parentNo,
|
||||
parentId: baocunitem.parentId,
|
||||
buildingId: baocunitem.buildingId,
|
||||
checkPoint: baocunitem.checkPoint,
|
||||
resultType: baocunitem.resultType,
|
||||
resultTypeInfo: baocunitem.resultTypeInfo,
|
||||
issue: baocunitem.issue,
|
||||
standard: baocunitem.standard,
|
||||
term: baocunitem.term,
|
||||
issueType: baocunitem.issueType,
|
||||
issueTypeInfo: baocunitem.issueTypeInfo,
|
||||
rectifyCompanyId: baocunitem.rectifyCompanyId,
|
||||
rectifyCompanyName: baocunitem.rectifyCompanyName,
|
||||
regulatoryCompanyId: baocunitem.regulatoryCompanyId,
|
||||
regulatoryCompanyName: baocunitem.regulatoryCompanyName,
|
||||
expectDeadLineDate: baocunitem.expectDeadLineDate,
|
||||
deadLineWarning: baocunitem.deadLineWarning,
|
||||
attachmentId: baocunitem.attachmentId,
|
||||
imgUrl: baocunitem.imgUrl,
|
||||
voiceUrl: baocunitem.voiceUrl,
|
||||
checkerName: baocunitem.checkerName,
|
||||
checkDate: baocunitem.checkDate,
|
||||
status: baocunitem.status,
|
||||
statusInfo: baocunitem.statusInfo,
|
||||
projectId: baocunitem.projectId,
|
||||
remark: baocunitem.remark,
|
||||
imgNum: baocunitem.imgNum,
|
||||
attachmentJson: baocunitem.attachmentJson,
|
||||
standardTableLevel2Id: baocunitem.standardTableLevel2Id,
|
||||
standardTableLevel1Id: baocunitem.standardTableLevel1Id,
|
||||
standardTableLevel3Id: baocunitem.standardTableLevel3Id,
|
||||
standardTableLevel4Id: baocunitem.standardTableLevel4Id,
|
||||
checkContent: baocunitem.checkContent,
|
||||
phaseTypesControlInfo: baocunitem.phaseTypesControlInfo,
|
||||
checkMethod: baocunitem.checkMethod,
|
||||
allScopeFlag: baocunitem.allScopeFlag,
|
||||
checkScope: baocunitem.checkScope,
|
||||
activeCheckFlag: baocunitem.activeCheckFlag,
|
||||
locationType: baocunitem.locationType,
|
||||
locations: baocunitem.locations,
|
||||
locationInfos: baocunitem.locationInfos,
|
||||
records: baocunitem.records,
|
||||
recordInfos: baocunitem.recordInfos,
|
||||
materialActivityFiles: baocunitem.materialActivityFiles,
|
||||
attachmentType: baocunitem.attachmentType,
|
||||
attachmentName: baocunitem.attachmentName,
|
||||
buildingName: baocunitem.buildingName,
|
||||
buildingMap: baocunitem.buildingMap,
|
||||
standardCommonIssues: baocunitem.standardCommonIssues,
|
||||
companyMap: baocunitem.companyMap,
|
||||
regulatoryCompanyMap: baocunitem.regulatoryCompanyMap,
|
||||
issueTypeMap: baocunitem.issueTypeMap,
|
||||
checkResultTypeMap: baocunitem.checkResultTypeMap,
|
||||
logs: baocunitem.logs,
|
||||
phaseTypes: baocunitem.phaseTypes,
|
||||
syncTime: baocunitem.syncTime,
|
||||
syncTimestamp: baocunitem.syncTimestamp,
|
||||
imgUrlbase64list: baocunitem.imgUrlbase64list,
|
||||
voiceUrllist: baocunitem.voiceUrllist,
|
||||
padstatus: baocunitem.padstatus,
|
||||
}
|
||||
if (this.formdata.padstatus = '3') {
|
||||
if (baocunitem.padstatus = '3') {
|
||||
//padstatus 0--没有tableLevel4Id 1--有tableLevel4Id 2--需要新增的 3--需要修改的 4--删除的
|
||||
updata.uuid = this.formdata.uuid;
|
||||
updata.uuid = baocunitem.uuid;
|
||||
console.log('马上更新11111:', updata);
|
||||
|
||||
let xinzneg = await this.$dbUtils.upnewdateSQL('xiaofangdb', 'projectxianchangtable', updata, 'uuid', this
|
||||
.formdata
|
||||
.uuid);
|
||||
let xinzneg = await this.$dbUtils.upnewdateSQL('xiaofangdb', 'projectxianchangtable', updata, 'uuid',
|
||||
baocunitem.uuid);
|
||||
if (xinzneg) {
|
||||
this.$modal.msgSuccess("保存成功!")
|
||||
} else {
|
||||
this.$modal.msgError("保存失败!")
|
||||
}
|
||||
console.log('更新结果:', xinzneg, this
|
||||
.formdata
|
||||
.uuid);
|
||||
console.log('更新结果:', xinzneg, baocunitem.uuid);
|
||||
} else {
|
||||
console.log('马上新增11111:', updata);
|
||||
|
||||
|
|
@ -3933,46 +3967,22 @@
|
|||
} else {
|
||||
this.$modal.msgError("保存失败!")
|
||||
}
|
||||
console.log('新增结果:', xinzneg, this
|
||||
.formdata
|
||||
.uuid);
|
||||
console.log('新增结果:', xinzneg, baocunitem.uuid);
|
||||
}
|
||||
this.addinfo(); //保存并添加
|
||||
this.resetformdata(); //重置保存添加
|
||||
|
||||
|
||||
},
|
||||
async addinfo() {
|
||||
|
||||
|
||||
async resetformdata() {
|
||||
//重置保存添加
|
||||
this.jzwlist = JSON.parse(this.objitem.buildingMap) || [];
|
||||
this.locationslist = JSON.parse(this.objitem.locations) || [];
|
||||
this.standardCommonIssueslist = JSON.parse(this.objitem.standardCommonIssues) || [];
|
||||
this.issueTypeMaplist = JSON.parse(this.objitem.issueTypeMap) || [];
|
||||
this.companyMaplist = JSON.parse(this.objitem.companyMap) || [];
|
||||
this.regulatoryCompanyMaplist = JSON.parse(this.objitem.regulatoryCompanyMap) || [];
|
||||
// this.recordslist = JSON.parse(objitem.records) || [];
|
||||
let recordsl = JSON.parse(this.objitem.records) || [];
|
||||
for (let xx of recordsl) {
|
||||
let info = xx.info;
|
||||
let resultInfo = xx.resultInfo;
|
||||
xx.infopadobj = this.parseStr(info, resultInfo);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
let httpurl = this.userStore.allurl;
|
||||
this.formdata = JSON.parse(JSON.stringify(this.objitem));
|
||||
this.formdata.records = recordsl;
|
||||
this.formdata.checkPointids = this.locationslist.filter(item => item.selectFlag == true).map(item => item
|
||||
.standardLocationId);
|
||||
this.formdata.materialActivityFiles = JSON.parse(this.formdata.materialActivityFiles) || [];
|
||||
// if (this.formdata.imgUrl) {
|
||||
// this.imgfileList1 = JSON.parse(this.formdata.imgUrlbase64list);
|
||||
// }
|
||||
// if (this.formdata.voiceUrl) {
|
||||
// this.voiceUrlfileList1 = JSON.parse(this.formdata.voiceUrllist);
|
||||
// }
|
||||
console.log("sdfds", this.formdata)
|
||||
// return
|
||||
// materialActivityFiles
|
||||
this.imgfileList1 = [];
|
||||
this.voiceUrlfileList1 = [];
|
||||
this.formdata.voiceUrl = "";
|
||||
this.formdata.tableLevel4Id = null;
|
||||
this.formdata.tableLevel4Code = null;
|
||||
this.fubiaoobj = null;
|
||||
|
|
@ -3981,9 +3991,23 @@
|
|||
this.formdata.checkPointids = null;
|
||||
this.formdata.remark = null;
|
||||
this.formdata.issue = null;
|
||||
this.formdata.resultType = null;
|
||||
this.formdata.resultType = "1";
|
||||
this.formdata.checkPoint = null;
|
||||
if (this.formdata.attachmentType) {
|
||||
let recordsl = this.formdata.records || [];
|
||||
for (let xx of recordsl) {
|
||||
let info = xx.info;
|
||||
let resultInfo = xx.resultInfo;
|
||||
xx.infopadobj = this.parseStr(info, resultInfo, false);
|
||||
//infopadlist
|
||||
}
|
||||
this.formdata.records = recordsl;
|
||||
if (this.formdata.materialActivityFiles) {
|
||||
for (let xxx of this.formdata.materialActivityFiles) {
|
||||
xxx.resultType = ""
|
||||
}
|
||||
}
|
||||
|
||||
if (this.formdata.attachmentType !== '0') {
|
||||
this.fubiaoobj = {
|
||||
typeid: this.formdata.attachmentType,
|
||||
name: this.formdata.attachmentName,
|
||||
|
|
@ -4008,7 +4032,12 @@
|
|||
console.log('456654645', this.fubiaoobj);
|
||||
}
|
||||
}
|
||||
console.log('dddd', this.formdata)
|
||||
|
||||
|
||||
|
||||
},
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
<template>
|
||||
<view class="addcontainer" style="margin: 20rpx;min-height: 300px; " v-if="formdata">
|
||||
<view class="addcontainer" style="margin: 20rpx;min-height: 300px;" v-if="formdata">
|
||||
<view class="clsbox1">
|
||||
<view>复查结论:</view>
|
||||
<uni-row :gutter="0">
|
||||
|
|
@ -288,6 +288,54 @@
|
|||
hideKeyboard() {
|
||||
uni.hideKeyboard()
|
||||
},
|
||||
parseStr(str, resultInfo = "", showval = true) {
|
||||
//str--字符串 resultInfo--值 showval--是否清空值(保存并添加时用的)
|
||||
const regex = /\{(\d+)\}/g;
|
||||
const matches = [];
|
||||
let match;
|
||||
|
||||
// 提取所有{数字}的位置和值
|
||||
while ((match = regex.exec(str)) !== null) {
|
||||
matches.push({
|
||||
number: match[1],
|
||||
start: match.index,
|
||||
end: regex.lastIndex
|
||||
});
|
||||
}
|
||||
|
||||
// 无占位符的情况
|
||||
if (matches.length === 0) {
|
||||
return {
|
||||
name: str,
|
||||
list: []
|
||||
};
|
||||
}
|
||||
|
||||
// 提取最后一个占位符后的单位
|
||||
const lastMatch = matches[matches.length - 1];
|
||||
const dw = str.substring(lastMatch.end).trim();
|
||||
|
||||
// 构建name部分(去除所有占位符)
|
||||
const namePart = str
|
||||
.substring(0, lastMatch.start)
|
||||
.replace(regex, '')
|
||||
.trim();
|
||||
|
||||
// 解析resultInfo
|
||||
const values = resultInfo.split(',').map(v => v.trim());
|
||||
|
||||
// 构建list数组
|
||||
const list = matches.map((match, index) => ({
|
||||
value: showval ? index < values.length ? values[index] : '' : '',
|
||||
maxvalue: parseInt(match.number, 10),
|
||||
dw: index === matches.length - 1 ? dw : ''
|
||||
}));
|
||||
|
||||
return {
|
||||
label: namePart,
|
||||
list
|
||||
};
|
||||
},
|
||||
|
||||
async getinfo() {
|
||||
//获取详情
|
||||
|
|
@ -334,15 +382,13 @@
|
|||
// this.recordslist = JSON.parse(objitem.records) || [];
|
||||
let recordsl = JSON.parse(objitem.records) || [];
|
||||
for (let xx of recordsl) {
|
||||
let titlestr = xx.info;
|
||||
let [labelPart, valuePart] = titlestr.split('{');
|
||||
let maxvalue = parseInt(valuePart.replace('}', ''), 10);
|
||||
xx.label = labelPart;
|
||||
xx.maxvalue = maxvalue;
|
||||
let info = xx.info;
|
||||
let resultInfo = xx.resultInfo;
|
||||
xx.infopadobj = this.parseStr(info, resultInfo);
|
||||
//infopadlist
|
||||
|
||||
}
|
||||
|
||||
|
||||
let httpurl = this.userStore.allurl;
|
||||
this.formdata = objitem;
|
||||
this.formdata.records = recordsl;
|
||||
|
|
|
|||
|
|
@ -76,8 +76,9 @@
|
|||
<view style="color: #ca4341; margin-right:5px;"></view>
|
||||
<view> 问题描述:</view>
|
||||
</view>
|
||||
<csr-uni-data-select :multiple="false" :filterable="false" v-model="formdata.issue" placeholder="选择问题描述"
|
||||
dataKey="issue" dataValue="issue" :localdata="standardCommonIssueslist" :clear="false"
|
||||
<csr-uni-data-select :multiple="false" :filterable="false" v-model="formdata.issue" :allowCreate="true"
|
||||
:placeholder="formdata.issue||'选择问题描述'" dataKey="issue" dataValue="issue"
|
||||
:localdata="standardCommonIssueslist" :clear="false"
|
||||
@change="standardCommonIssuechange"></csr-uni-data-select>
|
||||
|
||||
</view>
|
||||
|
|
@ -339,6 +340,54 @@
|
|||
hideKeyboard() {
|
||||
uni.hideKeyboard()
|
||||
},
|
||||
parseStr(str, resultInfo = "", showval = true) {
|
||||
//str--字符串 resultInfo--值 showval--是否清空值(保存并添加时用的)
|
||||
const regex = /\{(\d+)\}/g;
|
||||
const matches = [];
|
||||
let match;
|
||||
|
||||
// 提取所有{数字}的位置和值
|
||||
while ((match = regex.exec(str)) !== null) {
|
||||
matches.push({
|
||||
number: match[1],
|
||||
start: match.index,
|
||||
end: regex.lastIndex
|
||||
});
|
||||
}
|
||||
|
||||
// 无占位符的情况
|
||||
if (matches.length === 0) {
|
||||
return {
|
||||
name: str,
|
||||
list: []
|
||||
};
|
||||
}
|
||||
|
||||
// 提取最后一个占位符后的单位
|
||||
const lastMatch = matches[matches.length - 1];
|
||||
const dw = str.substring(lastMatch.end).trim();
|
||||
|
||||
// 构建name部分(去除所有占位符)
|
||||
const namePart = str
|
||||
.substring(0, lastMatch.start)
|
||||
.replace(regex, '')
|
||||
.trim();
|
||||
|
||||
// 解析resultInfo
|
||||
const values = resultInfo.split(',').map(v => v.trim());
|
||||
|
||||
// 构建list数组
|
||||
const list = matches.map((match, index) => ({
|
||||
value: showval ? index < values.length ? values[index] : '' : '',
|
||||
maxvalue: parseInt(match.number, 10),
|
||||
dw: index === matches.length - 1 ? dw : ''
|
||||
}));
|
||||
|
||||
return {
|
||||
label: namePart,
|
||||
list
|
||||
};
|
||||
},
|
||||
|
||||
async getinfo() {
|
||||
//获取详情
|
||||
|
|
@ -368,21 +417,16 @@
|
|||
this.companyMaplist = JSON.parse(objitem.companyMap) || [];
|
||||
this.regulatoryCompanyMaplist = JSON.parse(objitem.regulatoryCompanyMap) || [];
|
||||
|
||||
|
||||
|
||||
|
||||
// this.recordslist = JSON.parse(objitem.records) || [];
|
||||
let recordsl = JSON.parse(objitem.records) || [];
|
||||
for (let xx of recordsl) {
|
||||
let titlestr = xx.info;
|
||||
let [labelPart, valuePart] = titlestr.split('{');
|
||||
let maxvalue = parseInt(valuePart.replace('}', ''), 10);
|
||||
xx.label = labelPart;
|
||||
xx.maxvalue = maxvalue;
|
||||
let info = xx.info;
|
||||
let resultInfo = xx.resultInfo;
|
||||
xx.infopadobj = this.parseStr(info, resultInfo);
|
||||
//infopadlist
|
||||
|
||||
}
|
||||
|
||||
|
||||
let httpurl = this.userStore.allurl;
|
||||
this.formdata = objitem;
|
||||
this.formdata.records = recordsl;
|
||||
|
|
@ -485,10 +529,10 @@
|
|||
// }
|
||||
|
||||
this.formdata.imgUrl = this.imgfileList1.toString();
|
||||
if (this.formdata.materialActivityFiles) {
|
||||
if (this.formdata.materialActivityFiles && typeof this.formdata.materialActivityFiles !== "string") {
|
||||
this.formdata.materialActivityFiles = JSON.stringify(this.formdata.materialActivityFiles)
|
||||
}
|
||||
if (this.formdata.records) {
|
||||
if (this.formdata.records && typeof this.formdata.records !== "string") {
|
||||
this.formdata.records = JSON.stringify(this.formdata.records)
|
||||
}
|
||||
let updata = {
|
||||
|
|
|
|||
|
|
@ -238,8 +238,8 @@
|
|||
<u-modal content="" :closeOnClickOverlay="true" title="复查发现新问题" :showConfirmButton="false" :showCancelButton="false"
|
||||
cancelText="取消" confirmText="保存" width="850px" :show="fuchaxwtshow" confirmColor="#42b983" cancelColor="#ca4341">
|
||||
<view class="slot-content">
|
||||
<scroll-view scroll-y="true" style="height:500px;">
|
||||
<view style="display: flex; flex-direction: column;align-items: left; border-top:1px solid #eee;">
|
||||
<scroll-view scroll-y="true" style="width:800px;height:500px;">
|
||||
<view style="width:100%;display: flex; flex-direction: column;align-items: left; border-top:1px solid #eee;">
|
||||
<FuchaxwtEditnr style="width:97%;" :objitem="rowitem" :sjnum="sjnum" @tkeventclose="closefuchaxwt"
|
||||
@shaunxian="getlistinfo()" />
|
||||
</view>
|
||||
|
|
@ -250,8 +250,8 @@
|
|||
<u-modal content="" :closeOnClickOverlay="true" title="复查" :showConfirmButton="false" :showCancelButton="false"
|
||||
cancelText="取消" confirmText="保存" width="850px" :show="fuchashow" confirmColor="#42b983" cancelColor="#ca4341">
|
||||
<view class="slot-content">
|
||||
<scroll-view scroll-y="true" style="height:500px;">
|
||||
<view style="display: flex; flex-direction: column;align-items: left; border-top:1px solid #eee;">
|
||||
<scroll-view scroll-y="true" style="width:800px; height:500px;">
|
||||
<view style="width:100%;display: flex; flex-direction: column;align-items: left; border-top:1px solid #eee;">
|
||||
<FuchaEditnr style="width:97%;" :objitem="rowitem" :sjnum="sjnum" @tkeventclose="closefucha"
|
||||
@shaunxian="getlistinfo()" />
|
||||
</view>
|
||||
|
|
@ -286,7 +286,7 @@
|
|||
</u-modal>
|
||||
<UniMenu />
|
||||
<!-- color="#2f7d09" textColor="#2f7d09" -->
|
||||
<zero-loading v-if="shujuStore.pageloading" :maskOpacity="0.3" color="#c41818" textColor="#c41818" :mask="true"
|
||||
<zero-loading v-if="shujuStore.pageloading" :maskOpacity="0.5" color="#c41818" textColor="#c41818" :mask="true"
|
||||
:showText="true" :text="shujuStore.pageloadingtext" type="wobble"></zero-loading>
|
||||
</view>
|
||||
</template>
|
||||
|
|
|
|||
|
|
@ -38,8 +38,15 @@
|
|||
<view class="uni-popper__arrow"></view>
|
||||
<scroll-view scroll-y="true" class="uni-select__selector-scroll">
|
||||
<view class="uni-select__selector-empty" v-if="filterMixinDatacomResData.length === 0">
|
||||
<view v-if="!allowCreate">
|
||||
<span>{{emptyTips}}</span>
|
||||
</view>
|
||||
<view v-else>
|
||||
|
||||
<span v-if="!filterInput">{{emptyTips}}</span>
|
||||
<span v-else @click="changexz(filterInput)">{{filterInput}}</span>
|
||||
</view>
|
||||
</view>
|
||||
<view v-else :class="['uni-select__selector-item', {'uni-select_selector-item_active' :multiple
|
||||
&& currentArr.includes(item[dataValue])}]"
|
||||
style="display: flex;justify-content: space-between;align-items: center;"
|
||||
|
|
@ -72,6 +79,9 @@
|
|||
* @property {String} placeholder 输入框的提示文字
|
||||
* @property {Boolean} disabled 是否禁用
|
||||
* @event {Function} change 选中发生变化触发
|
||||
* @event {Boolean} allowCreate 是否显示新增
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
export default {
|
||||
|
|
@ -102,6 +112,10 @@
|
|||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
allowCreate: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
localdata: {
|
||||
type: Array,
|
||||
default () {
|
||||
|
|
@ -373,8 +387,16 @@
|
|||
} else {
|
||||
// console.log('1sdfs7', this.current, this.modelValue)
|
||||
// const def = this.mixinDatacomResData.find(item => item[this.dataValue] === defValue)
|
||||
const def = this.mixinDatacomResData.find(item => item[this.dataValue] == defValue)
|
||||
this.current = def ? this.formatItemName(def) : ''
|
||||
// console.log('1sdfs8', this.current, this.modelValue)
|
||||
// console.log('1sdfs7', defValue)
|
||||
|
||||
let def = this.mixinDatacomResData.find(item => item[this.dataValue] == this.modelValue)
|
||||
if (this.modelValue === '') {
|
||||
def = null
|
||||
}
|
||||
// console.log('1sdfs910', def, defValue, this.mixinDatacomResData)
|
||||
this.current = def ? this.formatItemName(def) : '';
|
||||
// console.log('1sdfs9', this.current, this.modelValue)
|
||||
}
|
||||
},
|
||||
/**
|
||||
|
|
@ -448,6 +470,13 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
changexz(val) {
|
||||
//新增
|
||||
console.error('sdsd', val)
|
||||
this.$emit('update:modelValue', val)
|
||||
this.$emit('input', val)
|
||||
this.showSelector = false
|
||||
},
|
||||
delItem(item) {
|
||||
if (this.disabled) {
|
||||
return
|
||||
|
|
@ -474,8 +503,15 @@
|
|||
this.$emit('update:modelValue', val)
|
||||
const current = this.mixinDatacomResData.find(item => val == item[this.dataValue])
|
||||
console.log(current);
|
||||
if (current == undefined || current == null) {
|
||||
let xxobj = {};
|
||||
xxobj[this.dataValue] = this.filterInput;
|
||||
this.$emit('change', xxobj)
|
||||
} else {
|
||||
this.$emit('change', current)
|
||||
}
|
||||
|
||||
}
|
||||
if (this.collection) {
|
||||
this.setCache(val);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -403,7 +403,7 @@ async function processDeleteData(deleteDataList, results) {
|
|||
|
||||
for (const item of deleteDataList) {
|
||||
try {
|
||||
const deleteResult = await callDeleteServerApi(item.uuid);
|
||||
const deleteResult = await callDeleteServerApi(item.tableLevel4Id);
|
||||
|
||||
if (deleteResult.success) {
|
||||
await deleteLocalData(item.uuid, 'projectxianchangtable');
|
||||
|
|
@ -604,9 +604,16 @@ async function callUpdateServerApi(data) {
|
|||
'Bearerauth': `Bearer ${getToken()}`
|
||||
},
|
||||
success: async (res) => {
|
||||
// console.error('批量处理4:', res);
|
||||
// console.error('批量处理44444:', res);
|
||||
if (res.data.code === 200) {
|
||||
|
||||
resolve({
|
||||
success: true,
|
||||
data: res.data.data
|
||||
});
|
||||
} else {
|
||||
|
||||
if (res.data.msg == "已被删除,无法更新") {
|
||||
resolve({
|
||||
success: true,
|
||||
data: res.data.data
|
||||
|
|
@ -617,6 +624,8 @@ async function callUpdateServerApi(data) {
|
|||
message: res.data.msg || '更新失败'
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
fail: (error) => {
|
||||
reject(new Error(`更新请求失败: ${error.errMsg}`));
|
||||
|
|
@ -640,16 +649,28 @@ async function callDeleteServerApi(id) {
|
|||
},
|
||||
|
||||
success: (res) => {
|
||||
console.log("删除接口", res)
|
||||
if (res.data.code === 200) {
|
||||
resolve({
|
||||
success: true,
|
||||
data: res.data.data
|
||||
});
|
||||
} else {
|
||||
|
||||
if (res.data.msg == "Index 0 out of bounds for length 0") {
|
||||
resolve({
|
||||
success: true,
|
||||
data: res.data.data
|
||||
});
|
||||
} else {
|
||||
resolve({
|
||||
success: false,
|
||||
message: res.data.msg || '删除失败'
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
},
|
||||
fail: (error) => {
|
||||
|
|
|
|||
Loading…
Reference in New Issue