Parcourir la source

京东异常采购单明细
1、列表
2、异常处理

41235 il y a 1 an
Parent
commit
34485db19c
1 fichiers modifiés avec 146 ajouts et 449 suppressions
  1. 146 449
      src/views/WDLY/jd/abnormalDetails/index.vue

+ 146 - 449
src/views/WDLY/jd/abnormalDetails/index.vue

@@ -6,261 +6,94 @@
                 }" :action-list="[]" @get-list="getList" @moreSearch="() => (queryDialogVisible = true)"
 
     >
-    </byTable>
-    <!--回告-->
-    <el-dialog :z-index="1500" title="采购单回告" v-if="tellDialogVisible" v-model="formData.data" width="1500px" v-loading="loading">
-      <el-descriptions title="基础信息" />
-      <el-form label-width="auto" :rules="rules">
-        <el-row>
-          <el-col :span="8">
-            <el-form-item label="采购单号:" :span="8">
-              {{formData.data.orderId}}
-            </el-form-item>
-          </el-col>
-          <el-col :span="8">
-            <el-form-item label="配送中心:" :span="8">
-              {{formData.data.deliverCenterName}}
-            </el-form-item>
-          </el-col>
-          <el-col :span="8">
-            <el-form-item label="入库时间:" :span="8">
-              {{formData.data.storageTime}}
-            </el-form-item>
-          </el-col>
-        </el-row>
-        <el-row>
-          <el-col :span="8">
-            <el-form-item label="预计送货时间:" :span="8">
-              <el-date-picker v-model="formData.data.deliveryTime" type="datetime" format="YYYY-MM-DD HH:mm:ss" value-format="YYYY-MM-DD HH:mm:ss"
-                              placeholder="请选择预计送货时间" />
-            </el-form-item>
-          </el-col>
-        </el-row>
-        <el-row>
-          <el-descriptions title="采购单明细" />
-          <el-table :data="formData.data.jdOrderDetailsList" stripe style="width: 100%">
-            <!--            <el-table stripe style="width: 100%">-->
-            <el-table-column prop="wareId" label="京东商品编号" width="180">
-              <template #default="scope">
-                <span
-                      :style="scope.row.productName=='' || scope.row.productName == undefined || scope.row.productName == 'undefined'?'color: red':''">{{scope.row.wareId}}</span>
-              </template>
-            </el-table-column>
-            <el-table-column prop="wareName" label="京东商品名称">
-              <template #default="scope">
-                <span
-                      :style="scope.row.productName=='' || scope.row.productName == undefined || scope.row.productName == 'undefined'?'color: red':''">{{scope.row.wareName}}</span>
-              </template>
-            </el-table-column>
-            <el-table-column prop="productName" label="产品名称" />
-            <el-table-column prop="originalNum" label="采购数量" />
-            <el-table-column prop="confirmNum" label="确认数量">
-              <template v-slot="scope">
-                <el-form-item :rules="rules['confirmNum']">
-                  <el-input-number :min="0" :step="1" :max="scope.row.originalNum" v-model="scope.row.confirmNum" placeholder="请输入确认数量" />
-                </el-form-item>
-              </template>
-            </el-table-column>
-            <el-table-column prop="purchasePrice" label="采购价" />
-            <el-table-column prop="nonDeliveryReason" label="不满足发货原因">
-              <template v-slot="scope">
-                <el-form-item :rules="rules['nonDeliveryReason']">
-                  <el-input v-model="scope.row.nonDeliveryReason" placeholder="请输入不满足发货原因" />
-                </el-form-item>
-              </template>
-            </el-table-column>
-          </el-table>
-        </el-row>
-      </el-form>
-      <template #footer>
-        <el-button @click="tellDialogVisible = false" size="large">取 消</el-button>
-        <el-button type="primary" @click="submitForm" size="large" :loading="submitLoading">采购单回告</el-button>
+      <template #wareId="{ item }">
+                     <span v-if="item.exDesc=='1'">
+                     <svg-icon icon-class="jdyl" style="width: 34px;"/>
+                </span>
+        <span v-if="item.exDesc=='2'">
+                     <svg-icon icon-class="jdks" style="width: 34px;"/>
+                </span>
+        <span
+            :style="item.productName=='' || item.productName == undefined || item.productName == 'undefined'?'color: red':''">
+                  {{item.wareId}}
+                </span>
       </template>
