Ver Fonte

Merge branch 'jd_v2'

cz há 1 ano atrás
pai
commit
0ba91aab6c

+ 1 - 0
src/assets/icons/svg/jdks.svg

@@ -0,0 +1 @@
+<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1705334207901" class="icon" viewBox="0 0 1807 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1708" xmlns:xlink="http://www.w3.org/1999/xlink" width="352.9296875" height="200"><path d="M0 0l611.990588 823.777882 427.309177-432.007529 365.025882 393.938823L1169.769412 1024H1807.058824V413.214118l-239.555765 226.183529-528.26353-591.510588L611.990588 512z" fill="#D0021B" p-id="1709"></path></svg>

+ 1 - 0
src/assets/icons/svg/jdyl.svg

@@ -0,0 +1 @@
+<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1705334035883" class="icon" viewBox="0 0 1807 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="11106" xmlns:xlink="http://www.w3.org/1999/xlink" width="352.9296875" height="200"><path d="M0 1024L611.990588 200.222118l427.309177 432.007529 365.025882-393.938823L1169.769412 0H1807.058824v610.785882l-239.555765-226.183529-528.26353 591.510588L611.990588 512z" fill="#84BB8D" p-id="11107"></path></svg>

BIN
src/assets/images/jddh.png


BIN
src/assets/images/jdsh.png


BIN
src/assets/images/jdyc.png


+ 27 - 1
src/components/byTable/index.vue

@@ -106,7 +106,7 @@
       <el-table ref="hocElTable" :data="source" v-if="!hideTable" style="width: 100%" v-bind="$attrs" v-on="tableEvents" row-key="id" :tree-props="{
           children: 'children',
           hasChildren: 'hasChildren',
-        }" :height="tableHeight">
+        }" :height="tableHeight" :row-class-name="updateTableRowClassName">
         <el-table-column v-for="(item, index) in configData" :key="index" v-bind="getAttrsValue(item)" :type="item.type || ''" :selectable="
             (rowData, rowIndex) => isSelectable(rowData, rowIndex, item)
           ">
@@ -481,6 +481,22 @@ export default defineComponent({
     };
     const hocElTable = ref();
 
+    const updateTableRowClassName = (row) =>{
+      let result = "";
+
+      proxy.$emit(
+          "updateTableRowClassName",
+          row,(val) => {
+            console.log(12312,'12312312')
+            result = val;
+          }
+      );
+
+
+      return result;
+    }
+
+
     return {
       configData,
       getParent,
@@ -509,8 +525,10 @@ export default defineComponent({
       isMore,
       changeStatData,
       hocElTable,
+      updateTableRowClassName
     };
   },
+
 });
 </script>
 <style>
