From 69a87f1a00c2937f269592e481ca1a9cc4dd98e9 Mon Sep 17 00:00:00 2001
From: 张诺 <zhang_12370@163.com>
Date: 星期二, 06 一月 2026 17:58:33 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/dev_HXSJ' into dev_HXSJ

---
 src/views/collaborativeApproval/shipmentReview/index.vue |  340 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 340 insertions(+), 0 deletions(-)

diff --git a/src/views/collaborativeApproval/shipmentReview/index.vue b/src/views/collaborativeApproval/shipmentReview/index.vue
new file mode 100644
index 0000000..ac2b790
--- /dev/null
+++ b/src/views/collaborativeApproval/shipmentReview/index.vue
@@ -0,0 +1,340 @@
+<template>
+  <div class="app-container">
+    <div class="search_form">
+      <div>
+        <span class="search_title">閿�鍞悎鍚屽彿锛�</span>
+        <el-input
+            v-model="searchForm.salesContractNo"
+            style="width: 240px"
+            placeholder="璇疯緭鍏ラ攢鍞悎鍚屽彿鎼滅储"
+            @change="handleQuery"
+            clearable
+            :prefix-icon="Search"
+        />
+        <span class="search_title ml10">瀹℃壒鐘舵�侊細</span>
+        <el-select v-model="searchForm.approveStatus" clearable @change="handleQuery" style="width: 240px">
+          <el-option label="寰呭鏍�" :value="2" />
+          <el-option label="瀹℃牳鎴愬姛" :value="3" />
+          <el-option label="瀹℃牳澶辫触" :value="4" />
+        </el-select>
+        <el-button type="primary" @click="handleQuery" style="margin-left: 10px"
+        >鎼滅储</el-button
+        >
+      </div>
+      <div>
+<!--        <el-button type="primary" @click="openForm('add')">鏂板</el-button>-->
+        <el-button @click="handleOut">瀵煎嚭</el-button>
+<!--        <el-button type="danger" plain @click="handleDelete">鍒犻櫎</el-button>-->
+      </div>
+    </div>
+    <div class="table_list">
+      <PIMTable
+          rowKey="id"
+          :column="tableColumn"
+          :tableData="tableData"
+          :page="page"
+          :isSelection="true"
+          @selection-change="handleSelectionChange"
+          :tableLoading="tableLoading"
+          @pagination="pagination"
+          :total="page.total"
+      ></PIMTable>
+    </div>
+    <info-form-dia ref="infoFormDia" @close="handleQuery" :approveType="approveType"></info-form-dia>
+    <approval-dia ref="approvalDia" @close="handleQuery"></approval-dia>
+    <FileList ref="fileListRef" />
+  </div>
+</template>
+
+<script setup>
+import FileList from "./fileList.vue";
+import { Search } from "@element-plus/icons-vue";
+import {onMounted, ref} from "vue";
+import {ElMessageBox} from "element-plus";
+import InfoFormDia from "@/views/collaborativeApproval/approvalProcess/components/infoFormDia.vue";
+import ApprovalDia from "@/views/collaborativeApproval/approvalProcess/components/approvalDia.vue";
+import {getShipmentApprovalList, approveShipment} from "@/api/collaborativeApproval/shipmentReview.js";
+// import {approveProcessDelete, approveProcessListPage} from "@/api/collaborativeApproval/approvalProcess.js";
+import useUserStore from "@/store/modules/user";
+import { userListNoPage } from "@/api/system/user.js";
+
+// 瀹氫箟缁勪欢鎺ユ敹鐨刾rops
+const props = defineProps({
+  approveType: {
+    type: [Number, String],
+    default: 6
+  }
+});
+
+const userList = ref([]);
+
+const userStore = useUserStore();
+
+
+const data = reactive({
+  searchForm: {
+    approveId: "",
+    approveStatus: "",
+  },
+});
+const { searchForm } = toRefs(data);
+const tableColumn = ref([
+  {
+    label: "瀹℃壒鐘舵��",
+    prop: "approveStatus",
+    dataType: "tag",
+    width: 100,
+    formatData: (params) => {
+      if (params === 2) {
+        return "寰呭鏍�";
+      } else if (params === 3) {
+        return "瀹℃牳瀹屾垚";
+      } else if (params === 4) {
+        return "瀹℃牳椹冲洖";
+      } else {
+        return '鏈煡鐘舵��';
+      }
+    },
+    formatType: (params) => {
+      if (params === 0) {
+        return "warning";
+      } else if (params === 2) {
+        return "info";
+      } else if (params === 3) {
+        return "success";
+      } else if (params === 4) {
+        return "danger";
+      } else {
+        return 'danger';
+      }
+    },
+  },
+  {
+    label: "閿�鍞悎鍚屽彿",
+    prop: "salesContractNo",
+    width: 170
+  },
+  {
+    label: "瀹㈡埛鍚嶇О",
+    prop: "customerName",
+    width: 200
+  },
+  {
+    label: "浜у搧澶х被",
+    prop: "productCategory",
+    width: 200
+  },
+  {
+    label: "瑙勬牸鍨嬪彿",
+    prop: "specificationModel",
+    width: 220
+  },
+  {
+    label: "鐢宠浜�",
+    prop: "approveUserId",
+    width: 120,
+    align: "center",
+    formatData:(params)=>{
+      const user = userList.value.find(item => item.userId === params)
+      return user ? user.nickName : '--'
+    }
+  },
+  {
+    label: "杞︾墝鍙�",
+    prop: "shippingCarNumber",
+    width: 120,
+  },
+  {
+    label: "鐢宠浜�",
+    prop: "approveUserId",
+    width: 120,
+  },
+  {
+    label: "鐢宠鏃ユ湡",
+    prop: "executionDate",
+    width: 200
+  },
+  {
+    label: "褰撳墠瀹℃壒浜�",
+    prop: "salesman",
+    width: 120
+  },
+  {
+    dataType: "action",
+    label: "鎿嶄綔",
+    align: "center",
+    fixed: "right",
+    width: 120,
+    operation: [
+      {
+        name: "閫氳繃",
+        type: "text",
+        clickFun: (row) => {
+          handleApproval("閫氳繃", row);
+        },
+        disabled: (row) => row.approveStatus !== 2
+      },
+      {
+        name: "椹冲洖",
+        type: "text",
+        clickFun: (row) => {
+          handleApproval("椹冲洖", row);
+        },
+        disabled: (row) => row.approveStatus !== 2
+      },
+      // {
+      //   name: "缂栬緫",
+      //   type: "text",
+      //   clickFun: (row) => {
+      //     openForm("edit", row);
+      //   },
+      //   disabled: (row) => row.approveStatus == 2 || row.approveStatus == 1 || row.approveStatus == 4
+      // },
+      // {
+      //   name: "瀹℃牳",
+      //   type: "text",
+      //   clickFun: (row) => {
+      //     openApprovalDia("approval", row);
+      //   },
+      //   disabled: (row) => row.approveUserCurrentId == null || row.approveStatus == 2 || row.approveStatus == 3 || row.approveStatus == 4 || row.approveUserCurrentId !== userStore.id
+      // },
+      // {
+      //   name: "璇︽儏",
+      //   type: "text",
+      //   clickFun: (row) => {
+      //     openApprovalDia('view', row);
+      //   },
+      // },
+      // {
+      //   name: "闄勪欢",
+      //   type: "text",
+      //   clickFun: (row) => {
+      //     downLoadFile(row);
+      //   },
+      // },
+    ],
+  },
+]);
+const tableData = ref([]);
+const selectedRows = ref([]);
+const tableLoading = ref(false);
+const page = reactive({
+  current: 1,
+  size: 100,
+  total: 0
+});
+const infoFormDia = ref()
+const approvalDia = ref()
+const { proxy } = getCurrentInstance()
+
+// 鏌ヨ鍒楄〃
+/** 鎼滅储鎸夐挳鎿嶄綔 */
+const handleQuery = () => {
+  page.current = 1;
+  getList();
+};
+const fileListRef = ref(null)
+const downLoadFile = (row) => {
+  fileListRef.value.open(row.commonFileList)
+
+}
+const pagination = (obj) => {
+  page.current = obj.page;
+  page.size = obj.limit;
+  getList();
+};
+const getList =async () => {
+  let userLists = await userListNoPage();
+  userList.value = userLists.data;
+  tableLoading.value = true;
+  getShipmentApprovalList({...page, ...searchForm.value,approveType:props.approveType}).then(res => {
+    tableLoading.value = false;
+    tableData.value = res.data.records
+    page.total = res.data.total;
+  }).catch(err => {
+    tableLoading.value = false;
+  })
+};
+// 瀵煎嚭
+const handleOut = () => {
+  const type = Number(props.approveType || 6)
+  const urlMap = {
+    0: "/shipmentApproval/export",
+  }
+  const url = urlMap[type] || urlMap[0]
+  const nameMap = {
+    0: "鍙戣揣瀹℃牳琛�",
+  }
+  const fileName = nameMap[type] || nameMap[0]
+  proxy.download(url, {}, `${fileName}.xlsx`)
+}
+// 琛ㄦ牸閫夋嫨鏁版嵁
+const handleSelectionChange = (selection) => {
+  selectedRows.value = selection;
+};
+
+// 鎵撳紑鏂板銆佺紪杈戝脊妗�
+const openForm = (type, row) => {
+  nextTick(() => {
+    infoFormDia.value?.openDialog(type, row)
+  })
+};
+// 鎵撳紑鏂板妫�楠屽脊妗�
+const openApprovalDia = (type, row) => {
+  nextTick(() => {
+    approvalDia.value?.openDialog(type, row)
+  })
+};
+
+// 瀹℃牳閫氳繃/椹冲洖
+const handleApproval = (name = "瀹℃牳",row) => {
+  ElMessageBox.confirm(`閫変腑鐨勫唴瀹瑰皢琚�${name}锛屾槸鍚︾‘璁�${name}锛焋, "鎻愮ず", {
+    confirmButtonText: "纭",
+    cancelButtonText: "鍙栨秷",
+    type: "warning",
+  }).then(async()=>{
+    let res = await approveShipment({
+      id: row.id,
+      approveStatus: name === "閫氳繃" ? 3 : 4
+    });
+    if(res.code === 200){
+      proxy.$modal.msgSuccess(`${name}鎴愬姛`);
+    }else{
+      proxy.$modal.msgError(`${name}澶辫触`);
+    }
+    await getList()
+  }).catch(err=>{
+    proxy.$modal.msgError(`鏈煡閿欒,璇疯仈绯荤鐞嗗憳`);
+  })
+};
+
+// 鍒犻櫎
+const handleDelete = () => {
+  let ids = [];
+  if (selectedRows.value.length > 0) {
+    ids = selectedRows.value.map((item) => item.approveId);
+  } else {
+    proxy.$modal.msgWarning("璇烽�夋嫨鏁版嵁");
+    return;
+  }
+  ElMessageBox.confirm("閫変腑鐨勫唴瀹瑰皢琚垹闄わ紝鏄惁纭鍒犻櫎锛�", "瀵煎嚭", {
+    confirmButtonText: "纭",
+    cancelButtonText: "鍙栨秷",
+    type: "warning",
+  })
+      .then(() => {
+        approveProcessDelete(ids).then((res) => {
+          proxy.$modal.msgSuccess("鍒犻櫎鎴愬姛");
+          getList();
+        });
+      })
+      .catch(() => {
+        proxy.$modal.msg("宸插彇娑�");
+      });
+};
+onMounted(() => {
+  getList();
+});
+</script>
+
+<style scoped></style>

--
Gitblit v1.9.3