Ver código fonte

代码更新

chen 2 anos atrás
pai
commit
5196f16d53

+ 3 - 2
src/option/product/product.js

@@ -103,7 +103,7 @@ export default {
       search: true,
     },
     {
-      label: "二维码编号",
+      label: "产品编号",
       prop: "qrCode",
       type: "input",
       search: true,
@@ -207,7 +207,6 @@ export default {
       type: "input",
       addDisplay: false,
       editDisplay: false,
-      viewDisplay: false,
     },
     {
       label: "修改人",
@@ -247,6 +246,7 @@ export default {
       searchRange:true,
       addDisplay: false,
       editDisplay: false,
+      viewDisplay: false,
       hide: true
     },
     {
@@ -260,6 +260,7 @@ export default {
       searchRange:true,
       addDisplay: false,
       editDisplay: false,
+      viewDisplay: false,
       hide: true
     },
   ]

+ 265 - 0
src/option/product/productInStock.js

@@ -0,0 +1,265 @@
+import { setStore, getStore } from '@/utils/store';
+export default {
+  height:'auto',
+  calcHeight: 30,
+  tip: false,
+  searchShow: true,
+  searchMenuSpan: 6,
+  border: true,
+  index: true,
+  viewBtn: true,
+  selection: true,
+  dialogClickModal: false,
+  labelWidth:160,
+  columnBtn:false,
+  addBtn:false,
+  editBtn:false,
+  delBtn:false,
+  column: [
+    {
+      label: "主键",
+      prop: "id",
+      type: "input",
+      addDisplay: false,
+      editDisplay: false,
+      viewDisplay: false,
+      hide: true,
+    },
+    {
+      label: "租户ID",
+      prop: "tenantId",
+      type: "input",
+      addDisplay: false,
+      editDisplay: false,
+      viewDisplay: false,
+      hide: true,
+    },
+    {
+      label: "所属工厂",
+      prop: "factoryId",
+      search: getStore({ name: 'userInfo' }).user_category==1,
+      hide: getStore({ name: 'userInfo' }).user_category!=1,
+      display: getStore({ name: 'userInfo' }).user_category==1,
+      type: "tree",
+      dicUrl: "/api/pl-factory/factory/select",
+      props: {
+        label: "name",
+        value: "id",
+      },
+    },
+    {
+      label: "所属客户",
+      prop: "clientId",
+      type: "input",
+      search: true,
+      type: "tree",
+      dicUrl: "/api/pl-client/client/select",
+      props: {
+        label: "name",
+        value: "id",
+      },
+    },
+    {
+      label: "批次id",
+      prop: "batchId",
+      type: "input",
+      addDisplay: false,
+      editDisplay: false,
+      viewDisplay: false,
+      hide: true,
+    },
+    {
+      label: "批次号",
+      prop: "batchNo",
+      type: "input",
+      search: true,
+    },
+    {
+      label: "产品型号id",
+      prop: "productModelId",
+      type: "select",
+      hide: true,
+      addDisplay: false,
+      editDisplay: false,
+      viewDisplay: false,
+      hide: true,
+    },
+    {
+      label: "产品名称",
+      prop: "productName",
+      type: "input",
+      addDisplay: false,
+      editDisplay: false,
+      viewDisplay: false,
+      search: true,
+    },
+    {
+      label: "产品型号",
+      prop: "productModel",
+      type: "input",
+      addDisplay: false,
+      editDisplay: false,
+      viewDisplay: false,
+      search: true,
+    },
+    {
+      label: "产品编号",
+      prop: "qrCode",
+      type: "input",
+      search: true,
+    },
+    {
+      label: "正面图片",
+      prop: "frontImg",
+      type: 'upload',
+      listType: 'picture-img',
+      dataType:"String",
+      hide: true,
+    },
+    {
+      label: "背面图片",
+      prop: "backImg",
+      type: 'upload',
+      listType: 'picture-img',
+      dataType:"String",
+      hide: true,
+    },
+    {
+      label: "扫码日期",
+      prop: "scanDate",
+      type: "input",
+    },
+    {
+      label: "水冷",
+      prop: "waterCooling",
+      type: "input",
+    },
+    {
+      label: "气密",
+      prop: "airtight",
+      type: "input",
+    },
+    {
+      label: "订单号",
+      prop: "orderNo",
+      type: "input",
+    },
+    // {
+    //   label: "出货批次",
+    //   prop: "shipmentBatch",
+    //   type: "input",
+    // },
+    {
+      label: "冷板二维码",
+      prop: "coldQrCode",
+      type: "input",
+    },
+    {
+      label: "检测结果(1合格 2不合格)",
+      prop: "checkResult",
+      type: "input",
+      addDisplay: false,
+      editDisplay: false,
+      viewDisplay: false,
+      hide: true,
+    },
+    {
+      label: "状态",
+      prop: "status",
+      addDisplay: false,
+      editDisplay: false,
+      type:"select",
+      dataType:"number",
+      dicUrl:"/blade-system/dict-biz/dictionary?code=order_status",
+      props:{label:"dictValue",value:"dictKey"},
+    },
+    {
+      label: "入库时间",
+      prop: "inStockDate",
+      type: "input",
+      addDisplay: false,
+      editDisplay: false,
+      viewDisplay: false,
+      hide: true,
+    },
+    {
+      label: "创建人",
+      prop: "createUser",
+      type: "input",
+      addDisplay: false,
+      editDisplay: false,
+      viewDisplay: false,
+      hide: true,
+    },
+    {
+      label: "创建部门",
+      prop: "createDept",
+      type: "input",
+      addDisplay: false,
+      editDisplay: false,
+      viewDisplay: false,
+      hide: true,
+    },
+    {
+      label: "创建时间",
+      prop: "createTime",
+      type: "input",
+      addDisplay: false,
+      editDisplay: false,
+      viewDisplay: false,
+    },
+    {
+      label: "修改人",
+      prop: "updateUser",
+      type: "input",
+      addDisplay: false,
+      editDisplay: false,
+      viewDisplay: false,
+      hide: true,
+    },
+    {
+      label: "修改时间",
+      prop: "updateTime",
+      type: "input",
+      addDisplay: false,
+      editDisplay: false,
+      viewDisplay: false,
+      hide: true,
+    },
+    {
+      label: "是否已删除",
+      prop: "isDeleted",
+      type: "input",
+      addDisplay: false,
+      editDisplay: false,
+      viewDisplay: false,
+      hide: true,
+    },
+    {
+      label: "扫码日期",
+      prop: "scanDateArr",
+      search: true,
+      searchType: "daterange",
+      format: "YYYY-MM-DD",
+      valueFormat: "YYYY-MM-DD",
+      dataType:'string',
+      searchRange:true,
+      addDisplay: false,
+      editDisplay: false,
+      hide: true
+    },
+    {
+      label: "创建时间",
+      prop: "createTimeArr",
+      search: true,
+      searchType: "daterange",
+      format: "YYYY-MM-DD",
+      valueFormat: "YYYY-MM-DD",
+      dataType:'string',
+      searchRange:true,
+      addDisplay: false,
+      editDisplay: false,
+      hide: true
+    },
+  ]
+}

+ 0 - 5
src/option/productBatch/product.js

@@ -71,11 +71,6 @@ export default {
       prop: "coldQrCode",
       type: "input",
       cell: true,
-      rules: [{
-        required: true,
-        message: "请填写冷板二维码",
-        trigger: "blur"
-      }]
     },
   ]
 }

