taskLog.vue 16.9 KB
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571
<route lang="yaml">
  name: taskLog //分类分级任务日志
  </route>

<script lang="ts" setup name="taskLog">
import { ref, onMounted } from "vue";
import { useRouter, useRoute } from "vue-router";
import useUserStore from "@/store/modules/user";
import { ElMessage, ElMessageBox } from "element-plus";

import useDataAssetStore from "@/store/modules/dataAsset";
import { getListingList, listingDelete, listingUpdateStatus, filterVal, getParamsDataList } from "@/api/modules/dataProduct";
import { TableColumnWidth } from '@/utils/enum';

import Table from "@/components/Table/index.vue";

const { proxy } = getCurrentInstance() as any;
const router = useRouter();
const userStore = useUserStore();
const userData = JSON.parse(userStore.userData);
const assetStore = useDataAssetStore();
const datas = [
  {
    "updateTime": "2024-07-16 13:17:00",
    "updateUserName": "数往知来管理员",
    "guid": "4e0e76c48fa043d5b35d09f3ccc7c265",
    "approvalGuid": null,
    "standardSetGuid": "58d1178a04904d599284fc1e61594c43",
    "fieldStandardCode": "COL202406070021",
    "dataVersion": 1,
    "chName": "地址",
    "enName": "address",
    "dataTypeValue": "字符型",
    "dataTypeCode": "varchar",
    "dataDicGuid": "",
    "dataDicName": null,
    "isDataDic": "N",
    "fieldLength": 600,
    "fieldPrecision": null,
    "dataState": 0,
    "approveState": "N",
    "dataCategory": "合伙人",
    "dataEncryptionLevel": "界面加密",
    "businessDefDesc": "地址",
    "flowFlag": null,
    "flowCode": null,
    "functionCode": null,
    "createStaffGuid": null,
    "createUserId": "98df01b8d86c46f786dd10b4d0eb11dd",
    "displayVersion": "V1",
    "standardSetName": null,
    "ruleType": null
  },
  {
    "updateTime": "2024-01-27 10:19:45",
    "updateUserName": "数往知来管理员",
    "guid": "bc630207357c466dbff7613ea38985cc",
    "approvalGuid": null,
    "standardSetGuid": "58d1178a04904d599284fc1e61594c43",
    "fieldStandardCode": "COL202401260124",
    "dataVersion": 1,
    "chName": "包含最小销售包装单元数量",
    "enName": "inboxQuantity",
    "dataTypeValue": "整型",
    "dataTypeCode": "int",
    "dataDicGuid": null,
    "dataDicName": null,
    "isDataDic": null,
    "fieldLength": null,
    "fieldPrecision": null,
    "dataState": 1,
    "approveState": "A",
    "dataCategory": null,
    "dataEncryptionLevel": "明文显示",
    "businessDefDesc": "当前药品追溯码中包含的最小销售包装单元药品追溯码的数量,发货类型为03时可选",
    "flowFlag": null,
    "flowCode": null,
    "functionCode": null,
    "createStaffGuid": null,
    "createUserId": "98df01b8d86c46f786dd10b4d0eb11dd",
    "displayVersion": "V1",
    "standardSetName": null,
    "ruleType": null
  },
  {
    "updateTime": "2024-01-27 11:03:59",
    "updateUserName": "审批人4",
    "guid": "420f2a68bd4441bf92010eadf698b685",
    "approvalGuid": null,
    "standardSetGuid": "58d1178a04904d599284fc1e61594c43",
    "fieldStandardCode": "COL202401260122",
    "dataVersion": 1,
    "chName": "包装层级",
    "enName": "packageLevel",
    "dataTypeValue": "字符型",
    "dataTypeCode": "varchar",
    "dataDicGuid": null,
    "dataDicName": null,
    "isDataDic": null,
    "fieldLength": 200,
    "fieldPrecision": null,
    "dataState": 1,
    "approveState": "A",
    "dataCategory": null,
    "dataEncryptionLevel": "明文显示",
    "businessDefDesc": "当前药品追溯码所处包装层级描述,发货类型为03时可选",
    "flowFlag": null,
    "flowCode": null,
    "functionCode": null,
    "createStaffGuid": null,
    "createUserId": "98df01b8d86c46f786dd10b4d0eb11dd",
    "displayVersion": "V1",
    "standardSetName": null,
    "ruleType": null
  },
  {
    "updateTime": "2024-06-06 10:01:06",
    "updateUserName": "审批人1",
    "guid": "f841e1848ab94b1e81a0217a09a7a3d3",
    "approvalGuid": "b674bffe8d2f4132918016b6baaf75aa",
    "standardSetGuid": "58d1178a04904d599284fc1e61594c43",
    "fieldStandardCode": "COL202401260120",
    "dataVersion": 1,
    "chName": "上一级包装药品追溯码",
    "enName": "parentDTC",
    "dataTypeValue": "字符型",
    "dataTypeCode": "varchar",
    "dataDicGuid": "",
    "dataDicName": null,
    "isDataDic": "N",
    "fieldLength": 200,
    "fieldPrecision": null,
    "dataState": 1,
    "approveState": "Y",
    "dataCategory": "",
    "dataEncryptionLevel": "明文显示",
    "businessDefDesc": "当前药品追溯码大一级包装上的药品追溯码,发货类型为03时可选;当存在上一级包装时必选",
    "flowFlag": null,
    "flowCode": null,
    "functionCode": null,
    "createStaffGuid": null,
    "createUserId": "98df01b8d86c46f786dd10b4d0eb11dd",
    "displayVersion": "V1",
    "standardSetName": null,
    "ruleType": null
  },
  {
    "updateTime": "2024-01-26 00:10:47",
    "updateUserName": "数往知来管理员",
    "guid": "d4d42dea2a5844b4a7f9238806ea507b",
    "approvalGuid": null,
    "standardSetGuid": "58d1178a04904d599284fc1e61594c43",
    "fieldStandardCode": "COL202401260118",
    "dataVersion": 1,
    "chName": "药品追溯码",
    "enName": "DTC",
    "dataTypeValue": "字符型",
    "dataTypeCode": "varchar",
    "dataDicGuid": null,
    "dataDicName": null,
    "isDataDic": null,
    "fieldLength": 200,
    "fieldPrecision": null,
    "dataState": 0,
    "approveState": "N",
    "dataCategory": null,
    "dataEncryptionLevel": "明文显示",
    "businessDefDesc": "用于唯一标识药品各级销售包装单元的代码,发货类型为03时可选",
    "flowFlag": null,
    "flowCode": null,
    "functionCode": null,
    "createStaffGuid": null,
    "createUserId": "98df01b8d86c46f786dd10b4d0eb11dd",
    "displayVersion": "V1",
    "standardSetName": null,
    "ruleType": null
  },
  {
    "updateTime": "2024-01-26 00:10:47",
    "updateUserName": "数往知来管理员",
    "guid": "ff9d0e4f6fbb444c8dcf6f67bffcb659",
    "approvalGuid": null,
    "standardSetGuid": "58d1178a04904d599284fc1e61594c43",
    "fieldStandardCode": "COL202401260116",
    "dataVersion": 1,
    "chName": "发货数量",
    "enName": "deliveryQuantity",
    "dataTypeValue": "整型",
    "dataTypeCode": "int",
    "dataDicGuid": null,
    "dataDicName": null,
    "isDataDic": null,
    "fieldLength": null,
    "fieldPrecision": null,
    "dataState": 0,
    "approveState": "N",
    "dataCategory": null,
    "dataEncryptionLevel": "明文显示",
    "businessDefDesc": "发货的最小销售包装单元数量",
    "flowFlag": null,
    "flowCode": null,
    "functionCode": null,
    "createStaffGuid": null,
    "createUserId": "98df01b8d86c46f786dd10b4d0eb11dd",
    "displayVersion": "V1",
    "standardSetName": null,
    "ruleType": null
  },
  {
    "updateTime": "2024-01-26 00:10:46",
    "updateUserName": "数往知来管理员",
    "guid": "fe88ac9e8d9c4f148833dbb3976fca77",
    "approvalGuid": null,
    "standardSetGuid": "58d1178a04904d599284fc1e61594c43",
    "fieldStandardCode": "COL202401260114",
    "dataVersion": 1,
    "chName": "药品生产批号",
    "enName": "batch",
    "dataTypeValue": "字符型",
    "dataTypeCode": "varchar",
    "dataDicGuid": null,
    "dataDicName": null,
    "isDataDic": null,
    "fieldLength": 20,
    "fieldPrecision": null,
    "dataState": 0,
    "approveState": "N",
    "dataCategory": null,
    "dataEncryptionLevel": "明文显示",
    "businessDefDesc": "药品包装上标示的生产批号",
    "flowFlag": null,
    "flowCode": null,
    "functionCode": null,
    "createStaffGuid": null,
    "createUserId": "98df01b8d86c46f786dd10b4d0eb11dd",
    "displayVersion": "V1",
    "standardSetName": null,
    "ruleType": null
  },
  {
    "updateTime": "2024-01-26 00:10:45",
    "updateUserName": "数往知来管理员",
    "guid": "9759837e0d72472ab7441c1873c9159a",
    "approvalGuid": null,
    "standardSetGuid": "58d1178a04904d599284fc1e61594c43",
    "fieldStandardCode": "COL202401260112",
    "dataVersion": 1,
    "chName": "药品有效期截止日期",
    "enName": "expirationDate",
    "dataTypeValue": "日期型",
    "dataTypeCode": "date",
    "dataDicGuid": null,
    "dataDicName": null,
    "isDataDic": null,
    "fieldLength": null,
    "fieldPrecision": null,
    "dataState": 0,
    "approveState": "N",
    "dataCategory": null,
    "dataEncryptionLevel": "明文显示",
    "businessDefDesc": "药品有效期的截止日期",
    "flowFlag": null,
    "flowCode": null,
    "functionCode": null,
    "createStaffGuid": null,
    "createUserId": "98df01b8d86c46f786dd10b4d0eb11dd",
    "displayVersion": "V1",
    "standardSetName": null,
    "ruleType": null
  },
  {
    "updateTime": "2024-01-26 00:10:45",
    "updateUserName": "数往知来管理员",
    "guid": "a39ed6123c6a420d9d1265315e714f86",
    "approvalGuid": null,
    "standardSetGuid": "58d1178a04904d599284fc1e61594c43",
    "fieldStandardCode": "COL202401260110",
    "dataVersion": 1,
    "chName": "药品生产日期",
    "enName": "productionDate",
    "dataTypeValue": "日期型",
    "dataTypeCode": "date",
    "dataDicGuid": null,
    "dataDicName": null,
    "isDataDic": null,
    "fieldLength": null,
    "fieldPrecision": null,
    "dataState": 0,
    "approveState": "N",
    "dataCategory": null,
    "dataEncryptionLevel": "明文显示",
    "businessDefDesc": "药品包装上标示的生产日期",
    "flowFlag": null,
    "flowCode": null,
    "functionCode": null,
    "createStaffGuid": null,
    "createUserId": "98df01b8d86c46f786dd10b4d0eb11dd",
    "displayVersion": "V1",
    "standardSetName": null,
    "ruleType": null
  },
  {
    "updateTime": "2024-01-26 00:10:45",
    "updateUserName": "数往知来管理员",
    "guid": "ea597c1b8bb24a5ab053a80b084de98c",
    "approvalGuid": null,
    "standardSetGuid": "58d1178a04904d599284fc1e61594c43",
    "fieldStandardCode": "COL202401260108",
    "dataVersion": 1,
    "chName": "统一社会信用代码(进口药品代理企业)",
    "enName": "drugImporterUSCID",
    "dataTypeValue": "字符型",
    "dataTypeCode": "varchar",
    "dataDicGuid": null,
    "dataDicName": null,
    "isDataDic": null,
    "fieldLength": 18,
    "fieldPrecision": null,
    "dataState": 0,
    "approveState": "N",
    "dataCategory": null,
    "dataEncryptionLevel": "明文显示",
    "businessDefDesc": "进口药品代理企业的统一社会信用代码,进口药品必选;没有统一社会信用代码时使用组织机构代码",
    "flowFlag": null,
    "flowCode": null,
    "functionCode": null,
    "createStaffGuid": null,
    "createUserId": "98df01b8d86c46f786dd10b4d0eb11dd",
    "displayVersion": "V1",
    "standardSetName": null,
    "ruleType": null
  }
]

