From dd0f652df2d9d9977ade12b80d999b6fe6e52909 Mon Sep 17 00:00:00 2001
From: 祖安之光 <11848914+light-of-zuan@user.noreply.gitee.com>
Date: Tue, 10 Feb 2026 09:58:57 +0800
Subject: [PATCH] 复制条款
---
src/views/system/clauseManage/index.vue | 91 ++++++++++++++++++++++++++++++++++++++++++++-
1 files changed, 89 insertions(+), 2 deletions(-)
diff --git a/src/views/system/clauseManage/index.vue b/src/views/system/clauseManage/index.vue
index 4aa326e..1415299 100644
--- a/src/views/system/clauseManage/index.vue
+++ b/src/views/system/clauseManage/index.vue
@@ -24,6 +24,7 @@
<el-form-item >
<el-button v-if="isAdmin" type="primary" @click="getList">查询</el-button>
<el-button v-if="isAdmin" type="primary" plain @click="reset">重置</el-button>
+ <el-button v-if="isAdmin" type="primary" plain @click="copyMenu">复制条款</el-button>
</el-form-item>
</el-form>
</div>
@@ -56,6 +57,46 @@
/>
<edit-dialog ref="dialogRef" @getList=getList></edit-dialog>
+ <el-dialog
+ v-model="copyVisible"
+ width="500px"
+ :before-close="handleClose"
+ :close-on-press-escape="false"
+ :close-on-click-modal="false"
+ >
+ <span style="display:block;margin-bottom: 8px">将以下企业条款</span>
+ <el-select
+ v-model="queryParams.companyId"
+ filterable
+ style="width: 100%;margin-bottom: 15px"
+ disabled
+ >
+ <el-option
+ v-for="item in data.companyList"
+ :key="item.id"
+ :label="item.name"
+ :value="item.id"
+ />
+ </el-select>
+ <span style="display:block;margin-bottom: 8px">复制到:</span>
+ <el-select
+ v-model="chooseCompanyId"
+ filterable
+ style="width: 100%;margin-bottom: 15px"
+ placeholder="请选择企业"
+ >
+ <el-option
+ v-for="item in data.companyList"
+ :key="item.id"
+ :label="item.name"
+ :value="item.id"
+ />
+ </el-select>
+ <div class="dialog-footer" style="display: flex;justify-content: right">
+ <el-button @click="handleClose" size="default">取 消</el-button>
+ <el-button type="primary" @click="onSubmitCopy" size="default" v-preReClick>确认</el-button>
+ </div>
+ </el-dialog>
</div>
</template>
@@ -67,6 +108,7 @@
import Cookies from "js-cookie";
import editDialog from './components/editDialog.vue'
import {
+ copySysClause,
delInfoPlatforms,
delRoster,
delSysClause,
@@ -75,6 +117,7 @@
getSysClause
} from "@/api/staffManage/staff";
import useUserStore from "@/store/modules/user";
+import {getCatalogue} from "@/api/qualityManage/catalog";
const userStore = useUserStore()
const { proxy } = getCurrentInstance();
const loading = ref(false);
@@ -88,10 +131,12 @@
total: 0,
dataList: [],
companyList: [],
- isAdmin: false
+ isAdmin: false,
+ copyVisible: false,
+ chooseCompanyId: null
});
-const { queryParams, total, dataList,companyList, isAdmin } = toRefs(data);
+const { queryParams, total, dataList,companyList, isAdmin,copyVisible,chooseCompanyId } = toRefs(data);
const userInfo = ref()
onMounted(async ()=>{
userInfo.value = JSON.parse(Cookies.get('userInfo'))
@@ -150,6 +195,48 @@
await getList()
}
+const copyMenu = () => {
+ if(!data.queryParams.companyId){
+ ElMessage.warning('请先选择要复制的企业')
+ return
+ }
+ data.copyVisible = true
+}
+const handleClose = () => {
+ data.chooseCompanyId = null
+ data.copyVisible = false
+}
+
+const onSubmitCopy = async () => {
+ if(!data.chooseCompanyId){
+ ElMessage.warning('请选择目标企业')
+ return
+ }
+ ElMessageBox.confirm(
+ '该操作将覆盖目标企业的条款数据,是否继续?',
+ '提示',
+ {
+ confirmButtonText: '确定',
+ cancelButtonText: '取消',
+ type: 'warning',
+ })
+ .then( async() => {
+ const p= {
+ targetCompanyId: data.chooseCompanyId,
+ sourceCompanyId: data.queryParams.companyId
+ }
+ const r = await copySysClause(p);
+ if(r.code === 200){
+ ElMessage.success(r.message)
+ await handleClose()
+ await getList()
+ }else{
+ ElMessage.warning(r.message)
+ }
+ }).catch(err => {
+ })
+}
+
const handleDelete = (val) => {
ElMessageBox.confirm(
'确定删除此条数据?',
--
Gitblit v1.9.2