-    </el-dialog>
+      <template #wareName="{ item }">
+        <span
+            :style="item.productName=='' || item.productName == undefined || item.productName == 'undefined'?'color: red':''">
+                  {{item.wareName}}
+                </span>
+      </template>
+    </byTable>
 
     <!--详情-->
-    <el-dialog :z-index="1500" title="采购单详情" v-if="dialogVisible" v-model="formData.data" width="1500px" v-loading="loading">
-      <el-descriptions title="基础信息" />
-      <el-form label-width="auto" :rules="rules">
-        <el-row>
-          <el-col :span="8">
-            <el-form-item label="京东订单号:" :span="8">
-              {{formData.data.orderId}}
-            </el-form-item>
-          </el-col>
-          <el-col :span="8">
-            <el-form-item label="订购时间:" :span="8" label-position="right">
-              {{formData.data.createdDate}}
-            </el-form-item>
-          </el-col>
-          <el-col :span="8">
-            <el-form-item label="供应商名称:" :span="8">
-              {{formData.data.providerName}}
-            </el-form-item>
-          </el-col>
-        </el-row>
-        <el-row>
-          <el-col :span="8">
-            <el-form-item label="采购总金额:" :span="8">
-              {{formData.data.totalPrice}}
-            </el-form-item>
-          </el-col>
-          <el-col :span="8">
-            <el-form-item label="配送中心名称:" :span="8">
-              {{formData.data.deliverCenterName}}
-            </el-form-item>
-          </el-col>
-          <el-col :span="8">
-            <el-form-item label="采购员姓名:" :span="8">
-              {{formData.data.purchaserName}}
-            </el-form-item>
-          </el-col>
-        </el-row>
-        <el-row>
-          <el-col :span="8">
-            <el-form-item label="删除状态:" :span="8">
-              {{formData.data.statusName}}
-            </el-form-item>
-          </el-col>
-          <el-col :span="8">
-            <el-form-item label="是否EPT定制:" :span="8">
-              {{formData.data.isEptCustomized?'是':'否'}}
-            </el-form-item>
-          </el-col>
-          <el-col :span="8">
-            <el-form-item label="订单状态:" :span="8">
-              {{formData.data.stateName}}
-            </el-form-item>
-          </el-col>
-        </el-row>
-        <el-row>
-          <el-col :span="8">
-            <el-form-item label="完成时间:" :span="8">
-              {{formData.data.completedDate}}
-            </el-form-item>
-          </el-col>
-          <el-col :span="8">
-            <el-form-item label="账期:" :span="8">
-              {{formData.data.accountPeriod}}
-            </el-form-item>
-          </el-col>
-          <el-col :span="8">
-            <el-form-item label="收货负责人:" :span="8">
-              {{formData.data.receiverName}}
-            </el-form-item>
-          </el-col>
-        </el-row>
-        <el-row>
-          <el-col :span="8">
-            <el-form-item label="收货电话:" :span="8">
-              {{formData.data.warehousePhone}}
-            </el-form-item>
-          </el-col>
-          <el-col :span="8">
-            <el-form-item label="详细地址:" :span="8">
-              {{formData.data.address}}
-            </el-form-item>
-          </el-col>
-          <el-col :span="8">
-            <el-form-item label="采购类型:" :span="8">
-              {{formData.data.orderTypeName}}
-            </el-form-item>
-          </el-col>
-        </el-row>
-        <el-row>
-          <el-col :span="8">
-            <el-form-item label="订单属性:" :span="8">
-              {{formData.data.orderAttributeName}}
-            </el-form-item>
-          </el-col>
-          <el-col :span="8">
-            <el-form-item label="回告状态:" :span="8">
-              {{formData.data.confirmStateName}}
-            </el-form-item>
-          </el-col>
-          <el-col :span="8">
-            <el-form-item label="顾客单号:" :span="8">
-              {{formData.data.customerOrderid}}
-            </el-form-item>
-          </el-col>
-        </el-row>
-        <el-row>
-          <el-col :span="8">
-            <el-form-item label="品种数量:" :span="8">
-              {{formData.data.wareVariety}}
-            </el-form-item>
-          </el-col>
-          <el-col :span="8">
-            <el-form-item label="预计到货时间:" :span="8">
-              {{formData.data.deliveryTime}}
+    <el-dialog :z-index="1500" title="异常处理" v-if="dialogVisible" v-model="formData.data"  width="500px" v-loading="loading">
+      <el-steps :active="stepsActiveindex" align-center>
+        <el-step title="选择异常状态" ></el-step>
+        <el-step title="处理异常明细" ></el-step>
+        <el-step title="确认操作" ></el-step>
+      </el-steps>
+      <el-divider></el-divider>
+      <el-form class="stepsActive1" :model="sourceList.pagination" style="margin-top: 0px;height: 250px"   label-position="top" label-width="100px"  v-if="stepsActiveindex == 1">
+            <el-form-item label="异常状态">
+                <el-select v-model="formData.data.ycStatus" style="width: 100%;">
+                  <el-option label="Long" value="Long" />
+                  <el-option label="Long1" value="Long1" />
+                </el-select>
             </el-form-item>
