diff --git a/sgzb-ui/src/views/claimAndRefund/receive/agreement.vue b/sgzb-ui/src/views/claimAndRefund/receive/agreement.vue index 0abd83be..53d6634e 100644 --- a/sgzb-ui/src/views/claimAndRefund/receive/agreement.vue +++ b/sgzb-ui/src/views/claimAndRefund/receive/agreement.vue @@ -181,7 +181,7 @@ - + @@ -243,7 +243,7 @@ v-model="form.planStartTime" value-format="yyyy-MM-dd" type="date" - placeholder="开始日期" + placeholder="请选择开始日期" > @@ -268,7 +268,7 @@ style="width: 100%" value-format="yyyy-MM-dd" type="date" - placeholder="开始日期" + placeholder="请选择签订日期" > @@ -298,7 +298,7 @@ 4; - } + return this.checkUrlList.length > 4 + }, }, created() { - this.getList(); - this.getUnitList(); - this.getProjectList(); + this.getList() + this.getUnitList() + this.getProjectList() }, methods: { //获取单位类型 ,getUnitList, getProjectList getUnitList() { getUnitList().then(response => { - this.unitList = response.data; - }); + this.unitList = response.data + }) }, getProjectList() { getProjectList().then(response => { - this.projectList = response.data; - }); + this.projectList = response.data + }) }, /** 查询字典类型列表 */ getList() { - this.loading = true; + this.loading = true getAgreementList(this.queryParams).then(response => { - this.agreementList = response.rows; + this.agreementList = response.rows this.agreementList.forEach(item => { if (item.fileUrl) { - item.imgUrlList = item.fileUrl.split(","); - item.imgNameList = item.fileName.split(","); + item.imgUrlList = item.fileUrl.split(',') + item.imgNameList = item.fileName.split(',') } - }); - this.total = response.total; - this.loading = false; - }); + }) + this.total = response.total + this.loading = false + }) }, // 取消按钮 cancel() { - this.open = false; - this.reset(); + this.open = false + this.reset() }, // 表单重置 reset() { @@ -496,189 +496,182 @@ export default { dictType: undefined, fileUrl: undefined, fileName: undefined, - status: "0", - remark: undefined - }; - this.fileList = []; - this.resetForm("form"); + status: '0', + remark: undefined, + } + this.fileList = [] + this.resetForm('form') }, /** 搜索按钮操作 */ handleQuery() { - this.getList(); + this.getList() }, /** 重置按钮操作 */ resetQuery() { // this.dateRange = [] - this.resetForm("queryForm"); - this.queryParams.pageNum = 1; - this.queryParams.pageSize = 10; - this.getList(); + this.resetForm('queryForm') + this.queryParams.pageNum = 1 + this.queryParams.pageSize = 10 + this.getList() // this.handleQuery() }, handleNotice() { - this.noticeOpen = true; + this.noticeOpen = true }, /** 新增按钮操作 */ handleAdd() { - this.reset(); - this.fileList = []; - this.checkUrlList = []; - this.checkUrlNameList = []; - this.open = true; - this.title = "新建"; + this.reset() + this.fileList = [] + this.checkUrlList = [] + this.checkUrlNameList = [] + this.open = true + this.title = '新建' }, // 图片上传 imgUpLoad(param, name, index) { // console.log(param,'image') - param.type = "ma"; + param.type = 'ma' imgUpLoad(param) .then(res => { if (res.code == 200) { - this.checkUrlList.push(res.data.fileUrl); - this.checkUrlNameList.push(res.data.fileName); + this.checkUrlList.push(res.data.fileUrl) + this.checkUrlNameList.push(res.data.fileName) } else { // this.$msgError(res.msg) - this.$modal.msgError(res.msg); + this.$modal.msgError(res.msg) } }) .catch(error => { // this.$msgError(error) - this.$modal.msgError(error); - }); + this.$modal.msgError(error) + }) }, handleAvatarSuccess(res, file) { - console.log("success"); + console.log('success') }, handleExceed(files, fileList) { - this.$message.warning("最多只可以上传五张图片"); + this.$message.warning('最多只可以上传五张图片') }, handleRemove(file, fileList) { - let sum = 0; + let sum = 0 this.checkUrlNameList.forEach((item, index) => { if (item == file.name) { - sum = index; + sum = index } - }); - this.checkUrlNameList.splice(sum, 1); - this.checkUrlList.splice(sum, 1); + }) + this.checkUrlNameList.splice(sum, 1) + this.checkUrlList.splice(sum, 1) }, //图片点击查看 handlePictureCardPreview(file) { - console.log(file); - this.dialogImageUrl = file.url; - this.dialogVisible = true; + console.log(file) + this.dialogImageUrl = file.url + this.dialogVisible = true }, //图片查看 openImg(url) { - this.dialogImageUrl = this.uploadUrl + url; - this.dialogVisible = true; + this.dialogImageUrl = this.uploadUrl + url + this.dialogVisible = true }, // 多选框选中数据 handleSelectionChange(selection) { - this.ids = selection.map(item => item.agreementId); - this.single = selection.length != 1; - this.multiple = !selection.length; + this.ids = selection.map(item => item.agreementId) + this.single = selection.length != 1 + this.multiple = !selection.length }, /** 修改按钮操作 */ handleUpdate(row) { - this.reset(); + this.reset() // const agreementId = row.agreementId let param = { - agreementId: row.agreementId - }; + agreementId: row.agreementId, + } getAgreementInfoId(param).then(response => { - this.form = response.data; + this.form = response.data if (response.data.leaseDay == null) { - this.form.leaseDay = undefined; + this.form.leaseDay = undefined } - this.fileList = []; - this.checkUrlList = []; - this.checkUrlNameList = []; - if ( - response.data && - typeof response.data.fileUrl === "string" && - typeof response.data.fileName === "string" - ) { + this.fileList = [] + this.checkUrlList = [] + this.checkUrlNameList = [] + if (response.data && typeof response.data.fileUrl === 'string' && typeof response.data.fileName === 'string') { try { - if(response.data.fileUrl!=''){ - let [urlArr, nameArr] = [ - response.data.fileUrl, - response.data.fileName - ].map(str => str.split(",")); + if (response.data.fileUrl != '') { + let [urlArr, nameArr] = [response.data.fileUrl, response.data.fileName].map(str => str.split(',')) if (urlArr.length !== nameArr.length) { - return; + return } console.log(urlArr) let fileList = urlArr.map((url, i) => ({ name: nameArr[i], - url: `${this.uploadUrl}${url}` - })); + url: `${this.uploadUrl}${url}`, + })) console.log(fileList) - this.fileList = fileList; - this.checkUrlList = urlArr; - this.checkUrlNameList = nameArr; + this.fileList = fileList + this.checkUrlList = urlArr + this.checkUrlNameList = nameArr } } catch (error) { - console.error("处理合同照片时发生错误:", error); + console.error('处理合同照片时发生错误:', error) } } - this.open = true; - this.title = "编辑"; - }); + this.open = true + this.title = '编辑' + }) }, /** 提交按钮 */ submitForm: function() { - this.form.fileUrl = this.checkUrlList.join(","); - this.form.fileName = this.checkUrlNameList.join(","); - this.$refs["form"].validate(valid => { + this.form.fileUrl = this.checkUrlList.join(',') + this.form.fileName = this.checkUrlNameList.join(',') + this.$refs['form'].validate(valid => { if (valid) { if (this.form.agreementId != undefined) { updateAgreement(this.form).then(response => { - this.$modal.msgSuccess("修改成功"); - this.open = false; - this.getList(); - }); + this.$modal.msgSuccess('修改成功') + this.open = false + this.getList() + }) } else { addAgreement(this.form).then(response => { - this.$modal.msgSuccess("新增成功"); - this.open = false; - this.getList(); - }); + this.$modal.msgSuccess('新增成功') + this.open = false + this.getList() + }) } } - }); + }) }, /** 删除按钮操作 */ handleDelete(row) { // const agreementId = row.agreementId; let param = { - agreementId: row.agreementId + "" - }; + agreementId: row.agreementId + '', + } this.$modal - .confirm("是否确认删除该数据项?") + .confirm('是否确认删除该数据项?') .then(function() { - return removeAgreement(param); + return removeAgreement(param) }) .then(() => { - this.getList(); - this.$modal.msgSuccess("删除成功"); + this.getList() + this.$modal.msgSuccess('删除成功') }) - .catch(() => {}); + .catch(() => {}) }, /** 导出按钮操作 */ handleExport() { this.download( - "material/agreementInfo/export", + 'material/agreementInfo/export', { - ...this.queryParams + ...this.queryParams, }, `协议_${new Date().getTime()}.xlsx` - ); - } - } -}; + ) + }, + }, +}