@@ -532,6 +550,12 @@ export default defineComponent({
 .el-table .cell {
   line-height: 34px;
 }
+
+
+
+.el-table .error-row {
+  background: rgba(245, 108, 108, 0.68);
+}
 </style>
 <style lang="scss" scoped>
 .sortableActive {
@@ -807,4 +831,6 @@ export default defineComponent({
   color: #000 !important;
   font-size: 14px !important;
 }
+
+
 </style>

+ 758 - 0
src/views/WDLY/jd/abnormalDetails/index.vue

@@ -0,0 +1,758 @@
+<template>
+  <div class="tenant">
+    <byTable :source="sourceList.data" :pagination="sourceList.pagination" :config="config" :loading="loading" highlight-current-row
+             :selectConfig="selectConfig" :table-events="{
+                    select: select,
+                }" :action-list="[]" @get-list="getList" @moreSearch="() => (queryDialogVisible = false)"
+
+    >
+      <template #wareId="{ item }">
+        <div style="display: flex; justify-content: center;line-height: 34px;height: 34px">
+             <div v-if="item.exDesc=='1'">
+                  <img src="@/assets/images/jdsh.png" alt=""  style="width: 34px"/>
+                </div>
+          <div v-if="item.exDesc=='2'">
+                    <img src="@/assets/images/jddh.png" alt="" style="width: 34px"/>
+                </div>
+          <div :style="item.productName=='' || item.productName == undefined || item.productName == 'undefined'?'color: red':''">
+                    {{item.wareId}}
+          </div>
+        </div>
+
+
+
+      </template>
+      <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="500px" v-loading="loading" @close="closeHandleAction">
+      <el-steps :active="stepsActiveindex" align-center>
+        <el-step title="选择异常场景" ></el-step>
+        <el-step title="处理异常明细" ></el-step>
+      </el-steps>
+      <el-divider></el-divider>
+      <el-form class="stepsActive1" :model="formData.data" ref="submitform" :rules="rules"  style="margin-top: 0px;height: auto"
+               label-position="top" label-width="100px"  v-if="stepsActiveindex == 1">
+            <el-form-item label="异常场景" prop="abnormalStatus">
+                <el-select v-model="formData.data.abnormalStatus" style="width: 100%;" @change="treeChange" :disabled="isViewFlag">
+                    <el-option v-for="item in abnormalHandleTypeDict" :key="item.value" :label="item.label" :value="item.value"/>
+                </el-select>
+            </el-form-item>
+            <el-form-item label="处理方案" prop="exHandle">
+              <el-select v-model="formData.data.exHandle" style="width: 100%;" :disabled="isViewFlag">
+                <el-option v-for="item in abnormalHandleTypeChileDict" :key="item.value" :label="item.label" :value="item.value"/>
+              </el-select>
+            </el-form-item>
+
+            <el-form-item label="差异商品数量" prop="absoluteValue"  >
+              <el-input v-model="formData.data.absoluteValue" disabled placeholder="请输入出库商品数量" oninput="value=value.replace(/[^\d.]/g,'')"/>
+            </el-form-item>
+      </el-form>
+      <el-form  class="stepsActive2" :model="formData.data" style="margin-top: 20px;height: auto" ref="submitform2" :rules="rules"  label-position="top" label-width="100px"  v-if="stepsActiveindex == 2">
+        <el-form-item label="出库仓库" prop="reduceWarehouseId" v-if="reduceFlag" >
+          <el-select v-model="formData.data.reduceWarehouseId" :disabled="isViewFlag" style="width: 100%;">
+            <el-option v-for="item in warehouseList" :key="item.value" :label="item.label" :value="item.value"/>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="出库商品" prop="reduceProductId" v-if="reduceFlag" >
+          <el-select v-model="formData.data.reduceProductId" filterable :disabled="reduceProductIdDisplay" style="width: 100%;">
+            <el-option v-for="item in reduceProductList"  :key="item.value" :label="item.label" :value="item.value"/>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="出库商品数量" prop="reduceQuantity" v-if="reduceFlag">
+          <el-input v-model="formData.data.reduceQuantity" disabled  placeholder="请输入出库商品数量" oninput="value=value.replace(/[^\d.]/g,'')"/>
+        </el-form-item>
+
+
+        <el-form-item label="入库仓库" prop="addWarehouseId" v-if="addFlag" >
+          <el-select v-model="formData.data.addWarehouseId" :disabled="isViewFlag" style="width: 100%;" >
+            <el-option v-for="item in warehouseList"  :key="item.value" :label="item.label" :value="item.value"/>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="入库商品" prop="addProductId" v-if="addFlag">
+          <el-select v-model="formData.data.addProductId" filterable  style="width: 100%;" :disabled="addProductIdDisplay">
+            <el-option v-for="item in addProductList" :key="item.value" :label="item.label" :value="item.value"/>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="入库商品数量" prop="addQuantity" v-if="addFlag" >
+          <el-input v-model="formData.data.addQuantity" disabled placeholder="请输入出库商品数量" oninput="value=value.replace(/[^\d.]/g,'')"/>
+        </el-form-item>
+
+
+        <el-form-item label="快递单号" prop="expressNo" v-if="deliveryFlag" >
+          <el-input v-model="formData.data.expressNo" :disabled="isViewFlag" placeholder="请输入快递单号" />
+        </el-form-item>
+        <el-form-item label="备注" prop="remark" v-if="remarkFlag">
+          <el-input type="textarea" :rows="3" :disabled="isViewFlag" v-model="formData.data.remark"  placeholder="请输入备注" />
+        </el-form-item>
+
+        <span style="color: red" v-if="tipsFlag">*请到京东平台补单</span>
+      </el-form>
+
+      <template #footer>
+        <el-divider></el-divider>
+        <el-button @click="back" v-if="stepsActiveindex > 1 " size="large" :loading="submitLoading">上一步</el-button>
+        <el-button @click="next" v-if="stepsActiveindex < 2 " size="large" :loading="submitLoading">下一步</el-button>
+        <el-button @click="submit"  v-if="stepsActiveindex ==2  &&  !isViewFlag" size="large" :loading="submitLoading">确定</el-button>
+      </template>
+    </el-dialog>
+
+    <!--高级搜索-->
+    <el-dialog :title="'高级检索'" v-model="queryDialogVisible" width="500px" destroy-on-close>
+      <el-form :model="sourceList.pagination" label-width="100px" label-position="top">
+        <el-form-item label="采购单号">
+          <el-input v-model="sourceList.pagination.orderId" placeholder="请输入采购单号" oninput="value=value.replace(/[^\d.]/g,'')"/>
+        </el-form-item>
+        <el-form-item label="京东商品编号">
+          <el-input v-model="sourceList.pagination.wareId" placeholder="请输入京东商品编号" oninput="value=value.replace(/[^\d.]/g,'')"/>
+        </el-form-item>
+      </el-form>
+      <template #footer>
+        <el-button @click="handleReset" size="large">重置</el-button>
+        <el-button @click="handleQuery" type="primary" size="large">搜索</el-button>
+      </template>
+    </el-dialog>
+  </div>
+</template>
+
+<script setup>
+import { ElMessage, ElMessageBox } from "element-plus";
+import byTable from "@/components/byTable/index";
+import byForm from "@/components/byForm/index";
+import { computed, nextTick, reactive, ref } from "vue";
+import {isNullOrUndefined} from "@tinymce/tinymce-vue/lib/es2015/main/ts/Utils";
+const { proxy } = getCurrentInstance();
+
+const router = useRouter();
+const loading = ref(false);
+const deliveryCenter = ref([]);
+const confirmState = ref([]);
+const orderState = ref([]);
+
+const submitLoading = ref(false);
+const sourceList = ref({
+  data: [],
+  pagination: {
+    total: 0,
+    pageNum: 1,
+    pageSize: 10,
+  },
+});
+
+const warehouseList = ref([])
+const reduceProductList = ref([])
+const addProductList = ref([])
+const productList = ref([])
+
+
+const abnormalHandleTypeDict = ref([])
+const abnormalHandleTypeChileDict = ref([])
+
+const abnormalStatusDictAll = ref([]);
+
+const abnormalStatusDictDh = ref([
+    {value: '10',label: '仓库多发',chile:[{value: '101',label: '补单(扣库存)'}]}
+])
+
+const abnormalStatusDictSh = ref([
+  {value: '20',label: '仓库已发',chile:[{  value: '201',label: '报损'},
+      {  value: '202',label: '补单(不扣库存)'},
+      {  value: '203',label: '索赔理赔'}]},
+  {value: '30',label: '仓库少发',chile:[{  value: '301',label: '退回库存'}]},
+  {value: '40',label: '仓库发错货物',chile:[{  value: '401',label: '货物退回'},
+      {  value: '402',label: '补单'},
+      {  value: '403',label: '报损'}]},
+  {value: '50',label: '条码错误',chile:[{  value: '501',label: '货物退回'},
+      {  value: '502',label: '补单'},
+      {  value: '503',label: '报损'}]}
+])
+const abnormalStatusDict = ref([
+  {value: '101',label: '仓库多发-补单(扣库存)'},
+  {  value: '201',label: '仓库已发-报损'},
+  {  value: '203',label: '仓库已发-索赔理赔'},
+  {  value: '202',label: '仓库已发-补单(不扣库存)'},
+  {  value: '301',label: '仓库少发-退回库存'},
+    {  value: '401',label: '仓库发错货物-货物退回'},
+      {  value: '402',label: '仓库发错货物-补单'},
+        {  value: '403',label: '仓库发错货物-报损'},
+   {  value: '501',label: '条码错误-货物退回'},
+        {  value: '502',label: '条码错误-补单'},
+        {  value: '503',label: '条码错误-报损'}
+])
+
+const treeChange = (e) => {
+  formData.data.exHandle = ""
+  treeChangeSelect(e)
+
+}
+
+const treeChangeSelect = (e) => {
+  const abnormalStatusDict = abnormalStatusDictAll.value.filter(x=> {
+    return x.value == e
+  });
+  abnormalHandleTypeChileDict.value = abnormalStatusDict[0].chile
+}
+
+
+
+let rules = ref({
+  abnormalStatus: [{ required: true, message: "请选择异常状态", trigger: "change" }],
+  exHandle: [{ required: true, message: "请选择异常处理", trigger: "change" }],
+
+  addWarehouseId: [{ required: true, message: "请选择入库仓库", trigger: "change" }],
+  addProductId: [{ required: true, message: "请选择入库商品", trigger: "change" }],
+  addQuantity: [{ required: true, message: "请填写入库数量", trigger: "blur" }],
+
+  reduceWarehouseId: [{ required: true, message: "请选择出库仓库", trigger: "change" }],
+  reduceProductId: [{ required: true, message: "请选择出库商品", trigger: "change" }],
+  reduceQuantity: [{ required: true, message: "请填写出库数量", trigger: "blur" }],
+
+  expressNo: [{ required: true, message: "请填写快递单号", trigger: "blur" }],
+  remark: [{ required: true, message: "请填写备注", trigger: "blur" }],
+});
+
+const queryDialogVisible = ref(false);
+const dialogVisible = ref(false);
+const isViewFlag = ref(false);
+const stepsActiveindex = ref(1);
+const views = ref(1);
+
+let modalType = ref("add");
+const selectConfig = computed(() => {
+  return [
+    {
+      label: "异常状态",
+      prop: "exDesc",
+      data: [
+        {
+          label: "多货",
+          value: "1",
+        },
+        {
+          label: "少货",
+          value: "2",
+        },
+      ],
+    },
+    {
+      label: "处理状态",
+      prop: "handleStatus",
+      data: [
+        {
+          label: "已处理",
+          value: "2",
+        },
+        {
+          label: "未处理",
+          value: "1",
+        },
+      ],
+    },
+    {
+      label: "处理方案",
+      prop: "exHandle",
+      data: abnormalStatusDict.value,
+    },
+  ];
+});
+
+const config = computed(() => {
+  return [
+    {
+      attrs: {
+        label: "京东采购单号",
+        prop: "orderId",
+        align: "left",
+        width: 120,
+      },
+    },
+    {
+      attrs: {
+        label: "京东商品编号",
+        slot: "wareId",
+        align: "left",
+        width: 175,
+      },
+      // renderHTML(row) {
+      //   return [
+      //     {
+      //       attrs: {
+      //         label: row.orderId,
+      //         type: "primary",
+      //         text: true,
+      //       },
+      //       el: "button",
+      //       click() {
+      //         openHandleAction(row, true);
+      //       },
+      //     },
+      //   ];
+      // },
+    },
+    {
+      attrs: {
+        label: "处理状态",
+        prop: "handleStatus",
+        align: "left",
+        width: 180,
+      },
+      render(type) {
+        return type == '2' ? '已处理' : '未处理';
+      },
+    },
+    {
+      attrs: {
+        label: "京东商品名称",
+        slot: "wareName",
+        align: "left",
+        "min-width": 200,
+      },
+    },
+    {
+      attrs: {
+        label: "产品名称",
+        prop: "productName",
+        align: "left",
+        "min-width": 150,
+      },
+    },
+    {
+      attrs: {
+        label: "配送中心名称",
+        prop: "deliverCenterName",
+        align: "left",
+        width: 150,
+      },
+    },
+    {
+      attrs: {
+        label: "采购价",
+        prop: "purchasePrice",
+        align: "left",
+        width: 80,
+      },
+    },
+    {
+      attrs: {
+        label: "原始采购数量",
+        prop: "originalNum",
+        align: "left",
+        width: 110,
+      },
+    },
+    {
+      attrs: {
+        label: "回告数量",
+        prop: "confirmNum",
+        align: "left",
+        width: 80,
+      },
+    },
+    {
+      attrs: {
+        label: "实收数量",
+        prop: "actualNum",
+        align: "left",
+        width: 80,
+      },
+    },
+    {
+      attrs: {
+        label: "不满足原因",
+        prop: "nonDeliveryReason",
+        align: "left",
+        width: 100,
+      },
+    },
+    {
+      attrs: {
+        label: "采购总金额",
+        prop: "totalPrice",
+        align: "left",
+        width: 110,
+      },
+    },
+    {
+      attrs: {
+        label: "库房名称",
+        prop: "storeName",
+        align: "left",
+        width: 180,
+      },
+    },
+    {
+      attrs: {
+        label: "处理方案",
+        prop: "exHandle",
+        align: "left",
+        width: 180,
+      },
+      render(type) {
+        return proxy.dictValueLabel(type, abnormalStatusDict.value);
+      },
+    },
+    {
+      attrs: {
+        label: "EPT采购单定制相关信息",
+        prop: "wareProperty",
+        align: "left",
+        width: 180,
+      },
+    },
+    {
+      attrs: {
+        label: "操作",
+        width: "150",
+        align: "center",
+        fixed: "right",
+      },
+      renderHTML(row) {
+        return [
+          !isNullOrUndefined(row.productName)
+            ? {
+                attrs: {
+                  label: row.handleStatus == '1'?"处理":"详情",
+                  type: "danger",
+                  text: true,
+                },
+                el: "button",
+                click() {
+                  openHandleAction(row, row.handleStatus == '1'?false:true);
+                },
+              }
+            : {},
+        ];
+      },
+    },
+  ];
+});
+
+let formData = reactive({
+  data: {
+    coverList: [],
+    audioList: [],
+  },
+});
+const formOption = reactive({
+  inline: true,
+  labelWidth: 100,
+  itemWidth: 100,
+  rules: [],
+});
+const byform = ref(null);
+const submitform = ref(null);
+const submitform2 = ref(null);
+
+
+
+const getDictlist = async () => {
+  proxy.post("/warehouse/page", { pageNum: 1, pageSize: 999 }).then((res) => {
+    if (res.rows && res.rows.length > 0) {
+      warehouseList.value = res.rows.map((item) => {
+        return {
+          label: item.name,
+          value: item.id,
+        };
+      });
+    }
+  });
+  proxy.post("/productInfo/pageByWdly", { pageNum: 1, pageSize: 99999 }).then((res) => {
+    if (res.rows && res.rows.length > 0) {
+      productList.value = res.rows.map((item) => {
+        return {
+          label: item.name,
+          value: item.id,
+        };
+      });
+    }
+  });
+
+
+};
+
+// const getProductList = async (e,type) =>{
+//   proxy.post("/stock/pageByWarehouse", { pageNum: 1, pageSize: 999 ,id:e}).then((res) => {
+//     if (res.rows && res.rows.length > 0) {
+//       const product = res.rows.map((item) => {
+//         return {
+//           label: item.productName,
+//           value: item.productId,
+//         };
+//       });
+//       if (type == 1){
+//        addProductList.value = product
+//       } else {
+//        reduceProductList.value = product
+//
+//       }
+//     }
+//   });
+// }
+
+const getList = async (req) => {
+  sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
+  loading.value = true;
+  proxy.post("/jdOrderEx/jdOrderDetailExList", sourceList.value.pagination).then((res) => {
+    sourceList.value.data = res.rows;
+    sourceList.value.pagination.total = res.total;
+    setTimeout(() => {
+      loading.value = false;
+    }, 200);
+  });
+};
+
+const selection = ref({
+  data: [],
+});
+const select = (_selection, row) => {
+  selection.value.data = _selection;
+};
+
+
+//高级搜索
+const handleReset = () => {
+  sourceList.value.pagination = {
+    pageNum: sourceList.value.pagination.pageNum,
+    pageSize: sourceList.value.pagination.pageSize,
+    arr: [],
+  };
+  handleQuery();
+};
+
+const handleQuery = () => {
+  if (
+    sourceList.value.pagination.arr &&
+    sourceList.value.pagination.arr.length > 1
+  ) {
+    sourceList.value.pagination.purchaseStartTime =
+      sourceList.value.pagination.arr[0];
+    sourceList.value.pagination.purchaseEndTime =
+      sourceList.value.pagination.arr[1];
+  }
+  queryDialogVisible.value = false;
+  getList();
+};
+
+
+/**
+ * 确认采购单状态
+ * @param row
+ */
+const openHandleAction = (row,isView) => {
+
+  console.log('123123',isView)
+
+  console.log("row",row)
+    dialogVisible.value = true;
+    stepsActiveindex.value = 1
+
+    intiFlag()
+
+    let absoluteValue = Math.abs(Number(row.confirmNum) - Number(row.actualNum))
+
+    if(row.exDesc == '1'){
+      abnormalStatusDictAll.value = abnormalStatusDictDh.value
+    }else if(row.exDesc == '2') {
+      abnormalStatusDictAll.value = abnormalStatusDictSh.value
+    }
+
+    abnormalHandleTypeDict.value = abnormalStatusDictAll.value.map(x =>{
+      return {
+        label: x.label,
+        value: x.value,
+      };
+    })
+
+    isViewFlag.value = isView
+    if (isView){
+      formData.data = row
+      //异常状态明细
+      formData.data.abnormalStatus = row.exHandle.substring(0,2)
+      //处理方案
+      treeChangeSelect(formData.data.abnormalStatus)
+      formData.data.absoluteValue = absoluteValue
+    }else {
+
+      formData.data = {
+        id:row.id,
+        reduceQuantity  : absoluteValue,
+        addQuantity  : absoluteValue,
+        absoluteValue: absoluteValue,
+        productId : row.productId
+      }
+    }
+
+
+};
+/**
+ * 确认采购单状态
+ * @param row
+ */
+const closeHandleAction = () => {
+    dialogVisible.value = false;
+    stepsActiveindex.value = 1
+};
+
+const tipsFlag = ref(false)
+const reduceFlag = ref(false)
+const reduceProductIdDisplay = ref(false)
+const addFlag = ref(false)
+const addProductIdDisplay = ref(false)
+const remarkFlag = ref(false)
+const deliveryFlag = ref(false)
+
+const intiFlag = () => {
+  tipsFlag.value = false
+  addFlag.value = false
+  reduceFlag.value = false
+  remarkFlag.value = false
+  deliveryFlag.value = false
+  reduceProductIdDisplay.value = false
+  addProductIdDisplay.value = false
+}
+
+
+const next = async () => {
+  let flag = await submitform.value.validate();
+  const type  =  formData.data.exHandle
+
+  intiFlag()
+
+  if (isViewFlag.value){
+    reduceProductIdDisplay.value = true
+    addProductIdDisplay.value = true
+  }else {
+    formData.data.reduceProductId = null
+    formData.data.addProductId = null
+  }
+
+  //判断 出库
+  if (['101','402','403'].indexOf(type)>-1){
+    reduceFlag.value = true
+  }
+  //判断 出库
+  if (!isViewFlag.value){
+    if (['101',].indexOf(type)>-1){
+      formData.data.reduceProductId = formData.data.productId
+      reduceProductIdDisplay.value = true
+    }
+  }
+  //判断 入库
+  if (['301','401','402','403','501'].indexOf(type)>-1){
+    addFlag.value = true
+  }
+  //判断 入库
+  if (!isViewFlag.value) {
+    if (['301', '401','402','403','501'].indexOf(type) > -1) {
+      formData.data.addProductId = formData.data.productId
+      addProductIdDisplay.value = true
+    }
+  }
+  handProductList()
+  //判断 备注
+  if (['201','203','403','503'].indexOf(type)>-1){
+    remarkFlag.value = true
+  }
+  //判断 快递
+  if (['401','501'].indexOf(type)>-1){
+    deliveryFlag.value = true
+  }
+  //判断 提示
+  if (['101','202','402','502'].indexOf(type)>-1){
+    tipsFlag.value = true
+  }
+
+  stepsActiveindex.value++
+}
+const back = () => {
+  stepsActiveindex.value--
+}
+
+const handProductList = () => {
+  if (!isNullOrUndefined(formData.data.addProductId)){
+    proxy.post("/jdOrderEx/productInfoById", { productId: formData.data.addProductId }).then((res) => {
+      if (res && res.length > 0) {
+        addProductList.value = res.map((item) => {
+          return {
+            label: item.name,
+            value: item.id,
+          };
+        });
+      }
+    });
+  }else {
+    addProductList.value = productList.value
+  }
+  if (!isNullOrUndefined(formData.data.reduceProductId)){
+    proxy.post("/jdOrderEx/productInfoById", { productId: formData.data.reduceProductId }).then((res) => {
+      if (res && res.length > 0) {
+        reduceProductList.value = res.map((item) => {
+          return {
+            label: item.name,
+            value: item.id,
+          };
+        });
+      }
+    });
+  }else {
+    reduceProductList.value = productList.value
+  }
+}
+
+const submit = async () => {
+  let flag = await submitform2.value.validate();
+  if (flag){
+    ElMessageBox.confirm("是否确认当前处理方法?", "提示", {
+      confirmButtonText: "确定",
+      cancelButtonText: "取消",
+      type: "warning",
+    }).then(() => {
+      submitLoading.value = true;
+
+
+      proxy.post("/jdOrderEx/dealEx", formData.data).then(
+          () => {
+            ElMessage({
+              message: "处理成功",
+              type: "success",
+            });
+            dialogVisible.value = false;
+            submitLoading.value = false;
+            getList();
+          },
+          (err) => {
+            console.log(err);
+            submitLoading.value = false;
+          }
+      );
+    });
+  }
+
+
+}
+
+getDictlist();
+getList();
+</script>
+
+<style lang='scss' scoped>
+.tenant {
+  padding: 20px;
+}
+:deep(.el-form-item--default) {
+  margin-bottom: 0px;
+}
+
+.stepsActive1 .el-form-item{
+  margin-bottom: 20px;
+}
+.stepsActive2 .el-form-item{
+  margin-bottom: 10px;
+}
+</style>

+ 195 - 24
src/views/WDLY/jd/order/index.vue

@@ -3,7 +3,31 @@
     <byTable :source="sourceList.data" :pagination="sourceList.pagination" :config="config" :loading="loading" highlight-current-row
              :selectConfig="selectConfig" :table-events="{
                     select: select,
-                }" :action-list="[]" @get-list="getList" @moreSearch="() => (queryDialogVisible = true)">
+                }" :action-list="[]" @get-list="getList" @moreSearch="() => (queryDialogVisible = true)"
+    >
+
+      <template #orderId="{ item }">
+          <div style="display: flex; justify-content: flex-start;line-height: 34px;height: 34px" @click="getDtl(item);">
+            <div v-if="item.hasEx=='1'">
+              <img src="@/assets/images/jdyc.png" alt=""  style="width: 34px"/>
+            </div>
+            <div v-else style="width: 34px">
+
+            </div>
+            <span  style="color: blue">{{item.orderId}}</span>
+        </div>
+      </template>
+      <template #remark="{ item }">
+          <div style="width: 200px;overflow: hidden; text-overflow: ellipsis; white-space: nowrap;">
+            <div v-if="item.hasEx == '1'" @click="showTipRemark(item)">
+              <i class="iconfont icon-iconm_banli" style="margin-right: 5px" ></i>
+              <span v-if="isNullOrUndefined(item.remark)">编辑备注</span>
+              <el-tooltip v-else class="item" effect="dark" :content="item.remark" placement="top">
+                {{item.remark}}
+              </el-tooltip>
+            </div>
+          </div>
+      </template>
     </byTable>
     <!--回告-->
     <el-dialog :z-index="1500" title="采购单回告" v-if="tellDialogVisible" v-model="formData.data" width="1500px" v-loading="loading">
@@ -230,12 +254,29 @@
         </el-row>
         <el-row>
           <el-descriptions title="采购单明细" />
+          <div style="line-height: 34px;height: 34px;display: flex">
+              <span>(</span>
+             <span><img src="@/assets/images/jdsh.png" alt=""  style="width: 34px"/></span><span>多货</span>
+              <span><img src="@/assets/images/jddh.png" alt="" style="width: 34px"/></span><span>少货</span>
+            <span>)</span>
+          </div>
+
           <el-table :data="formData.data.jdOrderDetailsList" stripe style="width: 100%">
             <!--            <el-table stripe style="width: 100%">-->
-            <el-table-column prop="wareId" label="京东商品编号" width="120">
+            <el-table-column prop="wareId" label="京东商品编号" width="175">
               <template #default="scope">
-                <span
-                      :style="scope.row.productName=='' || scope.row.productName == undefined || scope.row.productName == 'undefined'?'color: red':''">{{scope.row.wareId}}</span>
+                <div style="display: flex; justify-content: center;line-height: 34px;height: 34px">
+                  <div v-if="scope.row.exDesc=='1'">
+                    <img src="@/assets/images/jdsh.png" alt=""  style="width: 34px"/>
+                  </div>
+                  <div v-if="scope.row.exDesc=='2'">
+                    <img src="@/assets/images/jddh.png" alt="" style="width: 34px"/>
+                  </div>
+                  <div :style="scope.row.productName=='' || scope.row.productName == undefined || scope.row.productName == 'undefined'?'color: red':''">
+                    {{scope.row.wareId}}
+                  </div>
+                </div>
+
               </template>
             </el-table-column>
             <el-table-column prop="wareName" label="京东商品名称" min-width="200">
@@ -262,6 +303,23 @@
       </template>
     </el-dialog>
 
+    <!--修改备注-->
+    <el-dialog :z-index="1500" title="编辑备注" v-if="remarkDialogVisible" v-model="formData.data" width="800px" v-loading="loading">
+      <el-form label-width="auto" :rules="rules">
+        <el-row>
+          <el-col >
+            <el-form-item label="备注:" :span="8">
+              <el-input type="textarea" :rows="3" v-model="formData.data.remark" placeholder="请输入备注" />
+            </el-form-item>
+          </el-col>
+        </el-row>
+      </el-form>
+      <template #footer>
+        <el-button @click="remarkDialogVisible = false" size="large">取 消</el-button>
+        <el-button type="primary" @click="submitRemark" size="large" :loading="submitLoadingRemark">提 交</el-button>
+      </template>
+    </el-dialog>
+
     <!--高级搜索-->
     <el-dialog :title="'高级检索'" v-model="queryDialogVisible" width="500px" destroy-on-close>
       <el-form :model="sourceList.pagination" label-width="100px" label-position="top">
@@ -285,6 +343,7 @@ import { ElMessage, ElMessageBox } from "element-plus";
 import byTable from "@/components/byTable/index";
 import byForm from "@/components/byForm/index";
 import { computed, nextTick, reactive, ref } from "vue";
+import {isNullOrUndefined} from "@tinymce/tinymce-vue/lib/es2015/main/ts/Utils";
 const { proxy } = getCurrentInstance();
 
 const router = useRouter();
@@ -295,6 +354,7 @@ const orderState = ref([]);
 
 const blessingTypeList = ref([]);
 const submitLoading = ref(false);
+const submitLoadingRemark = ref(false);
 const sourceList = ref({
   data: [],
   pagination: {
@@ -312,10 +372,12 @@ let rules = ref({
     { required: true, message: "请输入不满足发货原因", trigger: "blur" },
   ],
   confirmNum: [{ required: true, message: "请输入确认数量", trigger: "blur" }],
+  remark: [{ required: true, message: "请输入备注", trigger: "blur" }],
 });
 
 const queryDialogVisible = ref(false);
 const dialogVisible = ref(false);
+const remarkDialogVisible = ref(false);
 const tellDialogVisible = ref(false);
 
 let modalType = ref("add");
@@ -363,6 +425,34 @@ const selectConfig = computed(() => {
         },
       ],
     },
+    {
+      label: "是否异常",
+      prop: "hasEx",
+      data: [
+        {
+          label: "异常",
+          value: "1",
+        },
+        {
+          label: "无异常",
+          value: "0",
+        },
+      ],
+    },
+    {
+      label: "是否备注",
+      prop: "hasRemark",
+      data: [
+        {
+          label: "有备注",
+          value: "1",
+        },
+        {
+          label: "无备注",
+          value: "0",
+        },
+      ],
+    },
   ];
 });
 
