5ed148e7 by xiaomiao

Merge branch 'dev' of http://yun.pashanhoo.com:9090/bdc/bdcdj-web into dev

2 parents 97f53c8a b8917a94
<!--
* @Description:
* @Autor: renchao
* @LastEditTime: 2023-07-28 14:59:55
* @LastEditTime: 2023-07-31 15:43:30
-->
<template>
<div class="rlPopup">
......@@ -23,7 +23,7 @@
<div class="thumb-wrap">
<div class="thumb-wrap-button">
<el-button type="primary" @click="clickImage" v-if="previewImg.imgList.length>0">(放大) 显示(缩小)</el-button>
<el-upload class="fileUpdate" ref="upload" action="" :show-file-list="false" :multiple="true" :auto-upload="false"
<el-upload class="fileUpdate" ref="upload" :key="key" action="" :show-file-list="false" :multiple="true" :auto-upload="false"
:on-change="handleChange"
accept=".JPG, .PNG, .JPEG,.jpg, .png, .jpeg" :before-upload="beforeUpload">
<el-button icon="el-icon-upload" type="primary" v-if="ableOperation">上传</el-button>
......@@ -70,6 +70,7 @@
},
data () {
return {
key: 0,
isScan: false,
// 打开高拍仪
scanTitle: '打开高拍仪',
......@@ -223,28 +224,20 @@
clickImage () {
this.showViewer = true
},
// 上传
/**
* @description: 上传
* @param {*} file
* @author: renchao
*/
beforeUpload (file) {
const isJPEG = file.type === 'image/jpeg'
const isPNG = file.type === 'image/png'
const isJPG = file.type === 'image/jpg'
const isGIF = file.type === 'image/gif'
const isLt5M = file.size / 1024 / 1024 < 5
if (!isJPEG && !isGIF && !isPNG && !isJPG && !isGIF) {
this.$message.error('请选择jpeg/png/jpg/bmp/gif格式的图片后重试')
this.loading = false
}
const isLt5M = file.size / 1024 / 1024 < 5;
if (!isLt5M) {
this.$message.error('上传图片大小不能超过 5MB!')
this.loading = false
this.$message.error('上传图片大小不能超过 5MB!');
return false;
}
this.imgHidden = (isJPG || isJPEG || isPNG || isGIF) && isLt5M
return this.imgHidden
// 所有条件满足时返回 true
return true;
},
/**
* @description: handleChange
......@@ -253,17 +246,28 @@
* @author: renchao
*/
async handleChange (file, fileList) {
if (!this.beforeUpload(file)) return
let length = fileList.length;
this.maxFileLength = Math.max(length, this.maxFileLength)
console.log(fileList, this.maxFileLength, 'this.maxFileLength');
var formData = new FormData();
setTimeout(() => {
if (this.maxFileLength !== length) {
return
}
let num = 0
fileList.forEach(item => {
formData.append('file', item.raw)
if (!['image/jpeg', 'image/png', 'image/jpg', 'image/gif'].includes(item.raw.type)) {
num++
} else {
formData.append('file', item.raw)
}
})
if (num >= 1) {
this.$message.error("请选择jpeg/png/jpg/bmp/gif格式的图片后重试")
// 移除不支持的文件类型
this.key++
return;
}
formData.append("bsmSj", this.previewImg.bsmSj);
formData.append("bsmSlsq", this.previewImg.bsmSlsq);
uploadBatch(formData).then((res) => {
......
<!--
* @Description:
* @Autor: renchao
* @LastEditTime: 2023-07-28 11:37:31
* @LastEditTime: 2023-07-31 13:59:45
-->
<template>
<div class="clxx">
......@@ -253,7 +253,8 @@
//查看明细
viewDetail () {
this.$popupDialog("查看明细", "workflow/components/dialog/clxxDetailDialog", {
data: this.tableData
data: this.tableData,
unitData: this.$parent.unitData
}, "60%")
},
//设置tableData
......
<!--
* @Description:
* @Autor: renchao
* @LastEditTime: 2023-07-28 09:35:42
* @LastEditTime: 2023-07-31 14:27:07
-->
<template>
<div class="clmlmx-box">
<div class="title">申请材料目录</div>
<lb-table :column="column" :key="key" :heightNumSetting="true" :pagination="false" :data="formData.data">
<lb-table :column="column" :key="key" :heightNumSetting="true" :calcHeight="600" :pagination="false" :data="tableData">
</lb-table>
<div class="text-center">
<el-button @click="$popupCacel">取消</el-button>
......@@ -14,6 +14,7 @@
</div>
</template>
<script>
import Vue from 'vue'
import store from '@/store/index.js'
import { InitClml, saveClml, deleteSjClml, moveClml } from "@/api/clxx.js";
export default {
......@@ -38,21 +39,21 @@
label: "是否必选",
width: "80",
render: (h, scope) => {
if (scope.row.sfxjcl === "1") {
if (scope.row.isrequired === "1") {
return (
<div>
<span></span>
<span></span>
</div>
);
}
else {
return (
<div>
<span></span>
<span></span>
</div>
);
)
}
},
}
},
{
prop: "sjmc",
......@@ -67,13 +68,23 @@
<div>
<span>{this.dicStatus(scope.row.sjlx, "A40")}</span>
</div>
);
},
)
}
},
{
prop: "sjsl",
label: "份数",
width: "50"
width: "50",
render: (h, scope) => {
return (
<div>
{
scope.row.sjsl ?
<span>{scope.row.sjsl}</span> : 1
}
</div>
)
}
},
{
prop: "smzt",
......@@ -147,11 +158,16 @@
tableData: []
}
},
created () {
console.log(this.formData.data, 'formData');
watch: {
'formData.data': {
handler: function (val, oldVal) {
this.tableData = _.cloneDeep(val)
},
immediate: true,
deep: true
}
},
methods: {
// 材料目录明细初始化
/**
* @description: 材料目录明细初始化
* @author: renchao
......@@ -160,24 +176,24 @@
return new Promise(resolve => {
this.unitData = this.$parent.unitData;
var formdata = new FormData();
formdata.append("bsmSldy", this.unitData[0]?.bsmSldy);
formdata.append("bsmSlsq", this.$route.query.bsmSlsq);
formdata.append("bsmSldy", this.formData.unitData[0]?.bsmSldy);
formdata.append("bsmSlsq", Vue.prototype.$currentRoute.query.bsmSlsq);
formdata.append("clfl", 2);
InitClml(formdata).then((res) => {
if (res.code == 200) {
resolve(res.code)
if (res.result && res.result.length > 0) {
this.data = res.result;
this.tableData = res.result;
} else {
this.data = []
this.tableData = []
}
console.log(this.tableData, 'this.tableData');
} else {
this.$message.error(res.message)
}
})
})
},
// 上移
/**
* @description: 上移
* @param {*} index
......@@ -199,14 +215,12 @@
message: '上移成功',
type: 'success'
})
this.$parent.setTableData(this.data)
}
} else {
this.$message.error(res.message);
}
})
},
// 下移
/**
* @description: 下移
* @param {*} index
......@@ -256,7 +270,6 @@
message: "删除成功",
type: "success",
})
// this.$parent.setTableData(this.data)
}
}
})
......@@ -293,7 +306,6 @@
@import "~@/styles/mixin.scss";
.clmlmx-box {
margin: 0 auto;
.title {
text-align: center;
height: 60px;
......