Browse Source

修改仓库管理 理赔

Qukatie 3 weeks ago
parent
commit
4ff8786cf8

+ 12 - 12
src/api/goodsManage/index.js

@@ -17,12 +17,12 @@ export const getList = (current, size, params) => {
     })
 }
 // 查询商品分类
-export function getGoodsTypeTree(data){
-  return request({
-    url:'/api/gubersail-admin/goodsType/tree',
-    method:'get',
-    params:data
-  })
+export function getGoodsTypeTree(data) {
+    return request({
+        url: '/api/gubersail-admin/goodsType/tree',
+        method: 'get',
+        params: data
+    })
 }
 
 /**
@@ -76,18 +76,18 @@ export const submitApprova = (data) => {
 export const revokeApproval = (data) => {
     return request({
         url: '/api/gubersail-admin/stockDesc/revokeGoodsStock',
-         method: 'post',
+        method: 'post',
         data: data
     })
 
 }/**
  * 商品管理 禁用/启用
- * @param {any} params
+ * @param {any} data
  */
-export const disabledStock = (params) => {
+export const disabledStock = (data) => {
     return request({
-        url: '/api/gubersail-admin/stockDesc/disabledGoodsStock ',
-        method: 'get',
-        params: params
+        url: '/api/gubersail-admin/stockDesc/disabledGoodsStock',
+        method: 'post',
+        data: data
     })
 }

+ 10 - 7
src/api/warehouse/index.js

@@ -8,13 +8,16 @@ export function customerListAll(data) {
     params: data
   })
 }