-          </el-col>
-          <el-col :span="8">
-            <el-form-item label="是否可回告:" :span="8">
-              {{formData.data.isCanConfirm?"可回告":"不可回告"}}
+            <el-form-item label="异常处理" >
+              <el-select v-model="formData.data.ycHandleType" style="width: 100%;">
+                <el-option label="Long" value="Long" />
+                <el-option label="Long1" value="Long1" />
+                <el-option label="Long2" value="Long2" />
+                <el-option label="Long3" value="Long3" />
+                <el-option label="Long4" value="Long4" />
+              </el-select>
             </el-form-item>
-          </el-col>
-        </el-row>
-        <el-row>
-          <el-col :span="8">
-            <el-form-item label="是否有差异:" :span="8">
-              {{formData.data.isExistActualNumDif=='0'?"存在差异":"无差异"}}
-            </el-form-item>
-          </el-col>
-          <el-col :span="8">
-            <el-form-item label="是否已结算:" :span="8">
-              {{formData.data.balanceStatus?"已结算":"未结算"}}
+      </el-form>
+      <el-form  class="stepsActive2" :model="sourceList.pagination" style="margin-top: 20px;height: 250px"   label-position="top" label-width="100px"  v-if="stepsActiveindex == 2">
+            <el-form-item label="仓库1">
+                <el-select v-model="formData.data.ycStatus" style="width: 100%;">
+                  <el-option label="Long" value="Long" />
+                  <el-option label="Long1" value="Long1" />
+                </el-select>
             </el-form-item>
-          </el-col>
-          <el-col :span="8">
-            <el-form-item label="入库时间:" :span="8">
-              {{formData.data.storageTime}}
+            <el-form-item label="商品1" >
+              <el-select v-model="formData.data.ycHandleType" style="width: 100%;">
+                <el-option label="Long" value="Long" />
+                <el-option label="Long1" value="Long1" />
+                <el-option label="Long2" value="Long2" />
+                <el-option label="Long3" value="Long3" />
+                <el-option label="Long4" value="Long4" />
+              </el-select>
             </el-form-item>
-          </el-col>
-        </el-row>
-        <el-row>
-          <el-col :span="8">
-            <el-form-item label="TC转运标识:" :span="8">
-              {{formData.data.tcFlagName}}
+            <el-form-item label="仓库2">
+              <el-select v-model="formData.data.ycStatus" style="width: 100%;">
+                <el-option label="Long" value="Long" />
+                <el-option label="Long1" value="Long1" />
+              </el-select>
             </el-form-item>
-          </el-col>
-          <el-col :span="8">
-            <el-form-item label="预约时间:" :span="8">
-              {{formData.data.bookTime}}
+            <el-form-item label="商品2" >
+              <el-select v-model="formData.data.ycHandleType" style="width: 100%;">
+                <el-option label="Long" value="Long" />
+                <el-option label="Long1" value="Long1" />
+                <el-option label="Long2" value="Long2" />
+                <el-option label="Long3" value="Long3" />
+                <el-option label="Long4" value="Long4" />
+              </el-select>
             </el-form-item>
