Kaynağa Gözat

京东采购单
1、【异常】数据高亮显示
2、京东采购单 列表增加备注字段,可编辑备注
3、增加检索条件,筛选异常数据,筛选有备注的数据
4、采购单明细表【多货】【少货】数据高亮显示
5、列表操作按钮:采购单确认(需出库)、采购单确认(无需出库)

41235 1 yıl önce
ebeveyn
işleme
1e30f3a5a8

+ 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>

+ 7 - 1
src/views/WDLY/jd/abnormalDetails/index.vue

@@ -3,7 +3,9 @@
     <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)"
+
+    >
     </byTable>
     <!--回告-->
     <el-dialog :z-index="1500" title="采购单回告" v-if="tellDialogVisible" v-model="formData.data" width="1500px" v-loading="loading">
@@ -725,6 +727,10 @@ const handleQuery = () => {
   getList();
 };
 
+
+
+
+
 getDictlist();
 getList();
 </script>

+ 169 - 9
src/views/WDLY/jd/order/index.vue

@@ -3,7 +3,21 @@
     <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)"
+             @updateTableRowClassName="tableRowClassName"
+    >
+
+      <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 +244,28 @@
         </el-row>
         <el-row>
           <el-descriptions title="采购单明细" />
+          <span>
+            (
+              <svg-icon icon-class="jdyl" style="width: 34px;"/> 多货
+              <svg-icon icon-class="jdks" style="width: 34px;"/> 少货
+            )
+          </span>
           <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 v-if="scope.row.exDesc=='1'">
+                     <svg-icon icon-class="jdyl" style="width: 34px;"/>
+                </span>
+                <span v-if="scope.row.exDesc=='2'">
+                     <svg-icon icon-class="jdks" style="width: 34px;"/>
+                </span>
+
+
                 <span
-                      :style="scope.row.productName=='' || scope.row.productName == undefined || scope.row.productName == 'undefined'?'color: red':''">{{scope.row.wareId}}</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">
@@ -262,6 +292,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 +332,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 +343,7 @@ const orderState = ref([]);
 
 const blessingTypeList = ref([]);
 const submitLoading = ref(false);
+const submitLoadingRemark = ref(false);
 const sourceList = ref({
   data: [],
   pagination: {
@@ -312,10 +361,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");
@@ -365,15 +416,29 @@ const selectConfig = computed(() => {
     },
     {
       label: "是否异常",
-      prop: "isCanConfirm",
+      prop: "hasEx",
       data: [
         {
           label: "异常",
-          value: 1,
+          value: "1",
         },
         {
           label: "无异常",
-          value: 0,
+          value: "0",
+        },
+      ],
+    },
+    {
+      label: "是否备注",
+      prop: "hasRemark",
+      data: [
+        {
+          label: "有备注",
+          value: "1",
+        },
+        {
+          label: "无备注",
+          value: "0",
         },
       ],
     },
@@ -490,6 +555,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",
@@ -528,7 +618,7 @@ const config = computed(() => {
           row.businessStatus == 0
             ? {
                 attrs: {
-                  label: "采购单确认",
+                  label: "采购单确认(需出库)",
                   type: "danger",
                   text: true,
                 },
@@ -539,7 +629,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);
                   });
                 },
               }
@@ -630,6 +738,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";
@@ -660,16 +779,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(
       () => {
@@ -715,6 +843,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 = {
@@ -739,6 +893,8 @@ const handleQuery = () => {
   getList();
 };
 
+
+
 getDictlist();
 getList();
 </script>
@@ -750,4 +906,8 @@ getList();
 :deep(.el-form-item--default) {
   margin-bottom: 0px;
 }
+.el-table .error-row {
+  background: rgba(245, 108, 108, 0.68);
+}
+
 </style>