瀏覽代碼

供应商和客户添加启用和禁止功能
客户详情仓库选择可新增
供应商和客户详情样式图标统一

cyang233 2 年之前
父節點
當前提交
823e95b1d4

+ 2 - 2
src/api/tirePartsMall/basicData/commodityInformation/index.js

@@ -70,7 +70,7 @@ export const itemDel = (data) => {
 export const disabled = (data) => {
   return request({
     url: '/api/blade-sales-part/goodsDesc/updateEnableOrNot',
-    method: 'post',
-    data: data
+    method: 'get',
+    params: data
   })
 }

+ 8 - 0
src/api/tirePartsMall/basicData/customerInformation/index.js

@@ -79,3 +79,11 @@ export function corpsattn(data) {
     }
   })
 }
+//禁用启用
+export function editenable(data) {
+  return request({
+    url: '/api/blade-sales-part/corpsDesc/updateEnableOrNot',
+    method: 'get',
+    params: data
+  })
+}

+ 9 - 0
src/api/tirePartsMall/basicData/listingManagement/index.js

@@ -24,3 +24,12 @@ export function batchOperationProductLaunch(data) {
     data
   })
 }
+
+// 详情
+export const getDetail = (params) => {
+  return request({
+    url: '/api/blade-sales-part/productLaunch/detail',
+    method: 'get',
+    params: params
+  })
+}

+ 4 - 0
src/views/tirePartsMall/basicData/commodityInformation/detailsPage.vue

@@ -551,6 +551,10 @@ export default {
     },
     disabled(val) {
       disabled({ id: this.form.id, enableOrNot: val }).then(res => {
+        this.$message({
+            type: "success",
+            message: val?'禁用成功':'启用成功'
+          });
         this.getDetail(this.detailData.id);
       })
     },

+ 4 - 0
src/views/tirePartsMall/basicData/commodityInformation/js/optionList.js

