Selaa lähdekoodia

提交轮胎商城

caojunjie 2 vuotta sitten
vanhempi
commit
e41042f564

+ 13 - 3
src/api/tirePartsMall/basicData/customerInformation/index.js

@@ -62,10 +62,20 @@ export function customerList(data) {
 }
 export const itemDel = (data) => {
   return request({
-    url: '/api/blade-sales-part/corpsAddr/remove',
+    url: '/api/blade-sales-part/corpsAddr/update',
     method: 'POST',
-    params: {
-      ids:data
+    data: {
+      id:data
+    }
+  })
+}
+//客户联系人列表删除
+export function corpsattn(data) {
+  return request({
+    url: '/api/blade-sales-part/corpsAttn/update',
+    method: 'post',
+    data: {
+      id: data
     }
   })
 }

+ 12 - 12
src/views/tirePartsMall/basicData/customerInformation/components/index.vue

@@ -125,17 +125,17 @@ export default {
     },
     //查询全部
     initData() {
-      customerList({corpType: customerParameter.code}).then(res => {
-        const column = this.findObject(this.option.column, "parentId");
-        column.dicData = res.data.data.records;
-      });
+      // customerList({corpType: customerParameter.code}).then(res => {
+      //   const column = this.findObject(this.option.column, "parentId");
+      //   column.dicData = res.data.data.records;
+      // });
     },
     //新增子项触发
     handleAdd(row) {
-      this.parentId = row.id;
-      const column = this.findObject(this.option.column, "parentId");
-      column.value = row.id;
-      column.addDisabled = true;
+      // this.parentId = row.id;
+      // const column = this.findObject(this.option.column, "parentId");
+      // column.value = row.id;
+      // column.addDisabled = true;
       this.$refs.crud.rowAdd();
     },
     //新增子项和新增触发查询所有
@@ -152,10 +152,10 @@ export default {
     },
     //点击新增时触发
     beforeClose(done) {
-      this.parentId = "";
-      const column = this.findObject(this.option.column, "parentId");
-      column.value = "";
-      column.addDisabled = false;
+      // this.parentId = "";
+      // const column = this.findObject(this.option.column, "parentId");
+      // column.value = "";
+      // column.addDisabled = false;
       done();
     },
     //点击搜索按钮触发

+ 45 - 20
src/views/tirePartsMall/basicData/customerInformation/detailsPage.vue

@@ -37,11 +37,11 @@
             @row-save="rowSave"
             @row-update="rowUpdate"
             @row-del="rowDelTwo">
-          <template slot-scope="{ type, size, row, disabled}" slot="menu">
+          <template slot-scope="{ type, size, row, disabled,index}" slot="menu">
             <el-button
                 :size="size" :disabled="disabled" :type="type"
                 :icon="row.$cellEdit?'el-icon-plus':'el-icon-edit'"
-                @click="$refs.crudTwo.rowCell(row,index)"
+                @click="$refs.crudTwo.rowEdit(row,index)"
             >{{ row.$cellEdit ? '确认' : '修改' }}
             </el-button>
             <el-button icon="el-icon-delete" :size="size" :disabled="disabled" :type="type"
@@ -65,7 +65,7 @@
             <el-button
                 :size="size" :disabled="disabled" :type="type"
                 :icon="row.$cellEdit?'el-icon-plus':'el-icon-edit'"
-                @click="$refs.crud.rowCell(row,index)"
+                @click="$refs.crud.rowEdit(row,index)"
             >{{ row.$cellEdit ? '确认' : '修改' }}
             </el-button>
             <el-button icon="el-icon-delete" :size="size" :disabled="disabled" :type="type"
@@ -115,9 +115,16 @@
 <script>
 import {option2, option3} from "./js/optionList";
 // import {getDetails, addCorpType, getCorpType, submit, customerList, itemDel} from "@/api/basicData/client";
-import {getDetails, getCorpType, submit, customerList, itemDel} from "@/api/tirePartsMall/basicData/customerInformation"
+import {
+  getDetails,
+  getCorpType,
+  submit,
+  customerList,
+  itemDel,
+  corpsattn
+} from "@/api/tirePartsMall/basicData/customerInformation"
 import corpType from '@/components/corpType/index'
-import {corpsattn, creatingUsersTwo} from "@/api/basicData/customerInformation";
+import {creatingUsersTwo} from "@/api/basicData/customerInformation";
 import {getRoleTree} from "@/api/system/role";
 import {getDeptTree} from "@/api/system/dept";
 import {getPostList} from "@/api/system/post";
@@ -351,10 +358,10 @@ export default {
         addBtnText: "录入明细",
         refreshBtn: false,
         dialogDrag: true,
-        addBtn: false,
+        addBtn: true,
         span: 8,
         height: 600,
-        addRowBtn: true,
+        addRowBtn: false,
         editBtn: false,
         delBtn: false,
         menuWidth: 200,
@@ -363,11 +370,25 @@ export default {
         column: [{
           label: '联系人',
           prop: 'cname',
-          cell: true
+          cell: true,
+          rules: [
+            {
+              required: true,
+              message: " ",
+              trigger: "blur"
+            }
+          ]
         }, {
           label: '电话',
           prop: 'tel',
-          cell: true
+          cell: true,
+          rules: [
+            {
+              required: true,
+              message: " ",
+              trigger: "blur"
+            }
+          ]
         }, {
           label: '备注',
           prop: 'remarks',
@@ -378,14 +399,12 @@ export default {
   },
   components: {
     corpType
-  }
-  ,
+  },
   props: {
     detailData: {
       type: Object
     }
-  }
-  ,
+  },
   async created() {
     this.customerContact = await this.getColumnData(
       this.getColumnName(263.1),
@@ -406,9 +425,18 @@ export default {
     }
     this.getCorpType()
     this.getAllWorkDicts()
-  }
-  ,
+  },
   methods: {
+    addressUnique(row, index) {
+      for (let item in this.data) {
+        if (index != item) {
+          if (this.data[item].defaultAddres == 1) {
+            this.$message.warning("默认地址只能唯一")
+            return row.defaultAddres = 0
+          }
+        }
+      }
+    },
     initData(tenantId) {
       getRoleTree(tenantId).then(res => {
         const column = this.findObject(this.optionData.column, "roleId");
@@ -422,8 +450,7 @@ export default {
         const column = this.findObject(this.optionData.column, "postId");
         column.dicData = res.data.data;
       });
-    }
-    ,
+    },
     //确认创建用户
     confirmSynchronizationTwo() {
       this.$refs["formDataTwo"].validate((valid, done) => {
@@ -668,9 +695,7 @@ export default {
     ,
     //新增客户联系人保存触发
     rowSave(row, done, loading) {
-      console.log(row, done, loading);
-      this.contactsData.push(row);
-      done();
+      done(row);
     }
     ,
     //修改客户联系人触发

+ 18 - 3
src/views/tirePartsMall/basicData/customerInformation/js/optionList.js

@@ -141,10 +141,10 @@ export const option2 = {
   addBtnText: "录入明细",
   refreshBtn: false,
   dialogDrag: true,
-  addBtn: false,
+  addBtn: true,
   span: 8,
   height: 600,
-  addRowBtn: true,
+  addRowBtn: false,
   editBtn: false,
   delBtn: false,
   menuWidth: 140,
@@ -160,12 +160,26 @@ export const option2 = {
       label: 'name',
       value: 'name'
     },
+    rules: [
+      {
+        required: true,
+        message: " ",
+        trigger: "blur"
+      }
+    ],
     filterable: true,
     cell: true
   },{
     label: '详细地址',
     prop: 'detailedAddress',
-    cell: true
+    cell: true,
+    rules: [
+      {
+        required: true,
+        message: " ",
+        trigger: "blur"
+      }
+    ]
   },{
     label: '备注',
     prop: 'remarks',
@@ -173,6 +187,7 @@ export const option2 = {
   },{
     label: '默认地址',
     prop: 'defaultAddres',
+    display:false,
     width:100,
   }]
 }

+ 1 - 1
src/views/tirePartsMall/basicData/listingManagement/index.vue

@@ -29,7 +29,7 @@
               @resetColumn="resetColumnTwo('crud','option','optionList',273)"
               @saveColumn="saveColumnTwo('crud','option','optionList',273)"
               :page.sync="page">
-            <template slot-scope="{type,size,row,$index}" slot="menu">
+            <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>
               <!--          <el-button icon="el-icon-view" :size="size" :type="type" @click="check(row)">-->

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

@@ -128,17 +128,17 @@ export default {
     },
     //查询全部
     initData() {
-      customerList({corpType: this.corpType?this.corpType:customerParameter.code}).then(res => {
-        const column = this.findObject(this.option.column, "parentId");
-        column.dicData = res.data.data.records;
-      });
+      // customerList({corpType: this.corpType?this.corpType:customerParameter.code}).then(res => {
+      //   const column = this.findObject(this.option.column, "parentId");
+      //   column.dicData = res.data.data.records;
+      // });
     },
     //新增子项触发
     handleAdd(row) {
-      this.parentId = row.id;
-      const column = this.findObject(this.option.column, "parentId");
-      column.value = row.id;
-      column.addDisabled = true;
+      // this.parentId = row.id;
+      // const column = this.findObject(this.option.column, "parentId");
+      // column.value = row.id;
+      // column.addDisabled = true;
       this.$refs.crud.rowAdd();
     },
     //新增子项和新增触发查询所有
@@ -155,10 +155,10 @@ export default {
     },
     //点击新增时触发
     beforeClose(done) {
-      this.parentId = "";
-      const column = this.findObject(this.option.column, "parentId");
-      column.value = "";
-      column.addDisabled = false;
+      // this.parentId = "";
+      // const column = this.findObject(this.option.column, "parentId");
+      // column.value = "";
+      // column.addDisabled = false;
       done();
     },
     //点击搜索按钮触发

+ 1 - 1
vue.config.js

@@ -32,7 +32,7 @@ module.exports = {
       '/api': {
         //本地服务接口地址
         // target: 'http://192.168.3.64:1080',
-        target: 'http://192.168.0.101:1080',
+        target: 'http://192.168.8.113:1080',
         // 打包地址
         // target: 'http://121.37.83.47:10004',//服务器ip
         // target: 'http://trade.tubaosoft.com:10004',//服务器域名