|
@@ -263,7 +263,7 @@
|
|
|
</hc-new-dialog>
|
|
|
|
|
|
<!-- 分解文件 -->
|
|
|
- <hc-new-dialog v-model="splitModal" title="案卷分解" widths="40vw" is-row-footer @close="splitModalClose">
|
|
|
+ <hc-new-dialog v-model="splitModal" title="案卷分解" widths="40vw" :loading="splitSaveLoad" @close="splitModalClose" @save="splitSave">
|
|
|
<div class="split-modal-content">
|
|
|
<div class="mb-6 text-4 font-bold">
|
|
|
本次分解共
|
|
@@ -273,7 +273,7 @@
|
|
|
分钟,分解完成之后,序号图标会变成 <HcIcon name="checkbox-circle" style="color:lightgreen" />
|
|
|
</div>
|
|
|
<div class="mb-6 text-orange">请不要重复提交,过会儿再来查看,分解好的文件在文件收集对应节点可查看</div>
|
|
|
- <el-button type="primary" size="large" class="split-confirm-btn" hc-btn @click="splitModalClose">好的,我知道了</el-button>
|
|
|
+ <!-- <el-button type="primary" size="large" class="split-confirm-btn" hc-btn @click="splitModalClose">好的,我知道了</el-button> -->
|
|
|
</div>
|
|
|
</hc-new-dialog>
|
|
|
|
|
@@ -554,215 +554,36 @@ const sortingClick = async () => {
|
|
|
}
|
|
|
|
|
|
const sortingNoneModal = ref(false)//无数据显示的弹窗
|
|
|
-const toSortingModal = ()=>{
|
|
|
- sortingNoneModal.value = false
|
|
|
- sortingActiveKey.value = []
|
|
|
- sortingModal.value = true
|
|
|
-}
|
|
|
+
|
|
|
|
|
|
const sortingItemData = ref([])
|
|
|
const sortingOldData = ref([])//旧数据,用来对比是否修改名字
|
|
|
|
|
|
-//获取数据
|
|
|
-const sortingItemLoading = ref(false)
|
|
|
-const getSortingItemData = () => {
|
|
|
|
|
|
-}
|
|
|
|
|
|
-//校验
|
|
|
-const tableIsInput = (val, row, key) => {
|
|
|
- //console.log(!val);
|
|
|
- //检测是否改过案卷名字
|
|
|
- if (key == 'isName') {
|
|
|
- row.isChange = true
|
|
|
- }
|
|
|
|
|
|
- row[key] = !val
|
|
|
-}
|
|
|
|
|
|
-//选择文件
|
|
|
-// const sortingActiveKey = ref('')
|
|
|
-// const sortingSelectFile = (row, index) => {
|
|
|
-// //取当前展开组的key
|
|
|
-// const key = sortingActiveKey.value;
|
|
|
-// const keys = key ? key.split('-') : [];
|
|
|
-// const active = keys.length > 0 ? keys[1]: -1;
|
|
|
-// if (Number(active) === index) {
|
|
|
-// sortingActiveKey.value = null;
|
|
|
-// } else {
|
|
|
-// sortingActiveKey.value = `item-${index}`;
|
|
|
-// }
|
|
|
-// }
|
|
|
|
|
|
const sortingActiveKey = ref([])
|
|
|
-const sortingSelectFile = (row, index) => {
|
|
|
- const key = `item-${index}`
|
|
|
- const indexNum = sortingActiveKey.value.indexOf(key)
|
|
|
- if (indexNum > -1) {
|
|
|
- sortingActiveKey.value.splice(indexNum, 1)
|
|
|
- } else {
|
|
|
- sortingActiveKey.value.push(key)
|
|
|
- if (!(row.list && row.list.length > 0)) {
|
|
|
- getSortingTableData(row, index)
|
|
|
- }
|
|
|
- }
|
|
|
-}
|
|
|
|
|
|
-//表格
|
|
|
-const sortingTableColumn = [
|
|
|
- { key:'name', name: '文件名称' },
|
|
|
-]
|
|
|
-const sortingTableData = ref([])
|
|
|
|
|
|
-//获取数据
|
|
|
-const sortingTableLoading = ref(false)
|
|
|
-const getSortingTableData = async (row, index) => {
|
|
|
- sortingTableLoading.value = true
|
|
|
- const { error, code, data } = await archiveFileApi.pageByBoxName({
|
|
|
- size: 99999,
|
|
|
- current: 1,
|
|
|
- projectId: projectId.value,
|
|
|
- contractId: contractId.value,
|
|
|
- nodeIds:nodeIds.value,
|
|
|
- boxName:row.boxName ? row.boxName : '',
|
|
|
- })
|
|
|
- sortingTableLoading.value = false
|
|
|
- if (!error && code === 200) {
|
|
|
- row.list = getArrValue(data['records'])
|
|
|
- setTableCheck(row, index)
|
|
|
- } else {
|
|
|
- row.list = []
|
|
|
- }
|
|
|
-}
|
|
|
|
|
|
-//表格ref
|
|
|
-const sorTableRef = ref([])
|
|
|
-//回显勾选
|
|
|
-const setTableCheck = async (row, index) => {
|
|
|
- //console.log(row)
|
|
|
- if (row.ids) {
|
|
|
- const keys = row.ids.split(',')
|
|
|
- for (const item of row.list) {
|
|
|
- if (keys.indexOf(item.id) > -1) {
|
|
|
- item.checked = true
|
|
|
- await nextTick()
|
|
|
- sorTableRef.value[index].toggleRowSelection(item, true)
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-}
|
|
|
|
|
|
-//多选
|
|
|
-const sortingTableKeys = ref([])
|
|
|
-const sortingTableSelection = (rows, list, event) => {
|
|
|
- //console.log(event)
|
|
|
- list.forEach(element => {
|
|
|
- element.checked = false
|
|
|
- })
|
|
|
- rows.forEach((element)=>{
|
|
|
- element.checked = true
|
|
|
- })
|
|
|
-}
|
|
|
|
|
|
-//删除
|
|
|
-const sortingDelData = (row, index) => {
|
|
|
- sortingItemData.value.splice(index, 1)
|
|
|
-}
|
|
|
|
|
|
-//添加分盒
|
|
|
-const addSortingModalClick = () => {
|
|
|
- sortingItemData.value.push({
|
|
|
- boxName: '',
|
|
|
- })
|
|
|
-}
|
|
|
|
|
|
-//确认保存
|
|
|
-const sortingModalLoading = ref(false)
|
|
|
-const sortingModalSave = async () => {
|
|
|
- sortingModalLoading.value = true
|
|
|
|
|
|
- //检测案卷名是否重复
|
|
|
- let nameRes = await checkNames()
|
|
|
- //console.log(nameRes)
|
|
|
- //return;
|
|
|
- for (let i = 0; i < nameRes.length; i++) {
|
|
|
- if (typeof nameRes[i].data == 'string') {
|
|
|
- window.$message?.error(nameRes[i].data + ',案卷名重复')
|
|
|
- sortingModalLoading.value = false
|
|
|
- return
|
|
|
- }
|
|
|
- }
|
|
|
|
|
|
- //组装数据
|
|
|
- let rows = []
|
|
|
- sortingItemData.value.forEach((item, index)=>{
|
|
|
- let obj = {
|
|
|
- ids:'',
|
|
|
- boxName:item.boxName,
|
|
|
- boxNumber:index + 1,
|
|
|
- }
|
|
|
- let list = []
|
|
|
- if (item.list) {
|
|
|
- item.list.forEach((item2)=>{
|
|
|
- if (item2.checked) {
|
|
|
- list.push(item2.id)
|
|
|
- }
|
|
|
- })
|
|
|
- obj.ids = list.join(',')
|
|
|
- } else {
|
|
|
- obj.ids = item.ids
|
|
|
- }
|
|
|
|
|
|
- rows.push(obj)
|
|
|
- })
|
|
|
|
|
|
- const { error, code, data } = await archiveFileApi.allocation({
|
|
|
- list: rows,
|
|
|
- })
|
|
|
- if (!error && code === 200) {
|
|
|
- window.$message?.success('保存成功')
|
|
|
- sortingModal.value = false
|
|
|
- } else {
|
|
|
- window.$message?.error('保存失败')
|
|
|
- }
|
|
|
- sortingModalLoading.value = false
|
|
|
-}
|
|
|
-
|
|
|
-const checkNames = () =>{
|
|
|
- const arr = []
|
|
|
- sortingItemData.value.forEach((item)=>{
|
|
|
- if (item.boxNumber) {
|
|
|
- if (item.isChange) {
|
|
|
- //是否修改过
|
|
|
- //对比旧的数据,是否相同
|
|
|
- for (let i = 0; i < sortingOldData.value.length; i++) {
|
|
|
- if (sortingOldData.value[i].boxNumber == item.boxNumber) {
|
|
|
- if (sortingOldData.value[i].boxName != item.boxName) {
|
|
|
- arr.push(
|
|
|
- archiveFileApi.getIsBoxName({
|
|
|
- boxName:item.boxName,
|
|
|
- }),
|
|
|
- )
|
|
|
- }
|
|
|
- return
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- } else {
|
|
|
- arr.push(
|
|
|
- archiveFileApi.getIsBoxName({
|
|
|
- boxName:item.boxName,
|
|
|
- }),
|
|
|
- )
|
|
|
- }
|
|
|
- })
|
|
|
- return Promise.all(arr)
|
|
|
-}
|
|
|
|
|
|
-//关闭
|
|
|
-const sortingModalClose = () => {
|
|
|
- sortingModal.value = false
|
|
|
-}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
//删除
|
|
|
const delModalClick = async (_, resolve) => {
|
|
@@ -1464,8 +1285,20 @@ const splitClick = async ()=>{
|
|
|
title: '操作确认',
|
|
|
text: '没有选择案卷时,将会对该合同段下所有案卷进行分解',
|
|
|
}, async (resolve) => {
|
|
|
+ getSaveInfoData()
|
|
|
+ resolve() //关闭弹窗的回调
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ getSaveInfoData()
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
|
|
|
- const { error, code, data, msg } = await tasksApi.saveSplit({
|
|
|
+ // splitModal.value = true
|
|
|
+}
|
|
|
+const getSaveInfoData = async ()=>{
|
|
|
+ const rows = tableCheckedKeys.value
|
|
|
+ const { error, code, data, msg } = await tasksApi.getSaveInfo({
|
|
|
contractId:contractId.value,
|
|
|
projectId:projectId.value,
|
|
|
ids:rows.map(item=>item.id).join(','),
|
|
@@ -1482,15 +1315,19 @@ const splitClick = async ()=>{
|
|
|
} else {
|
|
|
window.$message.error(msg)
|
|
|
}
|
|
|
- resolve() //关闭弹窗的回调
|
|
|
- })
|
|
|
- } else {
|
|
|
- const { error, code, data, msg } = await tasksApi.saveSplit({
|
|
|
+ // splitModal.value = true
|
|
|
+}
|
|
|
+const splitSaveLoad = ref(false)
|
|
|
+const splitSave = async ()=>{
|
|
|
+ const rows = tableCheckedKeys.value
|
|
|
+ splitSaveLoad.value = true
|
|
|
+
|
|
|
+ const { error, code, data, msg } = await tasksApi.saveSplit({
|
|
|
contractId:contractId.value,
|
|
|
projectId:projectId.value,
|
|
|
ids:rows.map(item=>item.id).join(','),
|
|
|
})
|
|
|
- splitLoad.value = false
|
|
|
+ splitSaveLoad.value = false
|
|
|
//处理数据
|
|
|
|
|
|
|
|
@@ -1498,15 +1335,17 @@ const splitClick = async ()=>{
|
|
|
splitInfo.value = data
|
|
|
splitModal.value = true
|
|
|
splitInfo.value = getObjValue(data) || {}
|
|
|
+ window.$message.success(msg)
|
|
|
+ getSplitInfo()
|
|
|
+ splitModal.value = false
|
|
|
+
|
|
|
|
|
|
} else {
|
|
|
window.$message.error(msg)
|
|
|
}
|
|
|
- }
|
|
|
-
|
|
|
- // splitModal.value = true
|
|
|
}
|
|
|
|
|
|
+
|
|
|
const splitInfo = ref({})
|
|
|
const splitList = ref([
|
|
|
|