-//仓库列表查询
-export function getList(data) {
-  return request({
-    url: '/api/gubersail-admin/storageDesc/list',
-    method: 'get',
-    params: data
-  })
+export const getList = (current, size, params) => {
+    return request({
+       url: '/api/gubersail-admin/storageDesc/list',
+        method: 'get',
+        params: {
+            ...params,
+            current,
+            size,
+        }
+    })
 }
 export const getDeptLazyTree = (parentId) => {
   return request({

+ 45 - 4
src/components/uploadFile/index.vue

@@ -9,6 +9,24 @@
           <!-- <el-button type="success" size="mini" :disabled="disabled" @click.stop="submit">一键保存</el-button> -->
         </div>
       </template>
+      <template slot="fileUrl" slot-scope="{ row, index }">
+        <el-upload
+          v-if="row.$cellEdit"
+          :headers="headers"
+          action="/api/blade-resource/oss/endpoint/put-file"
+          :on-success="rowonSuccess"
+          :on-error="onError"
+        >
+          <el-input placeholder="请选择上传文件" v-model="row.fileUrl" readonly size="small" @click.stop="rowIndex(row,index)"></el-input>
+        </el-upload>
+        <span v-else>
+          {{ row.fileUrl }}
+        </span>
+      </template>
+      <template slot="menu" slot-scope="{ row, index }">
+        <el-button size="small" icon="el-icon-edit" type="text" @click="rowEdit(row)">{{ row.$cellEdit ? "保存" : "编辑" }}</el-button>
+        <el-button size="small" icon="el-icon-delete" type="text" @click="rowDel(row, index)" :disabled="row.auditStatus > 0">删 除 </el-button>
+      </template>
     </avue-crud>
   </div>
 </template>
@@ -36,22 +54,25 @@ export default {
         refreshBtn: false,
         selection: true,
         align: "center",
-        menu: false,
+        menu: true,
         columnBtn: false,
         column: [
           {
             label: "原始文件名",
             prop: "fileName",
+            cell: true,
             overHidden: true
           },
           {
             label: "文件地址",
             prop: "fileUrl",
+            // cell: true,
             overHidden: true
           },
           {
             label: "文件类型",
             prop: "fileType",
+            // cell: true,
             overHidden: true
           },
           {
@@ -116,6 +137,18 @@ export default {
      * @param {{ id: any; }} row
      * @param {any} index
      */
+    rowEdit(row, index) {
+      // @ts-ignore
+      if (row.$cellEdit == true) {
+        this.$set(row, "$cellEdit", false);
+      } else {
+        this.$set(row, "$cellEdit", true);
+      }
+    },
+    /**
+     * @param {{ id: any; }} row
+     * @param {any} index
+     */
     rowDel(row, index) {
       this.$confirm("确定将选择数据删除?", {
         confirmButtonText: "确定",
@@ -150,9 +183,14 @@ export default {
         pid: this.pId ? this.pId : null,
         fileName: res.data.originalName,
         fileUrl: res.data[this.linkKey],
-        fileType: this.getFileExtension(res.data.originalName)
+        fileType: this.getFileExtension(res.data.originalName),
+        $cellEdit: true
       });
     },
+    rowonSuccess(res, file, fileList) {},
+    rowIndex(row,index){
+      console.log(row,index)
+    },
     /**
      * @param {any} err
      * @param {any} file
@@ -167,8 +205,8 @@ export default {
 </script>
 
 <style lang="scss" scoped>
-::v-deep .el-table .cell {
-  padding: 0 2px !important;
+::v-deep .avue-crud .el-table .cell {
+  padding: 0 2px 0 0 !important;
   .el-form-item {
     margin-bottom: 0px !important;
   }
@@ -185,4 +223,7 @@ export default {
 ::v-deep .el-upload-list {
   display: none;
 }
+::v-deep .el-upload {
+  width: 100%;
+}
 </style>

+ 26 - 0
src/views/goodsManage/detailsPage.vue

@@ -29,6 +29,9 @@
           @click="allClick('撤销')"
           >撤销
         </el-button>
+        <el-button v-if="form.id" class="el-button--small-yh" style="margin-left: 6px;" size="small" @click="disabledStock"
+          >{{ form.upAndDownShelves == 1 ? "启用" : "禁用" }}
+        </el-button>
       </div>
     </div>
     <div style="margin-top: 50px">
@@ -318,6 +321,29 @@ export default {
     upDate(data) {
       this.form.claimAttachmentList = data;
     },
+    disabledStock() {
+      let obj = {};
+      obj = {
+        id: this.form.id,
+        version:this.form.version,
+        upAndDownShelves: this.form.upAndDownShelves == 1 ? 0 : 1
+      };
+      // const jsonData = JSON.stringify(obj);
+      const loading = this.$loading({
+        lock: true,
+        text: "加载中",
+        spinner: "el-icon-loading",
+        background: "rgba(255,255,255,0.7)"
+      });
+      disabledStock(obj)
+        .then(res => {
+          this.$message.success("操作成功");
+          this.getDetail(this.form.id);
+        })
+        .finally(() => {
+          loading.close();
+        });
+    },
     submit() {
       // @ts-ignore
       this.$refs.form.validate((valid, done) => {

+ 18 - 19
src/views/warehouse/index.vue

@@ -6,6 +6,7 @@
       ref="crud"
       v-model="form"
       :table-loading="loading"
+      :search.sync="query"
       :page.sync="page"
       @row-del="rowDel"
       @row-update="rowUpdate"
@@ -15,7 +16,6 @@
       @search-change="searchChange"
       @search-reset="searchReset"
       @on-load="onLoad"
-      @search-criteria-switch="searchCriteriaSwitch"
       @tree-load="treeLoad"
     >
       <template slot-scope="{ type, size, row, $index }" slot="menuLeft">
@@ -32,11 +32,12 @@ export default {
   name: "customerInformation",
   data() {
     return {
+      query: {},
+      loading: false,
       form: {
         positioner: []
       },
       option: {
-        loading: false,
         addBtn: false,
         headerAlign: "center",
         align: "center",
@@ -250,7 +251,7 @@ export default {
     //点击搜索按钮触发
     searchChange(params, done) {
       this.page.currentPage = 1;
-      this.onLoad(this.page, params);
+      this.onLoad(this.page, this.query);
       done();
     },
     searchReset() {
@@ -258,33 +259,31 @@ export default {
       this.treeDeptId = "";
       this.onLoad(this.page);
     },
-    onLoad(page, params = { parentId: 0 }) {
-      let queryParams = Object.assign({}, params, {
-        size: page.pageSize,
-        current: page.currentPage,
-        parentId: 0,
-        storageTypeId: this.treeDeptId
-      });
+    onLoad(page, params = {}) {
+      let obj = {};
+      obj = {
+        ...Object.assign(params, this.query)
+      };
       this.loading = true;
-      getList(queryParams)
+      getList(page.currentPage, page.pageSize, obj)
         .then(res => {
           this.dataList = res.data.data.records;
           this.page.total = res.data.data.total;
+          this.$nextTick(() => {
+            this.$refs.crud.doLayout();
+            // this.$refs.crud.dicInit();
+          });
         })
         .finally(() => {
           this.loading = false;
         });
     },
-    searchCriteriaSwitch(type) {
-      // this.$refs.crud.doLayout();
-      // this.$refs.crud.getTableHeight();
-    },
     //树桩列点击展开触发
     treeLoad(tree, treeNode, resolve) {
       const parentId = tree.id;
-      getList({ parentId: parentId }).then(res => {
-        resolve(res.data.data.records);
-      });
+      // getList({ parentId: parentId }).then(res => {
+      //   resolve(res.data.data.records);
+      // });
     }
   }
 };
@@ -295,7 +294,7 @@ export default {
   height: 94.8vh;
 }
 ::v-deep .el-table .cell {
-  padding-right: 0px !important;
+  padding-right: 2px !important;
 }
 ::v-deep .avue-crud .el-table .el-button.el-button--small {
   padding: 0px !important;