d5cfac56 by renchao@pashanhoo.com

style:材料申请

1 parent e4dcb128
/*
* @Description: 材料信息
* @Autor: renchao
* @LastEditTime: 2023-09-13 15:56:03
* @LastEditTime: 2023-09-18 16:03:16
*/
import request from '@/utils/request'
let SERVER = window.config ? window.config : JSON.parse(localStorage.getItem('ApiUrl'))
......@@ -157,3 +157,17 @@ export function getClmxList (bsmSj) {
}
})
}
/**
* @description: 补录材料目录
* @param {*} data
* @author: renchao
*/
export function repairInitClml (data) {
return request({
url: SERVER.SERVERAPI + '/rest/ywbl/clxx/repairInitClml',
method: 'post',
params: {
repair: data.bsmRepair
}
})
}
\ No newline at end of file
......
......@@ -28,7 +28,7 @@ export function getXtParamsByYwh (ywh) {
*/
export function getBlParamsByYwh (ywh, bsmQlxx) {
return request({
url: SERVER.SERVERAPI + '​/rest​/ywbl​/djyw​/getBlParamsByYwh',
url: SERVER.SERVERAPI + '/rest/ywbl/djyw/getBlParamsByYwh',
method: 'get',
params: {
ywh: ywh,
......
<!--
* @Description:
* @Autor: renchao
* @LastEditTime: 2023-09-07 15:04:46
* @LastEditTime: 2023-09-18 16:49:25
-->
<template>
<dialogBox title="新建材料信息" width="20%" isMain v-model="myValue" @closeDialog="closeDialog" @submitForm="handleSubmit"
......@@ -24,6 +24,13 @@
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="24">
<el-form-item label="材料编码" prop="clbm">
<el-input v-model="ruleForm.clbm"></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
</dialogBox>
</template>
......@@ -40,6 +47,7 @@
ruleForm: {
cllx: "",
clmc: "",
clbm: ""
},
rules: {
cllx: [
......@@ -47,14 +55,17 @@
],
clmc: [
{ required: true, message: '请输入材料名称', trigger: 'blur' }
],
clbm: [
{ required: true, message: '请输入材料编码', trigger: 'blur' }
]
}
}
},
watch: {
value (val) {
this.myValue = val;
},
this.myValue = val
}
},
methods: {
/**
......@@ -66,6 +77,7 @@
this.ruleForm = {
cllx: "",
clmc: "",
clbm: ""
}
},
/**
......@@ -79,6 +91,7 @@
this.ruleForm = {
cllx: "",
clmc: "",
clbm: ""
}
this.$emit("input", false);
} else {
......
<!--
* @Description:
* @Autor: renchao
* @LastEditTime: 2023-09-15 10:09:10
* @LastEditTime: 2023-09-18 16:57:31
-->
<template>
<div class="clxx">
......@@ -62,9 +62,7 @@
import imagePreview from "./dialog/imagePreview.vue";
import clxxAddDialog from "./dialog/clxxAddDialog.vue";
import clxxDetailDialog from "./dialog/clxxDetailDialog.vue";
import { getCompanyMaterialList, addCompanyMaterial, getFileListByBsmMaterial } from "@/api/company.js";
import { saveClml, getClmxList } from "@/api/clxx.js";
import { repairInitClml } from "@/api/djbRepair.js";
import { repairInitClml, saveClml } from "@/api/clxx.js";
export default {
components: { clxxAddDialog, imagePreview, clxxDetailDialog },
props: {
......@@ -100,7 +98,7 @@
watch: {
workFresh: {
handler (newValue, oldValue) {
this.clmlInitList()
if (newValue) this.clmlInitList()
},
deep: true,
immediate: true
......@@ -168,7 +166,7 @@
clmlInitList (type) {
// 1:列表初始化 2:新增材料
return new Promise((resolve) => {
getCompanyMaterialList(this.formData.bsmCompany).then((res) => {
repairInitClml(this.$parent).then((res) => {
if (res.code == 200) {
resolve(res.code);
if (res.result && res.result.length > 0) {
......@@ -244,12 +242,7 @@
* @author: renchao
*/
addSave (data) {
let obj = {
bsmCompany: this.formData.bsmCompany,
clmc: data.clmc,
cllx: data.cllx
};
addCompanyMaterial(obj).then(async (res) => {
saveClml({ ...data, bsmSldy: this.$parent.bsmRepair, bsmSlsq: this.$parent.bsmSlsq }).then(async (res) => {
if (res.code == 200) {
let res = await this.clmlInitList(2);
if (res == 200)
......@@ -290,7 +283,6 @@
store.dispatch("user/reWorkFresh", false);
ywPopupDialog("申请材料目录", "xxba/components/clxx/dialog/clxxDetailDialog", {
data: this.tableData,
bsmCompany: this.formData.bsmCompany
}, "60%", true, false)
},
//设置tableData
......
/*
* @Description:
* @Autor: renchao
* @LastEditTime: 2023-09-15 09:31:37
* @LastEditTime: 2023-09-18 16:32:42
*/
//流程环节操作按钮
export function getForm (tabName) {
......@@ -82,7 +82,7 @@ export function getForm (tabName) {
form = require("@/views/djbworkflow/djbBook/components/blxxtabs/cfdj.vue");
break;
case "clxx":
form = require("@/views/djbworkflow/djbBook/components/clxx/index.vue");
form = require("@/views/djbworkflow/components/clxx/index.vue");
break;
case "spyj":
form = require("@/views/djbworkflow/djbBook/spyj.vue");
......
<!--
* @Description:
* @Autor: renchao
* @LastEditTime: 2023-09-15 15:38:53
-->
<template>
<div class="clmlmx-box">
<lb-table :column="column" :key="key" row-key="bsmMaterial" ref="listTable" :heightNumSetting="true" :calcHeight="500" :pagination="false"
:data="tableData">
</lb-table>
<div class="text-center">
<el-button @click="handleCancel">取消</el-button>
<el-button type="primary" @click="handleSubmit" :loading="loading">保存</el-button>
</div>
</div>
</template>
<script>
import store from '@/store/index.js'
import Sortable from 'sortablejs'
import { ywPopupCacel } from "@/utils/popup.js";
import { editCompanyMaterialList } from "@/api/company.js";
export default {
props: {
formData: {
type: Object,
default: () => {
return {}
}
}
},
data () {
return {
loading: false,
sortable: null,
column: [
{
label: "材料名称",
render: (h, scope) => {
return (
<el-input value={scope.row.clmc} onInput={(val) => { scope.row.clmc = val }}></el-input>
)
}
},
{
label: "材料编码",
render: (h, scope) => {
return (
<el-input value={scope.row.clbm} onInput={(val) => { scope.row.clbm = val }}></el-input>
)
}
},
{
label: "材料类型",
width: "110",
render: (h, scope) => {
return (
<el-select value={scope.row.cllx}
onChange={(val) => { scope.row.cllx = val }}>
{
store.getters.dictData['A40'].map(option => {
return (
<el-option label={option.dname} value={option.dcode}></el-option>
)
})
}
</el-select>
)
}
},
{
label: "页数",
width: "80",
render: (h, scope) => {
if (scope.row.count && scope.row.count > 0) {
return (
<div>
<span>{scope.row.count}</span>
</div>
);
} else {
return (
<div>
<span>0</span>
</div>
);
}
},
},
{
label: "操作",
width: "100",
render: (h, scope) => {
return (
<el-button
type="text"
icon="el-icon-delete"
disabled={scope.row.count != 0}
onClick={() => {
this.handleDelete(scope.$index, scope.row);
}}
>
删除
</el-button>
)
}
}
],
key: 0,
tableData: []
}
},
mounted () {
this.initSort()
this.tableData = _.cloneDeep(this.formData.data)
},
beforeDestroy () {
if (this.sortable) {
this.sortable.destroy();
}
},
watch: {
'formData.data': {
handler: function (val, oldVal) {
this.tableData = _.cloneDeep(val)
},
immediate: true,
deep: true
}
},
methods: {
handleCancel () {
ywPopupCacel()
},
handleSubmit () {
this.loading = true
store.dispatch('user/reWorkFresh', false)
editCompanyMaterialList(this.tableData, this.formData.bsmCompany).then(res => {
this.loading = false
if (res.code == 200) {
this.$message({
message: '保存成功',
type: 'success'
})
store.dispatch('user/reWorkFresh', true)
ywPopupCacel()
}
}).catch(() => {
this.loading = false
})
},
/**
* @description: 材料目录删除
* @param {*} index
* @param {*} row
* @author: renchao
*/
handleDelete (index, row) {
this.$confirm('此操作将永久删除该 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.tableData.splice(index, 1);
}).catch(() => {
this.$message({
type: 'info',
message: '已取消删除'
})
})
},
initSort () {
const el = this.$refs.listTable.$el.querySelectorAll('.el-table__body-wrapper > table > tbody')[0]
this.sortable = Sortable.create(el, {
ghostClass: 'sortable-ghost',
setData: function (dataTransfer) {
dataTransfer.setData('Text', '')
},
onEnd: evt => {
const targetRow = this.tableData.splice(evt.oldIndex, 1)[0];
this.tableData.splice(evt.newIndex, 0, targetRow);
}
})
}
}
}
</script>
<style scoped lang='scss'>
@import "~@/styles/mixin.scss";
.clmlmx-box {
margin: 0 auto;
.title {
text-align: center;
height: 60px;
line-height: 60px;
border: 1px solid #dfe6ec;
font-size: 20px;
background: #81d3f81a;
margin-bottom: -1px;
}
}
</style>
<!--
* @Description:
* @Autor: renchao
* @LastEditTime: 2023-09-14 16:24:07
-->
<template>
<div class="rlPopup">
<div class="prev handle-btn" v-if="!isScan" @click="prev()">
<i class="el-icon-arrow-left"></i>
</div>
<div class="next handle-btn" v-if="!isScan" @click="next()">
<i class="el-icon-arrow-right"></i>
</div>
<div class="img-list-wrap" v-Loading="loading">
<img src="http://127.0.0.1:38088/video=stream&camidx=0" v-if="isScan" alt="高拍仪">
<div v-for="(img, i) in previewImg.imgList" :key="i" v-else>
<photo-zoom :url="img.fileurl" :bigWidth="165" v-if="i === previewImg.index" :scale="2"
overlayStyle="width: 100%;height:100%">
</photo-zoom>
</div>
</div>
<!--缩略图-->
<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" :key="key" action="" :show-file-list="false" :multiple="true" :auto-upload="false"
:on-change="handleChange"
accept=".JPG, .PNG, .JPEG,.jpg, .png, .jpeg">
<el-button icon="el-icon-upload" type="primary" v-if="ableOperation">上传</el-button>
</el-upload>
<!-- 左移右移 -->
<el-button type="primary" @click="handleMove('left')" v-if="ableOperation">左移</el-button>
<el-button type="primary" @click="handleMove('right')" v-if="ableOperation">右移</el-button>
<el-button type="primary" icon="el-icon-delete-solid" @click="handleDelete"
v-if="thumbnailImages.length>0 && ableOperation">删除</el-button>
<div v-if="ableOperation" class="pl-5">
<el-button type="primary" @click="handleOpenScan" v-if="ableOperation" :loading="loading">{{scanTitle}}</el-button>
<el-button type="primary" @click="handleViewScan" v-if="isScan && ableOperation">拍照</el-button>
</div>
</div>
<ul>
<li v-for="(img, index) in thumbnailImages" :key="index" :class="{ active: previewImg.index === index }"
@click="showCurrent(index)">
<img :src="img.fileurl">
</li>
</ul>
</div>
<!-- 点开后的视图 -->
<publicPicture v-if="showViewer" :url-list="allLi" :initialIndex="initialIndex" @close-viewer="closeViewer">
</publicPicture>
</div>
</template>
<script>
import PhotoZoom from '@/components/PhotoZoom'
import { getAltimeterInfo, getUuid } from '@/utils/operation.js'
import { uploadBatch, deleteFile, move } from "@/api/company.js"
import publicPicture from '@/components/publicPicture/index.vue'
export default {
name: 'PreviewImage',
props: {
previewImg: {
type: Object,
default: () => { }
},
ableOperation: {
type: Boolean,
default: true
}
},
components: {
PhotoZoom,
publicPicture
},
data () {
return {
loading: false,
key: 0,
isScan: false,
// 打开高拍仪
scanTitle: '打开高拍仪',
transform: {
scale: 1,
degree: 0
},
maxFileLength: 0,
// 缩略图
thumbnailImages: [],
showViewer: false,
initialIndex: 0,
allLi: [],
}
},
watch: {
previewImg: {
handler (newValue, oldValue) {
if (newValue.imgList && newValue.imgList.length > 0) {
this.allLi = _.cloneDeep(newValue.imgList).map(item => item.fileurl)
this.thumbnailImages = newValue.imgList
} else {
this.allLi = []
this.thumbnailImages = []
}
},
deep: true,
immediate: true
}
},
created () {
this.maxLength = 0;
this.allLi = _.cloneDeep(this.previewImg.imgList).map(item => item.fjurl)
this.thumbnailImages = this.previewImg.imgList
},
computed: {
isFirst () {
return this.previewImg.index === 0
},
isLast () {
return this.previewImg.index === this.previewImg.imgList.length - 1
}
},
methods: {
/**
* @description: 打开高拍仪
* @author: renchao
*/
handleOpenScan () {
this.isScan = !this.isScan
if (this.isScan) {
this.loading = true
this.$message({
message: '正在启动程序请稍等',
type: 'success'
})
setTimeout(() => {
this.scanTitle = '关闭高拍仪'
this.loading = false
}, 3000)
} else {
this.scanTitle = '打开高拍仪'
}
},
/**
* @description: 左右移动
* @param {*} direction
* @author: renchao
*/
handleMove (direction) {
move(this.previewImg.imgList[this.previewImg.index].bsmFile, direction).then(res => {
if (res.code == 200) {
if (direction == 'left') {
this.previewImg.index = this.previewImg.index - 1
} else {
this.previewImg.index = this.previewImg.index + 1
}
this.initialIndex = this.previewImg.index
this.$emit('updateList', { children: res.result, bsmMaterial: this.previewImg.bsmMaterial })
this.$message({
message: '移动成功!',
type: 'success'
})
} else {
this.$message.error(res.message);
}
})
},
/**
* @description: 拍照
* @author: renchao
*/
handleViewScan () {
function dataURLtoBlob (base64String) {
const arr = base64String.split(',');
if (arr.length !== 2) {
throw new Error('Invalid Base64 format');
}
const mime = arr[0].match(/:(.*?);/)[1];
if (!mime) {
throw new Error('Cannot retrieve MIME type');
}
const bstr = atob(arr[1]);
const n = bstr.length;
const u8arr = new Uint8Array(n);
for (let i = 0; i < n; i++) {
u8arr[i] = bstr.charCodeAt(i);
}
return new Blob([u8arr], { type: mime });
}
function blobToFile (blob) {
let name = getUuid(8) + '.jpg'
const file = new File([blob], name);
return file;
}
getAltimeterInfo().then(res => {
let blob = dataURLtoBlob('data:image/png;base64,' + res.data.photoBase64);
let file = blobToFile(blob);
var formData = new FormData();
formData.append('file', file)
formData.append("bsmMaterial ", this.previewImg.bsmMaterial);
formData.append("bsmSlsq", this.previewImg.bsmSlsq);
uploadSjClmx(formData).then((res) => {
if (res.code == 200) {
this.$emit('updateList', res.result)
this.$message({
message: '上传成功!',
type: 'success'
})
}
})
})
},
/**
* @description: prev
* @author: renchao
*/
prev () {
let len = this.previewImg.imgList.length
if (this.isFirst || len == 0) {
this.$emit('prevPriview')
} else {
this.$parent.previewImg.index = (this.$parent.previewImg.index - 1 + len) % len
}
},
/**
* @description: next
* @author: renchao
*/
next () {
let len = this.previewImg.imgList.length
if (this.isLast || len == 0) {
this.$emit('nextPriview')
} else {
this.$parent.previewImg.index = (this.$parent.previewImg.index + 1) % len
}
},
/**
* @description: showCurrent
* @param {*} index
* @author: renchao
*/
showCurrent (index) {
this.previewImg.index = index
this.initialIndex = index
},
/**
* @description: closeViewer
* @author: renchao
*/
closeViewer () {
this.showViewer = false
},
/**
* @description: clickImage
* @author: renchao
*/
clickImage () {
this.showViewer = true
},
/**
* @description: handleChange
* @param {*} file
* @param {*} files
* @author: renchao
*/
async handleChange (file, fileList) {
let length = fileList.length;
this.maxFileLength = Math.max(length, this.maxFileLength)
var formData = new FormData();
setTimeout(() => {
if (this.maxFileLength !== length) {
return
}
let num = 0, max = 0;
const isLt5M = file.size / 1024 / 1024 < 5;
fileList.forEach(item => {
if (!isLt5M) {
max++
}
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;
}
if (max >= 1) {
this.$message.error('上传图片大小不能超过 5MB!');
this.key++
return;
}
formData.append("bsmMaterial", this.previewImg.bsmMaterial);
if (this.previewImg.imgList.length > 0) {
formData.append("index", this.previewImg.imgList[this.previewImg.index].sxh);
}
uploadBatch(formData).then((res) => {
if (res.code == 200) {
this.$emit('updateList', { children: res.result, bsmMaterial: this.previewImg.bsmMaterial })
this.$message({
message: '上传成功!',
type: 'success'
})
this.$refs.upload.clearFiles();
this.maxFileLength = 0
}
})
}, 0)
},
/**
* @description: handleDelete
* @author: renchao
*/
handleDelete () {
let that = this
this.$confirm('此操作将永久删除, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(async () => {
let bsmFile = this.previewImg.imgList[this.previewImg.index].bsmFile
let bsmMaterial = this.previewImg.imgList[this.previewImg.index].bsmMaterial
this.previewImg.imgList = this.previewImg.imgList.filter(item => item.bsmFile != bsmFile)
deleteFile(bsmFile).then(res => {
if (res.code == 200) {
that.$emit('updateList', { children: this.previewImg.imgList, bsmMaterial: bsmMaterial })
that.$message({
message: '删除成功!',
type: 'success'
})
}
})
}).catch(() => {
this.$message({
type: 'info',
message: '已取消删除'
})
})
}
}
}
</script>
<style lang="scss" scoped>
// 查看大图
.rlPopup {
position: relative;
width: 100%;
text-align: center;
height: 100%;
.handle-btn {
position: absolute;
top: 50%;
transform: translateY(-100%);
width: 66px;
height: 66px;
line-height: 75px;
color: #fff;
background-color: rgb(239, 239, 239);
border-radius: 50%;
cursor: pointer;
text-align: center;
transition: all 0.3s;
i {
font-size: 24px;
}
}
.handle-btn:hover {
background-color: rgb(185, 183, 183);
}
.prev {
left: 1%;
}
.next {
right: 1%;
}
.img-list-wrap {
width: 100%;
display: flex;
justify-content: center;
height: calc(100% - 80px);
align-items: center;
background: rgba(194, 190, 190, 0.1);
overflow: scroll;
img {
display: block;
object-fit: scale-down;
transition: all 0.3s;
max-width: 100%;
}
}
.thumb-wrap {
&-button {
display: flex;
justify-content: center;
.fileUpdate {
margin: 0 10px;
}
}
li {
float: left;
width: 60px;
height: 45px;
border: solid 1px #ececec;
position: relative;
margin-right: 5px;
cursor: pointer;
&:last-child {
margin-right: 0;
}
img {
max-width: 57px;
max-height: 42px;
display: block;
object-fit: scale-down;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
}
.active {
border-color: #409eff;
}
}
}
</style>
<style>
.zoom-on-hover {
position: relative;
overflow: hidden;
}
.zoom-on-hover .normal {
width: 100%;
}
.zoom-on-hover .zoom {
position: absolute;
opacity: 0;
transform-origin: top left;
}
.zoom-on-hover.zoomed .zoom {
opacity: 1;
}
.zoom-on-hover.zoomed .normal {
opacity: 0;
}
</style>
<!--
* @Description:
* @Autor: renchao
* @LastEditTime: 2023-09-15 10:08:50
* @LastEditTime: 2023-09-18 16:14:31
-->
<template>
<div class="clxx">
......@@ -13,7 +13,7 @@
type="primary"
native-type="submit"
@click="viewDetail"
style="width: 100%; margin-top: 10px">申请材料目录</el-button>
style="width: 100%; margin-top: 10px" v-if="tableData.length > 0">申请材料目录</el-button>
<div class="item">
材料目录({{ tableData.length }})
<div style="margin-top: 10px">
......@@ -29,12 +29,12 @@
</div>
<div
v-for="(item, index) in tableData"
:key="item.bsmSj"
:class="['child', treeCheckId == item.bsmSj ? 'checked' : '']"
:key="item.bsmMaterial"
:class="['child', treeCheckId == item.bsmMaterial ? 'checked' : '']"
@click="treeClick(item, index)">
<span v-if="item.isrequired == 1" class="required">必选</span>
{{ item.sjmc }}
<span class="cl_number" :key="key">({{ item.ys ? item.ys : 0 }})</span>
{{ item.clmc }}
<span class="cl_number" :key="key" v-if="item.count">({{ item.count }})</span>
<span class="cl_number" :key="key" v-else>(0)</span>
</div>
</div>
</div>
......@@ -42,37 +42,37 @@
type="primary"
native-type="submit"
style="width: 100%"
@click="handleAdd()"
v-if="ableOperation">新增</el-button>
@click="handleAdd()">新增</el-button>
</div>
<image-preview
ref="imageRef"
v-if="tableData.length > 0"
:previewImg="previewImg"
:ableOperation="ableOperation"
@updateList="updateList"
@nextPriview="nextPriview"
@prevPriview="prevPriview" />
</div>
</div>
<clxxAddDialog v-model="isDialog" />
</div>
</template>
<script>
import { mapGetters } from "vuex";
import clxxAddDialog from "@/views/workflow/components/dialog/clxxAddDialog.vue";
import clxxDetailDialog from "@/views/workflow/components/dialog/clxxDetailDialog.vue";
import imagePreview from "@/views/components/imagePreview.vue";
import { saveClml, getClmxList } from "@/api/clxx.js";
import { repairInitClml } from "@/api/djbRepair.js";
import store from '@/store/index.js'
import { ywPopupDialog } from "@/utils/popup.js";
import imagePreview from "./dialog/imagePreview.vue";
import clxxDetailDialog from "./dialog/clxxDetailDialog.vue";
import { repairInitClml, saveClml, getClmxList } from "@/api/clxx.js";
export default {
components: { clxxAddDialog, imagePreview, clxxDetailDialog },
components: { imagePreview, clxxDetailDialog },
props: {
formData: {
type: Object,
default: () => {
return {}
}
}
},
data () {
return {
//表单是否可操作
ableOperation: true,
isDialog: false,
iclass: "",
// 材料目录选中
treeCheckIndex: 0,
......@@ -80,34 +80,29 @@
key: 0,
tableData: [],
previewImg: {
// 收件标识码
bsmSj: "",
bsmSlsq: this.$parent.bsmSlsq,
bsmMaterial: "",
index: 0,
selectedIndex: 0,
imgList: [],
},
};
},
computed: {
...mapGetters(["dictData"]),
},
created () {
this.clmlInitList(1);
imgList: []
}
}
},
computed: {
// 判断补录数据和临时数据
...mapGetters(["workFresh"]),
workFresh () {
return store.state.user.workFresh
}
},
watch: {
workFresh: {
handler (newVal, oldVal) {
if (newVal) this.clmlInitList(1);
},
handler (newValue, oldValue) {
if (newValue) this.clmlInitList()
},
deep: true,
immediate: true
}
},
mounted () {
this.ableOperation = this.$parent.ableOperation;
created () {
this.clmlInitList()
},
methods: {
/**
......@@ -118,19 +113,19 @@
if (this.treeCheckIndex < this.tableData.length) {
this.treeCheckIndex++;
if (this.tableData[this.treeCheckIndex]) {
this.treeCheckId = this.tableData[this.treeCheckIndex].bsmSj;
this.treeCheckId = this.tableData[this.treeCheckIndex].bsmMaterial;
// 判断页数
let ys = this.tableData[this.treeCheckIndex].ys
this.previewImg.index = 0;
// 获取材料明细
if (ys > 0) {
getClmxList(this.treeCheckId).then(res => {
this.previewImg.imgList = res.result ? res.result : [];
getFileListByBsmMaterial(this.treeCheckId).then(res => {
this.previewImg.imgList = res.result ? res.result : []
})
} else {
this.previewImg.imgList = []
}
this.previewImg.bsmSj = this.tableData[this.treeCheckIndex].bsmSj;
this.previewImg.bsmMaterial = this.tableData[this.treeCheckIndex].bsmMaterial;
} else {
this.$message.error('没有最后一张了');
}
......@@ -143,20 +138,19 @@
prevPriview () {
if (this.treeCheckIndex >= 1) {
this.treeCheckIndex--;
this.treeCheckId = this.tableData[this.treeCheckIndex].bsmSj;
this.treeCheckId = this.tableData[this.treeCheckIndex].bsmMaterial;
// 判断页数
let ys = this.tableData[this.treeCheckIndex].ys
if (ys > 0) {
// 获取材料明细
getClmxList(this.treeCheckId).then(res => {
this.previewImg.imgList = res.result ? res.result : [];
getFileListByBsmMaterial(this.treeCheckId).then(res => {
this.previewImg.imgList = res.result ? res.result : []
this.previewImg.index = this.previewImg.imgList.length - 1;
})
} else {
this.previewImg.imgList = [];
this.previewImg.index = 0
}
this.previewImg.bsmSj = this.tableData[this.treeCheckIndex].bsmSj;
this.previewImg.bsmMaterial = this.tableData[this.treeCheckIndex].bsmMaterial;
} else {
this.$message.error('没有第一张了');
}
......@@ -167,20 +161,9 @@
* @author: renchao
*/
clmlInitList (type) {
//type 1:列表初始化 2:新增材料
// 1:列表初始化 2:新增材料
return new Promise((resolve) => {
this.unitData = this.$parent.unitData;
var formdata = new FormData();
formdata.append("bsmSlsq", this.$parent.bsmSlsq);
if (this.$route.query.sqywbm == "DJBBL") {
formdata.append("bsmSldy", this.$parent.bsmRepair);
formdata.append("clfl", 3);
} else {
formdata.append("bsmSldy", this.$parent.currentSelectProps.bsmSldy);
formdata.append("clfl", 2);
}
repairInitClml(formdata).then((res) => {
repairInitClml(this.formData).then((res) => {
if (res.code == 200) {
resolve(res.code);
if (res.result && res.result.length > 0) {
......@@ -198,8 +181,8 @@
} else {
this.$message.error(res.message);
}
});
});
})
})
},
/**
* @description: setChecked
......@@ -207,12 +190,12 @@
* @author: renchao
*/
setChecked (item) {
this.treeCheckId = item.bsmSj;
this.treeCheckId = item.bsmMaterial;
this.title = item.sjmc;
this.titleYs = 1;
this.titleNum = item.children.length;
this.previewImg.imgList = item.children;
this.previewImg.bsmSj = item.bsmSj;
this.previewImg.bsmMaterial = item.bsmMaterial;
},
/**
* @description: updateList
......@@ -224,8 +207,8 @@
if (val.children.length != 0) {
//删除最后一张图片时 val=null
this.tableData.forEach((item) => {
if (item.bsmSj === val.bsmSj) {
item.ys = val.children.length;
if (item.bsmMaterial == val.bsmMaterial) {
item.count = val.children.length
}
});
this.previewImg.imgList = _.cloneDeep(val.children);
......@@ -236,54 +219,12 @@
} else {
this.previewImg.imgList = [];
this.tableData.forEach((item, index) => {
if (this.treeCheckId == item.bsmSj) {
item.ys = 0;
if (this.treeCheckId == item.bsmMaterial) {
item.count = 0;
that.treeCheckIndex = index;
}
});
}
},
/**
* @description: 添加材料目录
* @author: renchao
*/
handleAdd () {
this.isDialog = true;
},
/**
* @description: 新增弹窗保存
* @param {*} data
* @author: renchao
*/
addSave (data) {
let obj = {
bsmSlsq: this.$parent.bsmSlsq,
isrequired: "1",
sjmc: data.clmc,
sjsl: 0,
smzt: "",
ys: 0,
sjlx: data.cllx,
sfxjcl: "1", // 是否必选
sfggcl: data.sfggcl,
};
//是否公共材料
if (data.sfggcl == "0") {
obj["bsmSldy"] = this.$parent.currentSelectProps.bsmSldy;
}
if (this.$route.query.sqywbm == "DJBBL") {
obj.bsmSldy = this.$parent.bsmRepair
}
saveClml(obj).then(async (res) => {
if (res.code == 200) {
let res = await this.clmlInitList(2);
if (res == 200)
this.$message({
message: "新增成功",
type: "success",
});
})
}
});
},
/**
* @description: 材料目录点击选中
......@@ -293,13 +234,12 @@
*/
treeClick (item, index) {
this.previewImg.index = 0;
this.treeCheckId = item?.bsmSj;
this.treeCheckId = item?.bsmMaterial;
this.treeCheckIndex = index;
// 获取材料明细
getClmxList(item.bsmSj).then(res => {
this.previewImg.imgList = res.result ? res.result : [];
getClmxList(item.bsmMaterial).then(res => {
this.previewImg.imgList = res.result ? res.result : []
})
this.previewImg.bsmSj = item?.bsmSj;
this.previewImg.bsmMaterial = item?.bsmMaterial;
},
/**
* @description: 小图片点击
......@@ -313,20 +253,11 @@
},
//查看明细
viewDetail () {
this.$store.dispatch("user/reWorkFresh", false);
this.$popupDialog(
"申请材料目录",
"workflow/components/dialog/clxxDetailDialog",
{
store.dispatch("user/reWorkFresh", false);
ywPopupDialog("申请材料目录", "xxba/components/clxx/dialog/clxxDetailDialog", {
data: this.tableData,
bsmSldy: this.$parent.currentSelectProps.bsmSldy,
unitData: this.$parent.unitData,
ableOperation: this.$parent.ableOperation,
bsmRepair: this.$parent.bsmRepair
},
"60%",
true
);
bsmCompany: this.formData.bsmCompany
}, "50%", true, false)
},
//设置tableData
setTableData (tableData) {
......@@ -335,11 +266,10 @@
})
}
}
};
}
</script>
<style scoped lang="scss">
@import "~@/styles/mixin.scss";
.active {
background: $light-blue !important;
color: #fff;
......@@ -357,10 +287,10 @@
.clxx {
width: 100%;
height: 94%;
min-height: 360px;
display: flex;
padding-left: 5px;
height: calc(100vh - 125px);
.left {
display: flex;
flex-direction: column;
......
<!--
* @Description:
* @Autor: renchao
* @LastEditTime: 2023-09-18 14:42:14
* @LastEditTime: 2023-09-18 15:48:15
-->
<template>
<div class="tableBox">
......@@ -97,6 +97,7 @@
<script>
import Router from '@/router'
import { datas } from "../qlxxFormData.js";
import { ywPopupDialog } from "@/utils/popup.js";
import printTemplate from "../components/printTemplate.vue";
import { getXtParamsByYwh, getBlParamsByYwh } from '@/api/djyw'
export default {
......@@ -234,8 +235,7 @@
} else {
getBlParamsByYwh(ywh, bsmQlxx).then(res => {
let data = res.result
const { href } = Router.resolve('/workFrameView?bsmSlsq=' + data.bsmSlsq + '&bestepid=' + data.bestepid + '&bsmBusiness=' + data.bsmBusiness + '&type=jdcx')
window.open(href, `urlname${data.bsmSlsq}`)
ywPopupDialog("材料信息", "registerBook/components/clxx/index", data, "60%", true, false)
})
}
}
......
<!--
* @Description:
* @Autor: renchao
* @LastEditTime: 2023-09-15 10:02:12
* @LastEditTime: 2023-09-18 16:28:16
-->
<template>
<div class="clxx">
......@@ -167,7 +167,6 @@
//type 1:列表初始化 2:新增材料
return new Promise((resolve) => {
this.unitData = this.$parent.unitData;
console.log(this.$parent.unitData, 'this.$parent.unitData;');
var formdata = new FormData();
formdata.append("bsmSlsq", this.$parent.bsmSlsq);
if (this.$route.query.sqywbm == "DJBBL") {
......