24282 6 months ago
parent
commit
a03713ef06

+ 36 - 2
src/views/WDLY/salesMange/jdReGoodsInspection/index.vue

@@ -3,6 +3,39 @@
     <byTable :source="sourceList.data" :pagination="sourceList.pagination" :config="config" :loading="loading"
              :selectConfig="selectConfig" :action-list="actionList" @get-list="getList"
              @moreSearch="() => queryDialogVisible = true">
+
+      <template #scrappedCount="{item}">
+        <div v-if="item.scrappedCount === 0">
+          {{ item.scrappedCount }}
+        </div>
+
+        <el-popover v-else placement="left" :width="600" trigger="click">
+          <template #reference>
+            <el-link type="danger">
+              {{ item.scrappedCount }}
+            </el-link>
+          </template>
+          <el-table :data="[item]">
+            <el-table-column width="100" property="scrappedCount" label="报废数量" />
+            <el-table-column width="130" property="scrappedToQualifiedCount" label="报废转良品数量" />
+            <el-table-column width="130" property="scrappedToDefectiveCount" label="报废转次品数量" />
+            <el-table-column width="120" property="resultScrappedCount" label="最终报废数量" />
+            <el-table-column width="100" property="scrappedHandleStatus" label="处理状态" :formatter="(item)=>{
+              switch(item.scrappedHandleStatus){
+                case 1: return '待处理'
+                case 2: return '待确认'
+                case 3: return '已确认'
+              }
+            }" />
+            <el-table-column width="160" property="handleUserName" label="处理人" />
+            <el-table-column width="160" property="scrappedHandleTime" label="处理时间" />
+            <el-table-column width="160" property="verifyUserName" label="确认人" />
+            <el-table-column width="160" property="scrappedVerifyTime" label="确认时间" />
+          </el-table>
+
+        </el-popover>
+      </template>
+
     </byTable>
 
     <!--高级搜索-->