-          </el-col>
-        </el-row>
-        <el-row>
-          <el-descriptions title="采购单明细" />
-          <el-table :data="formData.data.jdOrderDetailsList" stripe style="width: 100%">
-            <!--            <el-table stripe style="width: 100%">-->
-            <el-table-column prop="wareId" label="京东商品编号" width="120">
-              <template #default="scope">
-                <span
-                      :style="scope.row.productName=='' || scope.row.productName == undefined || scope.row.productName == 'undefined'?'color: red':''">{{scope.row.wareId}}</span>
-              </template>
-            </el-table-column>
-            <el-table-column prop="wareName" label="京东商品名称" min-width="200">
-              <template #default="scope">
-                <span
-                      :style="scope.row.productName=='' || scope.row.productName == undefined || scope.row.productName == 'undefined'?'color: red':''">{{scope.row.wareName}}</span>
-              </template>
-            </el-table-column>
-            <el-table-column prop="productName" label="产品名称" width="150" />
-            <el-table-column prop="deliverCenterName" label="配送中心名称" width="110" />
-            <el-table-column prop="purchasePrice" label="采购价" width="80" />
-            <el-table-column prop="originalNum" label="原始采购数量" width="110" />
-            <el-table-column prop="confirmNum" label="回告数量" width="80" />
-            <el-table-column prop="actualNum" label="实收数量" width="80" />
-            <el-table-column prop="nonDeliveryReason" label="不满足原因" width="100" />
-            <el-table-column prop="totalPrice" label="采购总金额" width="110" />
-            <el-table-column prop="storeName" label="库房名称" width="180" />
-            <el-table-column prop="wareProperty" label="EPT采购单定制相关信息" width="180" />
-          </el-table>
-        </el-row>
       </el-form>
+      <div  style="margin-top: 20px;height: 250px;display: flex;justify-content: center;
+        align-items: center; "    v-if="stepsActiveindex == 3">
+            <span>请确认无误后,点击确定</span>
+      </div>
+
+
       <template #footer>
-        <el-button @click="dialogVisible = false" size="large">取 消</el-button>
+        <el-divider></el-divider>
+        <el-button @click="back" v-if="stepsActiveindex > 1 " size="large">上一步</el-button>
+        <el-button @click="next" v-if="stepsActiveindex < 3 " size="large">下一步</el-button>
+        <el-button @click="dialogVisible = false"  v-if="stepsActiveindex ==3" size="large">确定</el-button>
       </template>
     </el-dialog>
 
@@ -295,7 +128,6 @@ const deliveryCenter = ref([]);
 const confirmState = ref([]);
 const orderState = ref([]);
 