@@ -42,6 +42,8 @@ export const option = {
     {
       label: "花纹",
       prop: "brandItem",
+      hide:true,
+      showColumn:false,
       search: true,
       overHidden: true,
     },
@@ -84,6 +86,8 @@ export const option = {
       label: "是否启用",
       prop: "enableOrNot",
       overHidden: true,
+      hide:true,
+      showColumn:false,
       type: 'select',
       dicData:[{
         label:'否',

+ 18 - 2
src/views/tirePartsMall/basicData/customerInformation/detailsPage.vue

@@ -11,6 +11,9 @@
           <el-button type="primary" size="small" @click="editCustomer">
             保存数据
           </el-button>
+          <el-button class="el-button--small-yh" type="primary" size="small" v-if="form.id" @click="editEnable">
+            {{ form.enableOrNot ? '禁用' : '启用' }}
+          </el-button>
         </div>
       </div>
       <trade-card title="基础资料" style="margin-top: 60px" v-loading="loadingBtn">
@@ -117,7 +120,8 @@ import {
   submit,
   customerList,
   itemDel,
-  corpsattn
+  corpsattn,
+  editenable
 } from "@/api/tirePartsMall/basicData/customerInformation"
 import corpType from '@/components/corpType/index'
 import { creatingUsersTwo } from "@/api/basicData/customerInformation";
@@ -560,6 +564,17 @@ export default {
     this.getCorpTypeCk()
   },
   methods: {
+    // 启用或禁用
+    editEnable() {
+      let data = this.form
+      editenable({ id: data.id, enableOrNot: data.enableOrNot ? 0 : 1 }).then(res => {
+        this.$message({
+          type: "success",
+          message: data.enableOrNot ? "禁用成功!" : "启用成功!"
+        });
+        this.$set(this.form, 'enableOrNot', data.enableOrNot == 1 ? 0 : 1)
+      })
+    },
     addressUnique(row, index) {
       for (let item in this.data) {
         if (index != item) {
@@ -754,7 +769,6 @@ export default {
     getCorpTypeCk() {
       customerListAll().then(res => {
         this.corpTypeListCk = res.data.data
-        console.log("!111", this.corpTypeListCk)
       })
     }
     ,
@@ -795,6 +809,7 @@ export default {
             this.form = res.data.data;
             this.data = res.data.data.corpsAddrList
             this.corpsFiles = res.data.data.corpsFilesList
+            this.getDetail(res.data.data.id);
           }).finally(() => {
             this.loadingBtn = false;
           });
@@ -838,6 +853,7 @@ export default {
 
 
     creatingUsers(row) {
+      console.log("row", row)
       if (row.id) {
         if (row.tel) {
           this.dialogVisibleBt = true;

+ 133 - 109
src/views/tirePartsMall/basicData/listingManagement/index.vue

@@ -4,68 +4,45 @@
       <el-row>
         <el-col :span="4">
           <avue-tree :option="treeOption" :data="treeData" @node-click="nodeClick" style="height:73vh;"
-                     @save="corpTypeVisible = true">
+            @save="corpTypeVisible = true">
             <template slot="addBtn">
               <i class="el-icon-setting" style="font-size:18px;line-height: 30px;width: 20px;padding: 0 10px;"
-                 @click="corpTypeVisible = true"></i>
+                @click="corpTypeVisible = true"></i>
             </template>
           </avue-tree>
         </el-col>
         <el-col :span="20">
-          <avue-crud
-              :option="option"
-              :search.sync="search"
-              v-model="form"
-              :table-loading="loading"
-              :data="dataList"
-              ref="crud"
-              :key="key"
-              @on-load="onLoad"
-              @selection-change="selectionChange"
-              :before-open="beforeOpen"
-              @row-update="rowUpdate"
-              @search-change="searchChange"
-              @refresh-change="refreshChange"
-              @resetColumn="resetColumnTwo('crud','option','optionList',273)"
-              @saveColumn="saveColumnTwo('crud','option','optionList',273)"
-              :page.sync="page">
+          <avue-crud :option="option" :search.sync="search" v-model="form" :table-loading="loading" :data="dataList"
+            ref="crud" :key="key" @on-load="onLoad" @selection-change="selectionChange" :before-open="beforeOpen"
+            @row-update="rowUpdate" @search-change="searchChange" @refresh-change="refreshChange"
+            @resetColumn="resetColumnTwo('crud', 'option', 'optionList', 273)"
+            @saveColumn="saveColumnTwo('crud', 'option', 'optionList', 273)" :page.sync="page">
+
             <template slot-scope="{type,size,row,index}" slot="menu">
-              <el-button icon="el-icon-edit" :size="size" :type="type" @click="$refs.crud.rowEdit(row,index)">编辑
+              <el-button icon="el-icon-edit" :size="size" :type="type" @click="getDetail(row)">编辑
+                <!-- @click="$refs.crud.rowEdit(row, index)" -->
               </el-button>
               <!--          <el-button icon="el-icon-view" :size="size" :type="type" @click="check(row)">-->
               <!--            {{ row.upperFrame == 0 ? '上架' : '下架' }}-->
               <!--          </el-button>-->
-              <el-tooltip :content="`${row.upAndDownShelves == 0?'上架':'下架'}`" placement="top">
-                <el-switch
-                    style="margin-left: 10px"
-                    v-model="row.upAndDownShelves"
-                    @change="check(row)"
-                    active-value="1"
-                    inactive-value="0">
+              <el-tooltip :content="`${row.upAndDownShelves == 0 ? '上架' : '下架'}`" placement="top">
+                <el-switch style="margin-left: 10px" v-model="row.upAndDownShelves" @change="check(row)" active-value="1"
+                  inactive-value="0">
                 </el-switch>
               </el-tooltip>
             </template>
 
             <template slot-scope="{type,size,row,$index}" slot="menuLeft">
-              <el-button class="el-icon-document-copy" :disabled="selectionList.length === 0" type="primary"
-                         size="small"
-                         @click="change(row,'up')">批量上架
+              <el-button class="el-icon-document-copy" :disabled="selectionList.length === 0" type="primary" size="small"
+                @click="change(row, 'up')">批量上架
               </el-button>
               <el-button class="el-icon-document-copy" :disabled="selectionList.length === 0" type="danger" size="small"
-                         @click="change(row,'down')">批量下架
+                @click="change(row, 'down')">批量下架
               </el-button>
-              <el-button class="el-icon-bottom" type="warning"
-                         size="small" @click="excelBox = true">
+              <el-button class="el-icon-bottom" type="warning" size="small" @click="excelBox = true">
                 导入
               </el-button>
             </template>
-            <template slot="photoForm">
-              <c-upload :data="[]" display deleteUrl="/api/blade-client/goodsfiles/delete" :enumerationValue="160" />
-            </template>
-            <template slot="detailForm">
-              <avue-ueditor v-model="form.detail"
-              v-bind="options"></avue-ueditor>
-            </template>
           </avue-crud>
         </el-col>
       </el-row>
@@ -82,26 +59,40 @@
         温馨提示 第一次导入时请先下载模板
       </p>
     </el-dialog>
+    <el-dialog title="编辑" :visible.sync="dialogVisible" append-to-body width="60%">
+      <avue-form v-if="dialogVisible" ref="formData" v-model="formData" :option="optionList"
+        @submit="confirmSynchronization">
+        <template slot="filesList">
+          <c-upload :data="formData.filesList" display deleteUrl="/api/blade-sales-part/productLaunch/update"
+            :enumerationValue="160" />
+        </template>
+        <template slot="detailsText">
+          <avue-ueditor v-model="formData.detailsText" :options="optionsUeditor"></avue-ueditor>
+        </template>
+      </avue-form>
+      <span slot="menuform" class="dialog-footer">
+        <el-button @click="dialogVisible = false">取 消</el-button>
+        <el-button type="primary" @click="confirmSynchronization">确 定</el-button>
+      </span>
+    </el-dialog>
   </div>
 </template>
 
 <script>
-import {getList, submit,batchOperationProductLaunch} from "@/api/tirePartsMall/basicData/listingManagement/index.js";
-import {getToken} from "@/util/auth";
+import { getList, submit, batchOperationProductLaunch, getDetail } from "@/api/tirePartsMall/basicData/listingManagement/index.js";
+import { getToken } from "@/util/auth";
 
 export default {
   name: "index",
   data() {
     return {
-      options: {
+      dialogVisible: false,
+      formData: false,
+      optionsUeditor: {
         //普通上传地址
+        // action:'https://avuejs.com/imgupload',
         action: "/api/blade-resource/oss/endpoint/put-file",
         headers: { "Blade-Auth": "Bearer " + getToken() },
-        propsHttp: {
-          home:'',
-          url:'url',
-          res: 'data'
-        },
         props: {
           res: "data",
           url: 'link'
@@ -143,7 +134,7 @@ export default {
           value: "value",
         }
       },
-      excelBox:false,
+      excelBox: false,
       corpTypeVisible: false,
       treeData: [],
       loading: false,
@@ -202,10 +193,6 @@ export default {
           prop: 'inventory',
           overHidden: true,
         }, {
-          label: '商城价格',
-          prop: 'salesPrice',
-          overHidden: true,
-        }, {
           label: '产品状态',
           prop: 'upAndDownShelves',
           filterable: true,
@@ -222,55 +209,56 @@ export default {
             label: "下架",
             value: 0
           }]
-        },    {
-      label: "售价1",
-      prop: "price1",
-      hide: true,
-      showColumn: false,
-      overHidden: true,
-    },
-    {
-      label: "售价2",
-      prop: "price2",
-      hide: true,
-      showColumn: false,
-      overHidden: true,
-    },
-    {
-      label: "售价3",
-      prop: "price3",
-      hide: true,
-      showColumn: false,
-      overHidden: true,
-    },
-    {
-      label: "售价4",
-      prop: "price4",
-      hide: true,
-      showColumn: false,
-      overHidden: true,
-    },
-    {
-      label: "共享公司",
-      prop: "company",
-      hide: true,
-      showColumn: false,
-      overHidden: true,
-    },
-    {
-      label: "详情附件",
-      prop: "photo",
-      hide: true,
-      showColumn: false,
-      overHidden: true,
-      span:24,
-    },{
-      label: "商品详情",
-      prop: "deail",
-      hide: true,
-      showColumn: false,
-      overHidden: true,
-    }]
+        }, {
+          label: "售价1",
+          prop: "priceOne",
+          hide: true,
+          showColumn: false,
+          overHidden: true,
+        },
+        {
+          label: "售价2",
+          prop: "priceTwo",
+          hide: true,
+          showColumn: false,
+          overHidden: true,
+        },
+        {
+          label: "售价3",
+          prop: "priceThree",
+          hide: true,
+          showColumn: false,
+          overHidden: true,
+        },
+        {
+          label: "售价4",
+          prop: "priceFour",
+          hide: true,
+          showColumn: false,
+          overHidden: true,
+        },
+        {
+          label: "共享公司",
+          prop: "sharedCompany",
+          hide: true,
+          showColumn: false,
+          overHidden: true,
+        },
+        {
+          label: "详情附件",
+          prop: "filesList",
+          hide: true,
+          showColumn: false,
+          overHidden: true,
+          span: 24,
+        }, {
+          label: "商品详情",
+          prop: "detailsText",
+          hide: true,
+          span: 24,
+          showColumn: false,
+          overHidden: true,
+        }]
       }
     }
   },
@@ -293,8 +281,8 @@ export default {
   methods: {
     derivation() {
       window.open(
-          `/api/blade-sales-part/productLaunch/export-productLaunch?${this.website.tokenHeader
-          }=${getToken()}`
+        `/api/blade-sales-part/productLaunch/export-productLaunch?${this.website.tokenHeader
+        }=${getToken()}`
       );
     },
     uploadAfter(res, done, loading, column) {
@@ -333,6 +321,43 @@ export default {
         loading()
       })
     },
+    // 获取详情
+    getDetail(row) {
+      getDetail({ id: row.id }).then(res => {
+        console.log("res", res.data.data)
+        this.formData = JSON.parse(JSON.stringify(res.data.data));
+        this.dialogVisible = true
+        console.log("Res", this.form)
+      })
+    },
+    // 编辑确定
+    confirmSynchronization(form, done, loading) {
+      console.log("formdata", this.formData, this.formData.filesList[0].$version)
+      if (this.formData.filesList.length > 0) {
+        let flag = this.formData.filesList.some(item => { return item.$version == '主图' })
+        console.log("flag", flag)
+        if (!flag) {
+          this.$message.warning('请选择主图')
+          done()
+          return
+        }
+        console.log(1)
+      }
+      console.log(2)
+      submit({
+        ...this.formData
+      }).then(res => {
+        this.onLoad(this.page, this.search)
+        this.dialogVisible = false;
+        // this.$message({
+
+        // })
+        done()
+      }).catch((err) => {
+        loading()
+        console.log("Eee", err)
+      })
+    },
     check(row) {
       // if (row.flag == 0) {
       //   if (!Number(row.salesPrice)) return this.$message.error("上架失败,商城价格不能为0")
@@ -387,7 +412,7 @@ export default {
         current: page.currentPage,
         size: page.pageSize,
         ...Object.assign(params, this.search),
-        billType:0
+        billType: 0
       }
       this.loading = true
       getList(params).then(res => {
@@ -401,7 +426,7 @@ export default {
         this.loading = false
       })
     },
-//自定义列保存
+    //自定义列保存
     async saveColumnTwo(ref, option, optionBack, code) {
       /**
        * 已定义全局方法,直接使用,saveColumnData保存列数据方法,参数传值(表格名称,当前表格的option数据)
@@ -418,7 +443,7 @@ export default {
         this.$refs[ref].$refs.dialogColumn.columnBox = false;
       }
     },
-//自定义列重置
+    //自定义列重置
     async resetColumnTwo(ref, option, optionBack, code) {
       this[option] = this[optionBack];
       const inSave = await this.delColumnData(this.getColumnName(code), this[optionBack]);
@@ -434,5 +459,4 @@ export default {
 }
 </script>
 
-<style scoped>
-</style>
+<style scoped></style>

+ 17 - 4
src/views/tirePartsMall/basicData/supplier/detailsPage.vue

@@ -12,7 +12,9 @@
         <!--        </el-button>-->
         <el-button class="el-button--small-yh" type="primary" size="small" @click="editCustomer">保存数据
         </el-button>
-        <el-button class="el-button--small-yh" type="primary" size="small" v-if="form.id">启用
+
+        <el-button class="el-button--small-yh" type="primary" size="small" v-if="form.id" @click="editEnable">
+          {{ form.enableOrNot ? '禁用' : '启用' }}
         </el-button>
       </div>
     </div>
@@ -71,8 +73,8 @@
           deleteUrl="/api/blade-box-tube/shippingfile/remove" :enumerationValue="262.3" display />
       </trade-card>
     </div>
-    <el-dialog title="设置供应商分类" append-to-body v-dialog-drag :visible.sync="corpTypeVisible" class="avue-dialog" width="80%"
-      @closed="corpTypeClosed">
+    <el-dialog title="设置供应商分类" append-to-body v-dialog-drag :visible.sync="corpTypeVisible" class="avue-dialog"
+      width="80%" @closed="corpTypeClosed">
       <span>
         <corp-type corpType="GYS"></corp-type>
         <!-- <avue-form :key="reload" ref="corpType" v-model="form4" :option="option4" style="margin-top:20px">
@@ -89,7 +91,7 @@
 <script>
 
 // import {detail, submit} from "@/api/basicData/shipManagement";
-import { getDetails, submit } from "@/api/tirePartsMall/basicData/customerInformation";
+import { getDetails, submit, editenable } from "@/api/tirePartsMall/basicData/customerInformation";
 import { getCorpType } from "@/api/tirePartsMall/basicData/customerInformation"
 import corpType from '@/components/corpType/index'
 export default {
@@ -252,6 +254,17 @@ export default {
     this.getCorpType()
   },
   methods: {
+    // 启用或禁用
+    editEnable() {
+      let data = this.form
+      editenable({ id: data.id, enableOrNot: data.enableOrNot ? 0 : 1 }).then(res => {
+        this.$message({
+          type: "success",
+          message: data.enableOrNot ? "禁用成功!" : "启用成功!"
+        });
+        this.$set(this.form, 'enableOrNot', data.enableOrNot == 1 ? 0 : 1)
+      })
+    },
     refresh(id, type) {
       const loading = this.$loading({
         lock: true,

+ 12 - 5
src/views/tirePartsMall/basicData/supplier/index.vue

@@ -21,10 +21,10 @@
               <el-button icon="el-icon-delete" :size="size" :type="type"
                 @click="$refs.crud.rowDel(row, index)">删除</el-button>
             </template>
-            <template slot="enableOrNot" slot-scope="{row,index,disabled}">
+            <!-- <template slot="enableOrNot" slot-scope="{row,index,disabled}">
               <el-switch active-value="1" inactive-value="0" :disabled="disabled" v-model="row.enableOrNot">
               </el-switch>
-            </template>
+            </template> -->
             <template slot="corpNameSearch">
               <crop-select v-model="search.corpId" corpType="KH" :refresh="false"></crop-select>
             </template>
@@ -193,7 +193,14 @@ export default {
           overHidden: true,
         }, {
           label: '是否启用',
-          prop: 'enableOrNot'
+          prop: 'enableOrNot',
+          dicData: [{
+            label: '否',
+            value: 0
+          }, {
+            label: '是',
+            value: 1
+          }]
         }]
       }
     }
@@ -214,7 +221,7 @@ export default {
       this.option.searchMenuPosition = "right";
     }
   },
- 
+
   methods: {
     addCorpType() {
       // this.$refs["corpType"].validate((valid, done) => {
@@ -281,7 +288,7 @@ export default {
         cancelButtonText: '取消',
         type: 'warning'
       }).then(() => {
-        remove({id:form.id}).then(res => {
+        remove({ id: form.id }).then(res => {
           this.$message({
             type: 'success',
             message: '删除成功!'

+ 34 - 34
src/views/tirePartsMall/basicData/warehouse/index.vue

@@ -1,23 +1,11 @@
 <template>
   <basic-container class="page-crad">
-    <avue-crud
-        :option="option"
-        :data="dataList"
-        ref="crud"
-        v-model="form"
-        :page.sync="page"
-        @row-del="rowDel"
-        @row-update="rowUpdate"
-        :before-open="beforeOpen"
-        :before-close="beforeClose"
-        @row-save="rowSave"
-        @search-change="searchChange"
-        @search-reset="searchReset"
-        @on-load="onLoad"
-        @resetColumn="resetColumnTwo('crud','option','optionBack', 264)"
-        @saveColumn="saveColumnTwo('crud','option','optionBack', 264)"
-        @search-criteria-switch="searchCriteriaSwitch"
-        @tree-load="treeLoad">
+    <avue-crud :option="option" :data="dataList" ref="crud" v-model="form" :page.sync="page" @row-del="rowDel"
+      @row-update="rowUpdate" :before-open="beforeOpen" :before-close="beforeClose" @row-save="rowSave"
+      @search-change="searchChange" @search-reset="searchReset" @on-load="onLoad"
+      @resetColumn="resetColumnTwo('crud', 'option', 'optionBack', 264)"
+      @saveColumn="saveColumnTwo('crud', 'option', 'optionBack', 264)" @search-criteria-switch="searchCriteriaSwitch"
+      @tree-load="treeLoad">
     </avue-crud>
   </basic-container>
 </template>
@@ -60,7 +48,7 @@ export default {
           prop: "code",
           search: true,
           overHidden: true,
-          width: 120,
+          // width: 120,
           rules: [
             {
               required: true,
@@ -73,7 +61,7 @@ export default {
           prop: "cname",
           search: true,
           overHidden: true,
-          width: 120,
+          // width: 120,
           rules: [
             {
               required: true,
@@ -86,7 +74,7 @@ export default {
           prop: "contacts",
           search: true,
           overHidden: true,
-          width: 120,
+          // width: 120,
           rules: [
             {
               required: true,
@@ -99,7 +87,7 @@ export default {
           prop: "tel",
           search: true,
           overHidden: true,
-          width: 120,
+          // width: 120,
           rules: [
             {
               required: true,
@@ -112,14 +100,14 @@ export default {
           prop: "chargeOrNot",
           search: true,
           overHidden: true,
-          width: 120,
+          // width: 120,
           type: "select",
           dicData: [{
             label: "是",
-            value: "0"
+            value: 0
           }, {
             label: "否",
-            value: "1"
+            value: 1
           }],
           rules: [
             {
@@ -133,7 +121,7 @@ export default {
           prop: "storageCapacity",
           search: true,
           overHidden: true,
-          width: 120,
+          // width: 120,
           rules: [
             {
               required: true,
@@ -143,10 +131,16 @@ export default {
           ]
         }, {
           label: "所属公司",
-          prop: "artsVisionId",
+          prop: "salesCompanyId",
           search: true,
           overHidden: true,
-          width: 120,
+          // width: 120,
+          type: 'select',
+          dicUrl: "/api/blade-sales-part/storageDesc/listAll",
+          props: {
+            label: 'cname',
+            value: 'id'
+          },
           rules: [
             {
               required: true,
@@ -159,7 +153,13 @@ export default {
           prop: "sharedCompany",
           search: true,
           overHidden: true,
-          width: 120,
+          // width: 120,
+          type: 'select',
+          props: {
+            label: 'cname',
+            value: 'id'
+          },
+          dicUrl: '/api/blade-sales-part/storageDesc/listAll',
           rules: [
             {
               required: true,
@@ -174,7 +174,7 @@ export default {
           minRows: 3,
           span: 24,
           overHidden: true,
-          width: 200
+          // width: 200
         }]
       },
       parentId: 0,
@@ -267,7 +267,7 @@ export default {
       if (["add", "edit"].includes(type)) {
         this.option.column.forEach(e => {
           if (e.prop == "storageTypeId") {
-            this.$set(this.option.column, 3, {...e, value: this.treeDeptId});
+            this.$set(this.option.column, 3, { ...e, value: this.treeDeptId });
           }
         });
       }
@@ -297,7 +297,7 @@ export default {
       this.treeDeptId = "";
       this.onLoad(this.page);
     },
-    onLoad(page, params = {parentId: 0}) {
+    onLoad(page, params = { parentId: 0 }) {
       let queryParams = Object.assign({}, params, {
         size: page.pageSize,
         current: page.currentPage,
@@ -316,7 +316,7 @@ export default {
     //树桩列点击展开触发
     treeLoad(tree, treeNode, resolve) {
       const parentId = tree.id;
-      customerList({parentId: parentId}).then(res => {
+      customerList({ parentId: parentId }).then(res => {
         resolve(res.data.data.records);
       });
     },
@@ -349,6 +349,6 @@ export default {
 
 <style scoped>
 .page-crad ::v-deep .basic-container__card {
-    height: 94.8vh;
+  height: 94.8vh;
 }
 </style>