gaoluyang
18 小时以前 9d5360ed6edb62f42a48f758343f9f07724b5f75
src/views/basicData/customerFileOpenSea/index.vue
@@ -15,10 +15,10 @@
                   style="width: 240px"
                   clearable
                   @change="handleQuery">
          <el-option label="零售客户"
                     value="零售客户" />
          <el-option label="进销商客户"
                     value="进销商客户" />
          <el-option label="三大油"
                     value="三大油" />
          <el-option label="外销"
                     value="外销" />
        </el-select>
        <el-button type="primary"
                   @click="handleQuery"
@@ -872,7 +872,10 @@
      label: "领用人",
      prop: "usageUserName",
      width: 120,
         fixed: "right",
      fixed: "right",
      formatData: value => {
        return value || '-';
      },
    },
    {
      label: "领用状态",
@@ -917,8 +920,13 @@
        {
          name: "回收",
          type: "text",
          disabled: row => isCustomerRecoveryLocked(row),
          showHide: row => row.usageStatus == 1,
          clickFun: row => {
            if (isCustomerRecoveryLocked(row)) {
              proxy.$modal.msgWarning("已领用并且被销售模块引用的公海客户不能回收");
              return;
            }
            recycle(row);
          },
        },
@@ -933,7 +941,12 @@
            {
               name: "编辑",
               type: "text",
               clickFun: row => {
          disabled: row => isCustomerEditLocked(row),
          clickFun: row => {
            if (isCustomerEditLocked(row)) {
              proxy.$modal.msgWarning("已领用并且被销售模块引用的公海客户不能编辑");
              return;
            }
                  openForm("edit", row);
               },
            },
@@ -1121,6 +1134,10 @@
  }
  // 打开弹框
  const openForm = (type, row) => {
    if (type === "edit" && isCustomerEditLocked(row)) {
      proxy.$modal.msgWarning("已领用并且被销售模块引用的公海客户不能编辑");
      return;
    }
    operationType.value = type;
    form.value = {};
    form.value.maintainer = userStore.nickName;
@@ -1150,6 +1167,11 @@
    }
    dialogFormVisible.value = true;
  };
  const isCustomerSalesReferenced = row => Number(row?.salesReferenceFlag || 0) === 1;
  const isCustomerRecoveryLocked = row => Number(row?.usageStatus || 0) === 1 && isCustomerSalesReferenced(row);
  const isCustomerEditLocked = row => isCustomerSalesReferenced(row) && (
    Number(row?.type) === 0 || (Number(row?.type) === 1 && Number(row?.usageStatus || 0) === 1)
  );
  // 提交表单
  const submitForm = () => {
    proxy.$refs["formRef"].validate(valid => {
@@ -1651,7 +1673,7 @@
  const downloadAttachment = row => {
    if (row.url) {
      // proxy.download(row.url, {}, row.name);
      proxy.$download.name(row.url);
         proxy.$download.byUrl(row.url, row.originalFilename);
    } else {
      proxy.$modal.msgError("下载链接不存在");
    }