-const blessingTypeList = ref([]);
 const submitLoading = ref(false);
 const sourceList = ref({
   data: [],
@@ -307,18 +139,13 @@ const sourceList = ref({
 });
 
 let rules = ref({
-  deliverCenterId: [
-    { required: true, message: "请选择配送中心", trigger: "blur" },
-  ],
-  nonDeliveryReason: [
-    { required: true, message: "请输入不满足发货原因", trigger: "blur" },
-  ],
+
   confirmNum: [{ required: true, message: "请输入确认数量", trigger: "blur" }],
 });
 
 const queryDialogVisible = ref(false);
 const dialogVisible = ref(false);
-const tellDialogVisible = ref(false);
+const stepsActiveindex = ref(1);
 
 let modalType = ref("add");
 const selectConfig = computed(() => {
@@ -372,125 +199,98 @@ const config = computed(() => {
   return [
     {
       attrs: {
-        label: "京东订单号",
+        label: "京东商品编号",
+        slot: "wareId",
         align: "left",
-        width: 120,
-      },
-      renderHTML(row) {
-        return [
-          {
-            attrs: {
-              label: row.orderId,
-              type: "primary",
-              text: true,
-            },
-            el: "button",
-            click() {
-              getDtl(row);
-            },
-          },
-        ];
+        width: 175,
       },
     },
     {
       attrs: {
-        label: "订购时间",
-        prop: "createdDate",
+        label: "京东商品名称",
+        slot: "wareName",
         align: "left",
-        width: 170,
+        "min-width": 200,
       },
     },
     {
       attrs: {
-        label: "供应商名称",
-        prop: "providerName",
+        label: "产品名称",
+        prop: "productName",
         align: "left",
-        width: 220,
+        "min-width": 150,
       },
     },
     {
       attrs: {
-        label: "采购总金额",
-        prop: "totalPrice",
+        label: "配送中心名称",
+        prop: "deliverCenterName",
         align: "left",
-        width: 110,
+        width: 150,
       },
-      render(totalPrice) {
-        return proxy.moneyFormat(totalPrice, 2);
+    },
+    {
+      attrs: {
+        label: "采购价",
+        prop: "purchasePrice",
+        align: "left",
+        width: 80,
       },
     },
     {
       attrs: {
-        label: "配送中心名称",
-        prop: "deliverCenterName",
+        label: "原始采购数量",
+        prop: "originalNum",
         align: "left",
         width: 110,
       },
     },
     {
       attrs: {
-        label: "订单状态",
-        prop: "state",
+        label: "回告数量",
+        prop: "confirmNum",
         align: "left",
         width: 80,
       },
-      render(value) {
-        return proxy.dictValueLabel(value, orderState.value);
-      },
     },
     {
       attrs: {
-        label: "回告状态",
-        prop: "confirmState",
+        label: "实收数量",
+        prop: "actualNum",
         align: "left",
         width: 80,
       },
-      render(value) {
-        return proxy.dictValueLabel(value, confirmState.value);
-      },
     },
     {
       attrs: {
-        label: "是否可回告",
-        prop: "isCanConfirm",
+        label: "不满足原因",
+        prop: "nonDeliveryReason",
         align: "left",
         width: 100,
       },
-      render(value) {
-        return value ? "可回告" : "不可回告";
-      },
     },
     {
       attrs: {
-        label: "详细地址",
-        prop: "address",
+        label: "采购总金额",
+        prop: "totalPrice",
         align: "left",
-        "min-width": 200,
+        width: 110,
       },
     },
     {
       attrs: {
-        label: "采购类型",
-        prop: "orderTypeName",
+        label: "库房名称",
+        prop: "storeName",
         align: "left",
-        width: 100,
+        width: 180,
       },
     },
     {
       attrs: {
-        label: "是否确认",
-        prop: "businessStatus",
+        label: "EPT采购单定制相关信息",
+        prop: "wareProperty",
         align: "left",
-        width: 80,
-      },
-      render(value) {
-        let label = "未确认";
-        if (value == "1") {
-          label = "已确认";
-        } else if (value == "2") {
-          label = "已回告";
-        }
-        return label;
+        width: 180,
       },
     },
     {
@@ -502,46 +302,22 @@ const config = computed(() => {
       },
       renderHTML(row) {
         return [
-          //   {
-          //     attrs: {
-          //       label: "详情",
-          //       type: "primary",
-          //       text: true,
-          //     },
-          //     el: "button",
-          //     click() {
-          //       getDtl(row);
-          //     },
-          //   },
-          row.businessStatus == 0
-            ? {
-                attrs: {
-                  label: "采购单确认",
-                  type: "danger",
-                  text: true,
-                },
-                el: "button",
-                click() {
-                  ElMessageBox.confirm("是否确认当前采购单状态?", "提示", {
-                    confirmButtonText: "确定",
-                    cancelButtonText: "取消",
-                    type: "warning",
-                  }).then(() => {
-                    confirmBusinessStatus(row);
-                  });
-                },
-              }
-            : {},
-          row.businessStatus == 1 && row.isCanConfirm
+          row.businessStatus !== 0
             ? {
                 attrs: {
-                  label: "回告",
+                  label: "处理",
                   type: "danger",
                   text: true,
                 },
                 el: "button",
                 click() {
-                  getTellDtl(row);
+                  // ElMessageBox.confirm("是否确认当前采购单状态?", "提示", {
+                  //   confirmButtonText: "确定",
+                  //   cancelButtonText: "取消",
+                  //   type: "warning",
+                  // }).then(() => {
+                  openHandleAction(row);
+                  // });
                 },
               }
             : {},
@@ -565,28 +341,6 @@ const formOption = reactive({
 });
 const byform = ref(null);
 
-const formConfig = computed(() => {
-  return [
-    {
-      type: "input",
-      prop: "orderId",
-      label: "京东订单号",
-      readonly: true,
-    },
-    {
-      type: "input",
-      prop: "createdDate",
-      label: "订购时间",
-      readonly: true,
-    },
-    {
-      type: "input",
-      label: "采购单明细,应该是个一对多还没弄",
-      readonly: true,
-    },
-  ];
-});
-
 const getDictlist = async () => {
   proxy
     .getDictOne(["delivery_center", "confirmState", "OrderState"])
@@ -609,7 +363,7 @@ const getDictlist = async () => {
 const getList = async (req) => {
   sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
   loading.value = true;
-  proxy.post("/jdOrder/page", sourceList.value.pagination).then((res) => {
+  proxy.post("/jdOrderEx/jdOrderDetailExList", sourceList.value.pagination).then((res) => {
     sourceList.value.data = res.rows;
     sourceList.value.pagination.total = res.total;
     setTimeout(() => {
@@ -618,13 +372,6 @@ const getList = async (req) => {
   });
 };
 
-const openModal = () => {
-  dialogVisible.value = true;
-  modalType.value = "add";
-  formData.data = {
-    content: "",
-  };
-};
 const selection = ref({
   data: [],
 });
@@ -632,76 +379,6 @@ const select = (_selection, row) => {
   selection.value.data = _selection;
 };
 
-const getDtl = (row) => {
-  modalType.value = "edit";
-  proxy.post("/jdOrder/detail", { id: row.id }).then((res) => {
-    formData.data = res;
-    dialogVisible.value = true;
-  });
-};
-
-const getTellDtl = (row) => {
-  modalType.value = "edit";
-  proxy.post("/jdOrder/detail", { id: row.id }).then((res) => {
-    formData.data = res;
-    tellDialogVisible.value = true;
-  });
-};
-
-/**
- * 确认采购单状态
- * @param row
- */
-const confirmBusinessStatus = (row) => {
-  let businessStatus = row.businessStatus == "1" ? 0 : 1;
-  proxy
-    .post("/jdOrder/confirmBusinessStatus", {
-      id: row.id,
-      businessStatus: businessStatus,
-    })
-    .then(
-      () => {
-        ElMessage({
-          message: "确认成功",
-          type: "success",
-        });
-        dialogVisible.value = false;
-        submitLoading.value = false;
-        getList();
-      },
-      (err) => {
-        console.log(err);
-        submitLoading.value = false;
-      }
-    );
-};
-
-//订单回告
-const submitForm = () => {
-  ElMessageBox.confirm("是否确认回告当前采购单?", "提示", {
-    confirmButtonText: "确定",
-    cancelButtonText: "取消",
-    type: "warning",
-  }).then(() => {
-    submitLoading.value = true;
-    //TODO 这里应该是订单回告
-    proxy.post("/jdOrder/tellBackOrer", formData.data).then(
-      () => {
-        ElMessage({
-          message: "回告成功",
-          type: "success",
-        });
-        tellDialogVisible.value = false;
-        submitLoading.value = false;
-        getList();
-      },
-      (err) => {
-        console.log(err);
-        submitLoading.value = false;
-      }
-    );
-  });
-};
 
 //高级搜索
 const handleReset = () => {
@@ -728,8 +405,21 @@ const handleQuery = () => {
 };
 
 
+/**
+ * 确认采购单状态
+ * @param row
+ */
+const openHandleAction = (row) => {
+    dialogVisible.value = true;
+    stepsActiveindex.value = 1
+};
 
-
+const next = () => {
+  stepsActiveindex.value++
+}
+const back = () => {
+  stepsActiveindex.value--
+}
 
 getDictlist();
 getList();
@@ -742,4 +432,11 @@ getList();
 :deep(.el-form-item--default) {
   margin-bottom: 0px;
 }
+
+.stepsActive1 .el-form-item{
+  margin-bottom: 20px;
+}
+.stepsActive2 .el-form-item{
+  margin-bottom: 10px;
+}
 </style>