+ 13 - 0
src/option/productModel/productModel.js

@@ -5,6 +5,7 @@ export default {
   tip: false,
   searchShow: true,
   searchMenuSpan: 6,
+  labelWidth:120,
   border: true,
   index: true,
   viewBtn: true,
@@ -81,6 +82,18 @@ export default {
         { min: 4, max: 4, message: "请输入4位数字", trigger: "blur" }
       ],
     },
+    {
+      label: "是否直接入库",
+      prop: "isDirectStorage",
+      type: 'switch',
+          dicData: [{
+            label: '否',
+            value: 0
+          }, {
+            label: '是',
+            value: 1
+          }]
+    },
     {
       label: "创建人",
       prop: "createUser",

+ 71 - 0
src/option/productRework/productReworkReport.js

@@ -0,0 +1,71 @@
+import { setStore, getStore } from '@/utils/store';
+export default {
+  height:'auto',
+  calcHeight: 30,
+  tip: false,
+  searchShow: true,
+  searchMenuSpan: 6,
+  border: true,
+  index: true,
+  viewBtn: true,
+  selection: true,
+  dialogClickModal: false,
+  labelWidth:160,
+  columnBtn:false,
+  addBtn:false,
+  editBtn:false,
+  delBtn:false,
+  column: [
+    {
+      label: "上报人",
+      prop: "createPersonName",
+      type: "input",
+      addDisplay: false,
+      editDisplay: false,
+    },
+    {
+      label: "上报日期",
+      prop: "createTime",
+      type: "input",
+      addDisplay: false,
+      editDisplay: false,
+    },
+    {
+      label: "维修人",
+      prop: "reworkPersonName",
+      type: "input",
+    },
+    {
+      label: "维修时间",
+      prop: "reworkDate",
+      type: "input",
+    },
+    {
+      label: "审核人",
+      prop: "auditPersonName",
+      type: "input",
+    },
+    {
+      label: "审核时间",
+      prop: "auditDate",
+      type: "input",
+    },
+    {
+      label: "产品二维码",
+      prop: "qrCode",
+      type: "input",
+      search: true,
+    },
+    {
+      label: "状态",
+      prop: "status",
+      addDisplay: false,
+      editDisplay: false,
+      type:"select",
+      dataType:"number",
+      dicUrl:"/blade-system/dict-biz/dictionary?code=repair_status",
+      props:{label:"dictValue",value:"dictKey"},
+      search: true,
+    },
+  ]
+}

+ 245 - 0
src/views/product/productInStock.vue

@@ -0,0 +1,245 @@
+<template>
+  <basic-container>
+    <avue-crud :option="option"
+               v-model:search="search"
+               v-model:page="page"
+               v-model="form"
+               :table-loading="loading"
+               :data="data"
+               :permission="permissionList"
+               :before-open="beforeOpen"
+               ref="crud"
+               @row-update="rowUpdate"
+               @row-save="rowSave"
+               @row-del="rowDel"
+               @search-change="searchChange"
+               @search-reset="searchReset"
+               @selection-change="selectionChange"
+               @current-change="currentChange"
+               @size-change="sizeChange"
+               @refresh-change="refreshChange"
+               @on-load="onLoad">
+      <template #menu-left>
+        <!-- <el-button type="danger"
+                   icon="el-icon-delete"
+                   plain
+                   v-if="permission.product_delete"
+                   @click="handleDelete">删 除
+        </el-button> -->
+        <el-button type="warning"
+                   plain
+                   icon="el-icon-download"
+                   @click="handleExport">导 出
+        </el-button>
+      </template>
+    </avue-crud>
+  </basic-container>
+</template>
+
+<script>
+  import {getList, getDetail, add, update, remove} from "@/api/product/product";
+  import option from "@/option/product/productInStock";
+  import {mapGetters} from "vuex";
+  import {exportBlob} from "@/api/common";
+  import {getToken} from '@/utils/auth';
+  import {downloadXls} from "@/utils/util";
+  import {dateNow} from "@/utils/date";
+  import NProgress from 'nprogress';
+  import 'nprogress/nprogress.css';
+
+  export default {
+    data() {
+      return {
+        form: {},
+        query: {},
+        search: {},
+        loading: true,
+        page: {
+          pageSize: 10,
+          currentPage: 1,
+          total: 0
+        },
+        selectionList: [],
+        option: option,
+        data: []
+      };
+    },
+    computed: {
+      ...mapGetters(["permission"]),
+      permissionList() {
+        return {
+          addBtn: this.validData(this.permission.product_add, false),
+          viewBtn: this.validData(this.permission.product_view, false),
+          delBtn: this.validData(this.permission.product_delete, false),
+          editBtn: this.validData(this.permission.product_edit, false)
+        };
+      },
+      ids() {
+        let ids = [];
+        this.selectionList.forEach(ele => {
+          ids.push(ele.id);
+        });
+        return ids.join(",");
+      }
+    },
+    methods: {
+      rowSave(row, done, loading) {
+        add(row).then(() => {
+          this.onLoad(this.page);
+          this.$message({
+            type: "success",
+            message: "操作成功!"
+          });
+          done();
+        }, error => {
+          loading();
+          window.console.log(error);
+        });
+      },
+      rowUpdate(row, index, done, loading) {
+        update(row).then(() => {
+          this.onLoad(this.page);
+          this.$message({
+            type: "success",
+            message: "操作成功!"
+          });
+          done();
+        }, error => {
+          loading();
+          console.log(error);
+        });
+      },
+      rowDel(row) {
+        this.$confirm("确定将选择数据删除?", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        })
+          .then(() => {
+            return remove(row.id);
+          })
+          .then(() => {
+            this.onLoad(this.page);
+            this.$message({
+              type: "success",
+              message: "操作成功!"
+            });
+          });
+      },
+      handleDelete() {
+        if (this.selectionList.length === 0) {
+          this.$message.warning("请选择至少一条数据");
+          return;
+        }
+        this.$confirm("确定将选择数据删除?", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        })
+          .then(() => {
+            return remove(this.ids);
+          })
+          .then(() => {
+            this.onLoad(this.page);
+            this.$message({
+              type: "success",
+              message: "操作成功!"
+            });
+            this.$refs.crud.toggleSelection();
+          });
+      },
+      handleExport() {
+        let downloadUrl = `/pl-product/product/export-product?${this.website.tokenHeader}=${getToken()}`;
+        const {
+            clientId,
+            batchNo,
+            productName,
+            productModel,
+        } = this.query;
+        let values = {
+          clientId: clientId,
+          batchNo: batchNo,
+          productName: productName,
+          productModel: productModel,
+          status:3,
+        };
+        this.query.status=3
+        this.$confirm("是否导出数据?", "提示", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(() => {
+          NProgress.start();
+          exportBlob(downloadUrl, this.query).then(res => {
+            downloadXls(res.data, `产品表${dateNow()}.xlsx`);
+            NProgress.done();
+          })
+        });
+      },
+      beforeOpen(done, type) {
+        if (["edit", "view"].includes(type)) {
+          getDetail(this.form.id).then(res => {
+            this.form = res.data.data;
+          });
+        }
+        done();
+      },
+      searchReset() {
+        this.query = {};
+        this.onLoad(this.page);
+      },
+      searchChange(params, done) {
+        this.query = params;
+        this.page.currentPage = 1;
+        this.onLoad(this.page, params);
+        done();
+      },
+      selectionChange(list) {
+        this.selectionList = list;
+      },
+      selectionClear() {
+        this.selectionList = [];
+        this.$refs.crud.toggleSelection();
+      },
+      currentChange(currentPage){
+        this.page.currentPage = currentPage;
+      },
+      sizeChange(pageSize){
+        this.page.pageSize = pageSize;
+      },
+      refreshChange() {
+        this.onLoad(this.page, this.query);
+      },
+      onLoad(page, params = {}) {
+        this.loading = true;
+
+        const {
+          clientId,
+          batchNo,
+          productName,
+          productModel,
+        } = this.query;
+
+        let values = {
+          clientId: clientId,
+          batchNo: batchNo,
+          productName: productName,
+          productModel: productModel,
+          status:3,
+        };
+        this.query.status=3
+
+        getList(page.currentPage, page.pageSize, this.query).then(res => {
+          const data = res.data.data;
+          this.page.total = data.total;
+          this.data = data.records;
+          this.loading = false;
+          this.selectionClear();
+        });
+      }
+    }
+  };
+</script>
+
+<style>
+</style>

