Browse Source

Merge branch 'dev' of http://110.41.163.243:9980/kd-aiot/kd-aiot-frontend-wt into dev

xieyong 3 days ago
parent
commit
e0c1bcc1b4

+ 1 - 0
src/BIZComponents/outdetails.vue

@@ -686,6 +686,7 @@
                     categoryName: productItem.categoryName,
                     categoryCode: productItem.categoryCode,
                     bizNo: productItem.bizNo,
+                    deliveryDetailId: productItem.deliveryDetailId,
                     materialDetailList: packingItem.materialDetailList.map(
                       (materialItem) => {
                         return {

+ 1 - 1
src/api/bpm/components/offerApproval/index.js

@@ -87,7 +87,7 @@ export function adaptHiringApproval(raw = {}) {
 
 /** 根据业务主键获取录用审批详情(审批页 businessId) */
 export async function getHiringApprovalById(id) {
-  const res = await request.get(`/recruit/hiring-approvals/${id}`);
+  const res = await request.get(`/hr/recruit/hiring-approvals/${id}`);
   if (res.data.code == 0) {
     return adaptHiringApproval(res.data.data || {});
   }

+ 5 - 5
src/api/hr/hiringApproval.js

@@ -318,29 +318,29 @@ export function serializeHiringApprovalQuery(params = {}) {
 /** 录用审批分页查询 GET /recruit/hiring-approvals */
 export const getHiringApprovalPage = async (params = {}) =>
   unwrap(
-    await request.get("/recruit/hiring-approvals", {
+    await request.get("/hr/recruit/hiring-approvals", {
       params: serializeHiringApprovalQuery(params),
     }),
   );
 
-/** 录用审批详情查询 GET /recruit/hiring-approvals/{id},id 为列表主键 */
+/** 录用审批详情查询 GET /hr/recruit/hiring-approvals/{id},id 为列表主键 */
 export const getHiringApprovalById = async (id) => {
   const hiringId = keepBigIntId(id);
   if (hiringId == null || hiringId === "") {
     return Promise.reject(new Error("缺少录用审批主键"));
   }
   return adaptHiringApproval(
-    await unwrap(await request.get(`/recruit/hiring-approvals/${hiringId}`)),
+    await unwrap(await request.get(`/hr/recruit/hiring-approvals/${hiringId}`)),
   );
 };
 
 /**
- * 保存录用审批草稿 POST /recruit/hiring-approvals
+ * 保存录用审批草稿 POST /hr/recruit/hiring-approvals
  * 成功返回主键 id;前端发起时再调 BPM create
  */
 export const createHiringApproval = async (data) => {
   const payload = serializeHiringApproval(data || {});
-  return unwrap(await request.post("/recruit/hiring-approvals", payload));
+  return unwrap(await request.post("/hr/recruit/hiring-approvals", payload));
 };
 
 /** 与 create 同一接口(文档无独立修改接口) */

+ 19 - 9
src/views/bpm/handleTask/components/saleOrder/returnGoods/addReturnGoodsDialog.vue

@@ -713,21 +713,31 @@
           this.$refs.outboundDetailsDialogRef.init(this.form, list);
         });
       },
-      saveDate(data) {
-        data.forEach((item) => {
+      saveDate(data, closeDialog) {
+        const priceSources = data.map((item) =>
+          item.deliveryDetailId
+            ? this.productList.find(
+                (val) => String(val.sendProductId || val.id) === String(item.deliveryDetailId)
+              )
+            : null
+        );
+        if (priceSources.some((source) => !source)) {
+          this.$message.error('未找到对应的发货明细,无法确定退货单价');
+          return;
+        }
+        data.forEach((item, index) => {
           item['totalCount'] = item.measureQuantity;
           item['orderId'] = this.orderOption[0]?.orderId;
           item['orderNo'] = this.orderOption[0]?.orderNo;
-          this.productList.forEach((val) => {
-            if (item.productCode == val.productCode) {
-              item['singlePrice'] = val.singlePrice;
-              item['clientCode'] = item.clientCode || val.customerMark;
-              item['pricingWay'] = item.pricingWay || val.pricingWay;
-            }
-          });
+          const priceSource = priceSources[index];
+          item['sendProductId'] = priceSource.sendProductId || priceSource.id;
+          item['singlePrice'] = priceSource.singlePrice;
+          item['clientCode'] = item.clientCode || priceSource.customerMark;
+          item['pricingWay'] = item.pricingWay || priceSource.pricingWay;
         });
         this.$refs.inventoryTableref &&
           this.$refs.inventoryTableref.putTableValue(data);
+        if (closeDialog) closeDialog();
       },
       cancel() {
         this.$nextTick(() => {

+ 2 - 3
src/views/bpm/handleTask/components/saleOrder/returnGoods/outboundDetailsDialog.vue

@@ -58,10 +58,9 @@ export default {
   
     handleSave() {
       const list = this.$refs.outboundDetailsDialogRef.getValue()||[]
-      if (list.lenght==0) return this.$message.warning('请选择退货明细')
+      if (list.length==0) return this.$message.warning('请选择退货明细')
 
-      this.$emit('saveDate',list)
-      this.cancel()
+      this.$emit('saveDate',list, () => this.cancel())
     },
     cancel() {
       this.$emit('update:outboundDetailsDialogFlag', false)