@@ -113,10 +146,11 @@ const config = computed(() => {
     {
       attrs: {
         label: "报废数量",
-        prop: "scrappedCount",
+        slot: "scrappedCount",
         align: "left",
-        minWidth: 150
+        width: 150
       },
+
     },
     {
       attrs: {

+ 257 - 0
src/views/WDLY/salesMange/jdScrappedHandle/index.vue

@@ -0,0 +1,257 @@
+<template>
+  <div class="tenant">
+    <byTable :source="sourceList.data" :pagination="sourceList.pagination" :config="config" :loading="loading"
+             :selectConfig="selectConfig" :action-list="actionList" @get-list="getList"
+             @moreSearch="() => queryDialogVisible = true">
+    </byTable>
+
+    <!--高级搜索-->
+    <el-dialog :title="'高级检索'" v-model="queryDialogVisible" width="500px" destroy-on-close>
+
+      <el-form label-width="auth">
+        <!--        <el-form-item label="申请日期">-->
+        <!--          <el-date-picker v-model="sourceList.pagination.applyDate" value-format="YYYY-MM-DD" type="daterange"/>-->
+        <!--        </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>
+
+
+    <el-dialog title="处理" v-model="visible" width="500px" destroy-on-close>
+
+      <el-form label-position="right" label-width="auto">
+        <el-form-item label="报废数量">
+          <el-input-number v-model="formData.scrappedCount" style="width: 100%" :controls="false" disabled></el-input-number>
+        </el-form-item>
+        <el-form-item label="转良品数量">
+          <el-input-number v-model="formData.scrappedToQualifiedCount" style="width: 100%" :controls="false" :min="0"
+                           :max="formData.scrappedCount" :precision="0"/>
+        </el-form-item>
+        <el-form-item label="转次品数量">
+          <el-input-number v-model="formData.scrappedToDefectiveCount" style="width: 100%" :controls="false" :min="0"
+                           :max="formData.scrappedCount" :precision="0"/>
+        </el-form-item>
+        <el-form-item label="最终报废数量">
+          <el-input-number v-model="formData.resultScrappedCount" style="width: 100%" :controls="false" :min="0"
+                           :max="formData.scrappedCount" :precision="0"/>
+        </el-form-item>
+      </el-form>
+
+      <template #footer>
+        <el-button @click="visible = false" size="large">取消</el-button>
+        <el-button @click="submit" type="primary" size="large">确定</el-button>
+      </template>
+    </el-dialog>
+
+  </div>
+</template>
+
+<script setup>
+import byTable from "@/components/byTable/index";
+import {computed, getCurrentInstance, ref} from "vue";
+import {ElMessage} from "element-plus";
+
+const {proxy} = getCurrentInstance();
+const loading = ref(false);
+
+const visible = ref(false);
+const queryDialogVisible = ref(false);
+
+const formData = ref({})
+
+const sourceList = ref({
+  data: [],
+  pagination: {
+    total: 0,
+    pageNum: 1,
+    pageSize: 10,
+  },
+});
+
+const selectConfig = computed(() => {
+  return [];
+});
+
+const actionList = computed(() => {
+  return []
+});
+
+const config = computed(() => {
+  return [
+    {
+      attrs: {
+        label: "质检单号",
+        prop: "code",
+        align: "left",
+      },
+    },
+    {
+      attrs: {
+        label: "物品编码",
+        prop: "productCustomCode",
+        align: "left",
+      },
+    },
+    {
+      attrs: {
+        label: "物品名称",
+        prop: "productName",
+        align: "left",
+      },
+    },
+    {
+      attrs: {
+        label: "规格",
+        prop: "productSpec",
+        align: "left",
+      },
+    },
+    {
+      attrs: {
+        label: "单位",
+        prop: "productUnit",
+        align: "left",
+      },
+    },
+    {
+      attrs: {
+        label: "报废数量",
+        prop: "scrappedCount",
+        align: "left",
+      },
+    },
+    {
+      attrs: {
+        label: "报废转良品数量",
+        prop: "scrappedToQualifiedCount",
+        align: "left",
+      },
+    },
+    {
+      attrs: {
+        label: "报废转次品数量",
+        prop: "scrappedToDefectiveCount",
+        align: "left",
+      },
+    },
+    {
+      attrs: {
+        label: "最终报废数量",
+        prop: "resultScrappedCount",
+        align: "left",
+      },
+    },
+    {
+      attrs: {
+        label: "状态",
+        prop: "scrappedHandleStatus",
+        align: "left",
+      },
+      render(scrappedHandleStatus) {
+        switch (scrappedHandleStatus) {
+          case 1:
+            return '待处理'
+          case 2:
+            return '待确认'
+          case 3:
+            return '已确认'
+        }
+        return '未知状态';
+      },
+    },
+    {
+      attrs: {
+        label: "操作",
+        align: "center",
+        fixed: "right",
+        width: 120
+      },
+      renderHTML(row) {
+        if (row.scrappedHandleStatus === 1) {
+          return [{
+            attrs: {
+              label: "处理",
+              type: "primary",
+              text: true,
+            },
+            el: "button",
+            click() {
+              visible.value = true
+              formData.value = {...row, resultScrappedCount: row.scrappedCount}
+            },
+          }]
+        }
+      }
+    }
+
+  ];
+});
+
+const getList = async (req) => {
+  loading.value = true;
+
+  sourceList.value.pagination = {...sourceList.value.pagination, ...req}
+
+  const queryData = {...sourceList.value.pagination, ...req, status: [1, 2, 3]};
+  const applyDate = queryData.applyDate;
+  if (applyDate?.length === 2) {
+    delete queryData.applyDate
+    queryData.beginTime = applyDate[0]
+    queryData.endTime = applyDate[1]
+  }
+
+  proxy.get("/jdRefundQualityCheck/getPage", queryData)
+      .then(({data}) => {
+        sourceList.value.data = data.rows;
+        sourceList.value.pagination.total = data.total;
+      })
+      .finally(_ => {
+        loading.value = false;
+      })
+
+};
+
+const handleReset = () => {
+  sourceList.value.pagination = {
+    pageNum: sourceList.value.pagination.pageNum,
+    pageSize: sourceList.value.pagination.pageSize,
+  };
+  handleQuery();
+};
+
+const handleQuery = () => {
+  queryDialogVisible.value = false;
+  getList();
+};
+
+const submit = () => {
+  const {scrappedCount,scrappedToQualifiedCount,scrappedToDefectiveCount,resultScrappedCount} = formData.value
+  if (scrappedCount !== scrappedToQualifiedCount + scrappedToDefectiveCount + resultScrappedCount) {
+    ElMessage.error("转良品数量+转次品数量+最终报废数量 必须等于 报废数量")
+    return
+  }
+  proxy.post("/jdRefundQualityCheck/handle", formData.value)
+      .then(() => {
+        ElMessage.success("处理成功")
+        visible.value = false;
+        getList()
+      })
+}
+
+getList();
+
+</script>
+
+<style lang='scss' scoped>
+.tenant {
+  padding: 20px;
+}
+
+
+.el-table .error-row {
+  background: rgba(245, 108, 108, 0.68);
+}
+</style>

+ 226 - 0
src/views/WDLY/salesMange/jdScrappedVerify/index.vue

@@ -0,0 +1,226 @@
+<template>
+  <div class="tenant">
+    <byTable :source="sourceList.data" :pagination="sourceList.pagination" :config="config" :loading="loading"
+             :selectConfig="selectConfig" :action-list="actionList" @get-list="getList"
+             @moreSearch="() => queryDialogVisible = true">
+    </byTable>
+
+    <!--高级搜索-->
+    <el-dialog :title="'高级检索'" v-model="queryDialogVisible" width="500px" destroy-on-close>
+
+      <el-form label-width="auth">
+        <!--        <el-form-item label="申请日期">-->
+        <!--          <el-date-picker v-model="sourceList.pagination.applyDate" value-format="YYYY-MM-DD" type="daterange"/>-->
+        <!--        </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 byTable from "@/components/byTable/index";
+import {computed, getCurrentInstance, ref} from "vue";
+import {ElMessage, ElMessageBox} from "element-plus";
+
+const {proxy} = getCurrentInstance();
+const loading = ref(false);
+
+const queryDialogVisible = ref(false);
+
+const sourceList = ref({
+  data: [],
+  pagination: {
+    total: 0,
+    pageNum: 1,
+    pageSize: 10,
+  },
+});
+
+const selectConfig = computed(() => {
+  return [];
+});
+
+const actionList = computed(() => {
+  return []
+});
+
+const config = computed(() => {
+  return [
+    {
+      attrs: {
+        label: "质检单号",
+        prop: "code",
+        align: "left",
+      },
+    },
+    {
+      attrs: {
+        label: "物品编码",
+        prop: "productCustomCode",
+        align: "left",
+      },
+    },
+    {
+      attrs: {
+        label: "物品名称",
+        prop: "productName",
+        align: "left",
+      },
+    },
+    {
+      attrs: {
+        label: "规格",
+        prop: "productSpec",
+        align: "left",
+      },
+    },
+    {
+      attrs: {
+        label: "单位",
+        prop: "productUnit",
+        align: "left",
+      },
+    },
+    {
+      attrs: {
+        label: "报废数量",
+        prop: "scrappedCount",
+        align: "left",
+      },
+    },
+    {
+      attrs: {
+        label: "报废转良品数量",
+        prop: "scrappedToQualifiedCount",
+        align: "left",
+      },
+    },
+    {
+      attrs: {
+        label: "报废转次品数量",
+        prop: "scrappedToDefectiveCount",
+        align: "left",
+      },
+    },
+    {
+      attrs: {
+        label: "最终报废数量",
+        prop: "resultScrappedCount",
+        align: "left",
+      },
+    },
+    {
+      attrs: {
+        label: "状态",
+        prop: "scrappedHandleStatus",
+        align: "left",
+      },
+      render(scrappedHandleStatus) {
+        switch (scrappedHandleStatus) {
+          case 1:
+            return '待处理'
+          case 2:
+            return '待确认'
+          case 3:
+            return '已确认'
+        }
+        return '未知状态';
+      },
+    },
+    {
+      attrs: {
+        label: "操作",
+        align: "center",
+        fixed: "right",
+        width: 120
+      },
+      renderHTML(row) {
+        if (row.scrappedHandleStatus === 2) {
+          return [{
+            attrs: {
+              label: "确认",
+              type: "primary",
+              text: true,
+            },
+            el: "button",
+            click() {
+              ElMessageBox.confirm("是否确认?", "提示", {
+                confirmButtonText: "确定",
+                cancelButtonText: "取消",
+                type: "warning",
+              }).then(() => {
+                loading.value = true;
+                proxy.post("/jdRefundQualityCheck/verify", {id: row.id})
+                    .then(() => {
+                      ElMessage.success("确认成功")
+                      getList()
+                    })
+                    .catch(err => {
+                      loading.value = false;
+                    })
+              })
+            },
+          }]
+        }
+      }
+    }
+
+  ];
+});
+
+const getList = async (req) => {
+  loading.value = true;
+
+  sourceList.value.pagination = {...sourceList.value.pagination, ...req}
+
+  const queryData = {...sourceList.value.pagination, ...req, status: [2, 3]};
+  const applyDate = queryData.applyDate;
+  if (applyDate?.length === 2) {
+    delete queryData.applyDate
+    queryData.beginTime = applyDate[0]
+    queryData.endTime = applyDate[1]
+  }
+
+  proxy.get("/jdRefundQualityCheck/getPage", queryData)
+      .then(({data}) => {
+        sourceList.value.data = data.rows;
+        sourceList.value.pagination.total = data.total;
+      })
+      .finally(_ => {
+        loading.value = false;
+      })
+
+};
+
+const handleReset = () => {
+  sourceList.value.pagination = {
+    pageNum: sourceList.value.pagination.pageNum,
+    pageSize: sourceList.value.pagination.pageSize,
+  };
+  handleQuery();
+};
+
+const handleQuery = () => {
+  queryDialogVisible.value = false;
+  getList();
+};
+
+getList();
+
+</script>
+
+<style lang='scss' scoped>
+.tenant {
+  padding: 20px;
+}
+
+
+.el-table .error-row {
+  background: rgba(245, 108, 108, 0.68);
+}
+</style>