@@ -371,23 +461,9 @@ const config = computed(() => {
     {
       attrs: {
         label: "京东订单号",
+        slot: "orderId",
         align: "left",
-        width: 120,
-      },
-      renderHTML(row) {
-        return [
-          {
-            attrs: {
-              label: row.orderId,
-              type: "primary",
-              text: true,
-            },
-            el: "button",
-            click() {
-              getDtl(row);
-            },
-          },
-        ];
+        width: 200,
       },
     },
     {
@@ -476,6 +552,31 @@ const config = computed(() => {
     },
     {
       attrs: {
+        label: "备注",
+        slot: "remark",
+        width: 200,
+        align: "left",
+      },
+    },
+    // {
+    //   attrs: {
+    //     label: "是否有异常",
+    //     prop: "hasEx",
+    //     align: "left",
+    //     width: 100,
+    //   },
+    //   render(value) {
+    //     let label = "未确认";
+    //     if (value == "1") {
+    //       label = "异常";
+    //     } else if (value == "0") {
+    //       label = "无异常";
+    //     }
+    //     return label;
+    //   },
+    // },
+    {
+      attrs: {
         label: "是否确认",
         prop: "businessStatus",
         align: "left",
@@ -494,7 +595,7 @@ const config = computed(() => {
     {
       attrs: {
         label: "操作",
-        width: "150",
+        width: "200",
         align: "center",
         fixed: "right",
       },
@@ -514,7 +615,7 @@ const config = computed(() => {
           row.businessStatus == 0
             ? {
                 attrs: {
-                  label: "采购单确认",
+                  label: "采购单确认(需出库)",
                   type: "danger",
                   text: true,
                 },
@@ -525,7 +626,25 @@ const config = computed(() => {
                     cancelButtonText: "取消",
                     type: "warning",
                   }).then(() => {
-                    confirmBusinessStatus(row);
+                    confirmBusinessStatus(row,true);
+                  });
+                },
+              }
+            : {},row.businessStatus == 0
+            ? {
+                attrs: {
+                  label: "采购单确认(无需出库)",
+                  type: "danger",
+                  text: true,
+                },
+                el: "button",
+                click() {
+                  ElMessageBox.confirm("是否确认当前采购单状态?", "提示", {
+                    confirmButtonText: "确定",
+                    cancelButtonText: "取消",
+                    type: "warning",
+                  }).then(() => {
+                    confirmBusinessStatus(row,false);
                   });
                 },
               }
@@ -616,6 +735,17 @@ const getList = async (req) => {
   });
 };
 
+// const tableRowClassName = (row, callback) => {
+//   if (row.row.hasEx == 1) {
+//     callback('error-row') ;
+//   } else  {
+//     callback('') ;
+//   }
+// }
+
+
+
+
 const openModal = () => {
   dialogVisible.value = true;
   modalType.value = "add";
@@ -646,16 +776,25 @@ const getTellDtl = (row) => {
   });
 };
 
+const showTipRemark = (row) => {
+  remarkDialogVisible.value = true;
+  formData.data = {
+    id:row.id,
+    remark:row.remark
+  };
+};
+
 /**
  * 确认采购单状态
  * @param row
  */
-const confirmBusinessStatus = (row) => {
+const confirmBusinessStatus = (row,flag) => {
   let businessStatus = row.businessStatus == "1" ? 0 : 1;
   proxy
     .post("/jdOrder/confirmBusinessStatus", {
       id: row.id,
       businessStatus: businessStatus,
+      isOut: flag,
     })
     .then(
       () => {
@@ -701,6 +840,32 @@ const submitForm = () => {
   });
 };
 
+//保存备注方法
+const submitRemark = () => {
+  ElMessageBox.confirm("是否保存备注?", "提示", {
+    confirmButtonText: "确定",
+    cancelButtonText: "取消",
+    type: "warning",
+  }).then(() => {
+    submitLoadingRemark.value = true;
+    proxy.post("/jdOrder/saveRemark", formData.data).then(
+      () => {
+        ElMessage({
+          message: "保存成功",
+          type: "success",
+        });
+        remarkDialogVisible.value = false;
+        submitLoadingRemark.value = false;
+        getList();
+      },
+      (err) => {
+        console.log(err);
+        submitLoadingRemark.value = false;
+      }
+    );
+  });
+};
+
 //高级搜索
 const handleReset = () => {
   sourceList.value.pagination = {
@@ -725,6 +890,8 @@ const handleQuery = () => {
   getList();
 };
 
+
+
 getDictlist();
 getList();
 </script>
@@ -736,4 +903,8 @@ getList();
 :deep(.el-form-item--default) {
   margin-bottom: 0px;
 }
+.el-table .error-row {
+  background: rgba(245, 108, 108, 0.68);
+}
+
 </style>