+ 239 - 0
src/views/productRework/productReworkReport.vue

@@ -0,0 +1,239 @@
+<template>
+  <basic-container>
+    <avue-crud :option="option"
+               v-model:search="search"
+               v-model:page="page"
+               v-model="form"
+               :table-loading="loading"
+               :data="data"
+               :permission="permissionList"
+               :before-open="beforeOpen"
+               ref="crud"
+               @row-update="rowUpdate"
+               @row-save="rowSave"
+               @row-del="rowDel"
+               @search-change="searchChange"
+               @search-reset="searchReset"
+               @selection-change="selectionChange"
+               @current-change="currentChange"
+               @size-change="sizeChange"
+               @refresh-change="refreshChange"
+               @on-load="onLoad">
+      <template #menu-left>
+        <!-- <el-button type="danger"
+                   icon="el-icon-delete"
+                   plain
+                   v-if="permission.productRework_delete"
+                   @click="handleDelete">删 除
+        </el-button> -->
+        <el-button type="warning"
+                   plain
+                   icon="el-icon-download"
+                   @click="handleExport">导 出
+        </el-button>
+      </template>
+    </avue-crud>
+  </basic-container>
+</template>
+
+<script>
+  import {getList, getDetail, add, update, remove} from "@/api/productRework/productRework";
+  import option from "@/option/productRework/productReworkReport";
+  import {mapGetters} from "vuex";
+  import {exportBlob} from "@/api/common";
+  import {getToken} from '@/utils/auth';
+  import {downloadXls} from "@/utils/util";
+  import {dateNow} from "@/utils/date";
+  import NProgress from 'nprogress';
+  import 'nprogress/nprogress.css';
+
+  export default {
+    data() {
+      return {
+        form: {},
+        query: {},
+        search: {},
+        loading: true,
+        page: {
+          pageSize: 10,
+          currentPage: 1,
+          total: 0
+        },
+        selectionList: [],
+        option: option,
+        data: []
+      };
+    },
+    computed: {
+      ...mapGetters(["permission"]),
+      permissionList() {
+        return {
+          addBtn: this.validData(this.permission.productRework_add, false),
+          viewBtn: this.validData(this.permission.productRework_view, false),
+          delBtn: this.validData(this.permission.productRework_delete, false),
+          editBtn: this.validData(this.permission.productRework_edit, false)
+        };
+      },
+      ids() {
+        let ids = [];
+        this.selectionList.forEach(ele => {
+          ids.push(ele.id);
+        });
+        return ids.join(",");
+      }
+    },
+    methods: {
+      rowSave(row, done, loading) {
+        add(row).then(() => {
+          this.onLoad(this.page);
+          this.$message({
+            type: "success",
+            message: "操作成功!"
+          });
+          done();
+        }, error => {
+          loading();
+          window.console.log(error);
+        });
+      },
+      rowUpdate(row, index, done, loading) {
+        update(row).then(() => {
+          this.onLoad(this.page);
+          this.$message({
+            type: "success",
+            message: "操作成功!"
+          });
+          done();
+        }, error => {
+          loading();
+          console.log(error);
+        });
+      },
+      rowDel(row) {
+        this.$confirm("确定将选择数据删除?", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        })
+          .then(() => {
+            return remove(row.id);
+          })
+          .then(() => {
+            this.onLoad(this.page);
+            this.$message({
+              type: "success",
+              message: "操作成功!"
+            });
+          });
+      },
+      handleDelete() {
+        if (this.selectionList.length === 0) {
+          this.$message.warning("请选择至少一条数据");
+          return;
+        }
+        this.$confirm("确定将选择数据删除?", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        })
+          .then(() => {
+            return remove(this.ids);
+          })
+          .then(() => {
+            this.onLoad(this.page);
+            this.$message({
+              type: "success",
+              message: "操作成功!"
+            });
+            this.$refs.crud.toggleSelection();
+          });
+      },
+      handleExport() {
+        let downloadUrl = `/pl-productRework/productRework/export-productRework?${this.website.tokenHeader}=${getToken()}`;
+        const {
+            qrCode,
+            productName,
+            productModel,
+            createTime,
+            status,
+        } = this.query;
+        let values = {
+            qrCode_: qrCode,
+            status: status,
+        };
+        this.$confirm("是否导出数据?", "提示", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(() => {
+          NProgress.start();
+          exportBlob(downloadUrl, values).then(res => {
+            downloadXls(res.data, `产品返修表${dateNow()}.xlsx`);
+            NProgress.done();
+          })
+        });
+      },
+      beforeOpen(done, type) {
+        if (["edit", "view"].includes(type)) {
+          getDetail(this.form.id).then(res => {
+            this.form = res.data.data;
+          });
+        }
+        done();
+      },
+      searchReset() {
+        this.query = {};
+        this.onLoad(this.page);
+      },
+      searchChange(params, done) {
+        this.query = params;
+        this.page.currentPage = 1;
+        this.onLoad(this.page, params);
+        done();
+      },
+      selectionChange(list) {
+        this.selectionList = list;
+      },
+      selectionClear() {
+        this.selectionList = [];
+        this.$refs.crud.toggleSelection();
+      },
+      currentChange(currentPage){
+        this.page.currentPage = currentPage;
+      },
+      sizeChange(pageSize){
+        this.page.pageSize = pageSize;
+      },
+      refreshChange() {
+        this.onLoad(this.page, this.query);
+      },
+      onLoad(page, params = {}) {
+        this.loading = true;
+
+        const {
+          qrCode,
+          productName,
+          productModel,
+          createTime,
+          status,
+        } = this.query;
+
+        let values = {
+            qrCode_: qrCode,
+            status: status,
+        };
+
+        getList(page.currentPage, page.pageSize, values).then(res => {
+          const data = res.data.data;
+          this.page.total = data.total;
+          this.data = data.records;
+          this.loading = false;
+          this.selectionClear();
+        });
+      }
+    }
+  };
+</script>
+
+<style>
+</style>