const page = ref({
  limit: 50,
  curr: 1,
  sizes: [
    { label: "10", value: 10 },
    { label: "50", value: 50 },
    { label: "100", value: 100 },
    { label: "150", value: 150 },
    { label: "200", value: 200 },
  ],
});
const searchItemValue: any = ref({});
const currTableData: any = ref({});
const tableInfo = ref({
  id: "mapping-table",
  fields: [
    { label: "序号", type: "index", width: 56, align: "center", fixed: "left" },
    { label: "任务名称", field: "chName", width: 96 },
    {
      label: "目录名称", field: "dataTypeValue", width: 120, type: "text_btn", columClass: 'text_btn', click: (scope) => {
        router.push({
          name: "templateConfig",
          query: { guid: scope.row.damGuid },
        });
      }
    },
    { label: "分类分级模板", field: "dataTypeValue", width: 200 },
    { label: "元数据", field: "fieldStandardCode", width: 200 },
    // {
    //   label: "是否公共数据", field: "isPublicData", width: 120, getName: (scope) => {
    //     return scope.row.isPublicData == 'Y' ? '是' : '否';
    //   }
    // },
    {
      label: "执行状态", field: "approveState", width: TableColumnWidth.STATE, align: 'center', type: "tag", getName: (scope) => {
        return filterVal(scope.row.approveState, 'approveState');
      }
    },
    { label: "任务修改人", field: "dataCategory", width: 120 },
    { label: "修改时间", field: "updateTime", width: TableColumnWidth.DATETIME },
    { label: "确认次数", field: "fieldLength", width: 96, align: 'right' },
    { label: "结果确认人", field: "updateUserName", width: 120 },
    { label: "确认时间", field: "updateTime", width: TableColumnWidth.DATETIME },
    {
      label: "结果状态", field: "approveState", width: TableColumnWidth.STATE, align: 'center', type: "tag", getName: (scope) => {
        return filterVal(scope.row.approveState, 'approveState');
      }
    },
  ],
  loading: false,
  data: datas || [],
  page: {
    type: "normal",
    rows: 0,
    ...page.value,
  },
  actionInfo: {
    label: "操作",
    type: "btn",
    width: 280,
    btns: (scope) => {
      let row = scope.row, btnArr: any = [
        { label: "结果确认", value: "confirm" },
        { label: "结果修改", value: "modify" },
        { label: "编辑", value: "edit" },
        { label: "日志", value: "log" },
        { label: "删除", value: "delete" }
      ];
      // if (row.approveState == 'Y') {
      //   if (row.listingStatus == 'Y') {
      //     btnArr.splice(0, 0, { label: "详情", value: "detail" });
      //   } else {
      //     btnArr.splice(0, 0, { label: "编辑", value: "edit" }, { label: "详情", value: "detail" }, { label: "删除", value: "delete" });
      //   }
      // } else {
      //   if (row.approveState == 'A') {
      //     btnArr.splice(0, 0, { label: "详情", value: "detail" });
      //   } else {
      //     btnArr.splice(0, 0, { label: "编辑", value: "edit" }, { label: "详情", value: "detail" }, { label: "删除", value: "delete" });
      //   }
      // }
      return btnArr;
    },
  },
});

