多体系建设信息化条统-前端
祖安之光
2026-02-10 dd0f652df2d9d9977ade12b80d999b6fe6e52909
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>
@@ -33,7 +34,7 @@
      <el-table-column label="条款编号" prop="clauseNum" align="center" width="90"/>
      <el-table-column label="条款内容" prop="name" align="center" width="150"/>
<!--      <el-table-column label="审核要点" prop="points" align="center"/>-->
      <el-table-column label="审核要点" prop="points" align="center" >
      <el-table-column label="审核要点" prop="points" align="left" header-align="center" >
        <template #default="scope">
          <div  v-html="scope.row.points"  ></div>
        </template>
@@ -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'))
@@ -136,7 +181,7 @@
}
const openDialog = (type, value) => {
  dialogRef.value.openDialog(type, value, data.queryParams.companyId);
  dialogRef.value.openDialog(type, value, data.queryParams.companyId,data.isAdmin, data.companyList);
}
/** 重置新增的表单以及其他数据  */
@@ -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(
      '确定删除此条数据?',
@@ -160,7 +247,7 @@
        type: 'warning',
      })
      .then( async() => {
        const res = await delSysClause({id: val.id})
        const res = await delSysClause({id: val.id,companyId: data.queryParams.companyId})
        if(res.code == 200){
          ElMessage.success('数据删除成功')
          await getList()