const getTableData = () => {
  tableInfo.value.loading = true;
  getListingList(
    Object.assign({}, searchItemValue.value, {
      pageIndex: page.value.curr,
      pageSize: page.value.limit,
    })
  ).then((res: any) => {
    tableInfo.value.loading = false;
    tableInfo.value.data = res.data.records || [];
    tableInfo.value.page.curr = res.data.pageIndex;
    tableInfo.value.page.limit = res.data.pageSize;
    tableInfo.value.page.rows = res.data.totalRows;
  })
    .catch((res) => {
      tableInfo.value.loading = false;
    });
};

const tableBtnClick = (scope, btn) => {
  const type = btn.value;
  const row = scope.row;
  currTableData.value = row;
  if (type == "detail" || type === "edit") {
    toPath(type);
  } else if (type === "delete") {
    open("此操作将永久删除,是否继续?", "warning");
  }
};

const toPath = (type) => {
  if (type == 'add') {
    router.push({
      name: "taskEdit",
      query: {
        type
      },
    });
  } else {
    router.push({
      name: "taskEdit",
      query: {
        guid: currTableData.value.guid,
        name: currTableData.value.damName,
        type
      },
    });
  }
}

const tablePageChange = (info) => {
  page.value.curr = Number(info.curr);
  page.value.limit = Number(info.limit);
  tableInfo.value.page.limit = page.value.limit;
  tableInfo.value.page.curr = page.value.curr;
  getTableData();
};

const open = (msg, type, isBatch = false) => {
  ElMessageBox.confirm(msg, "提示", {
    confirmButtonText: "确定",
    cancelButtonText: "取消",
    type: type,
  }).then(() => {
    const guids = [currTableData.value.guid];
    listingDelete(guids).then((res: any) => {
      if (res.code == proxy.$passCode) {
        getFirstPageData();
        ElMessage({
          type: "success",
          message: "删除成功",
        });
      } else {
        ElMessage({
          type: "error",
          message: res.msg,
        });
      }
    }).catch((res) => {
      tableInfo.value.loading = false;
    });
  });
};

const getFirstPageData = () => {
  page.value.curr = 1
  tableInfo.value.page.curr = 1;
  getTableData();
}

onActivated(() => {
  if (assetStore.isRefresh) {//如果是首次加载,则不需要调用
    getFirstPageData();
    assetStore.set(false);
  }
})

onBeforeMount(() => {

})

</script>

<template>
  <div class="container_wrap" v-if="tableInfo.data.length">
    <div class="table_tool_wrap">
      <div class="table_title">分类分级任务</div>
    </div>
    <div class="table_panel_wrap">
      <Table :tableInfo="tableInfo" @tableBtnClick="tableBtnClick" @tablePageChange="tablePageChange" />
    </div>
  </div>
  <div class="container_wrap" v-else>
    <div class="card-noData">
      <img src="@/assets/images/no-data.png" :style="{ width: '96px', height: '96px' }" />
      <p>暂无分类分级任务,<span class="text_btn" @click="toPath('add')">去新建</span></p>
    </div>
  </div>
</template>

<style scoped lang="scss">
.table_tool_wrap {
  width: 100%;
  height: 40px !important;
  padding: 0 8px;

  .table_title {
    height: 40px;
    line-height: 40px;
    font-weight: 600;
    font-size: 16px;
    color: #212121;
  }
}

.table_panel_wrap {
  width: 100%;
  height: calc(100% - 40px);
  padding: 0px 8px 0;
}

.card-noData {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
}
</style>