纪新园 пре 1 година
родитељ
комит
26b4c0ed12

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

@@ -58,12 +58,13 @@ export function customerList(data) {
     params: data
   })
 }
+
 export const itemDel = (data) => {
   return request({
     url: '/api/blade-sales-part/corpsAddr/remove',
     method: 'POST',
     params: {
-      ids:data
+      ids: data
     }
   })
 }
@@ -80,4 +81,12 @@ export const getCorpTypes = () => {
     url: '/api/blade-sales-part/goodsType/tree?corpType=SP',
     method: 'get',
   })
-}
+}
+
+//同步商品信息
+export const synchronization = () => {
+  return request({
+    url: '/api/blade-sales-part/goodsDesc/synchronization',
+    method: 'get',
+  })
+}

+ 5 - 1
src/views/tirePartsMall/basicData/commodityInformation/detailsPage.vue

@@ -776,10 +776,14 @@ export default {
                     }
                     this.isWhether = false
                 }
-                if (this.form.enableOrNot == 1) {
+                if (this.form.enableOrNot == 0) {
                     for (let item of this.option.column) {
                         this.$set(item, 'disabled', false)
                     }
+                }else{
+                  for (let item of this.option.column) {
+                    this.$set(item, 'disabled', true)
+                  }
                 }
                 this.key++
             }).finally(() => {

+ 15 - 1
src/views/tirePartsMall/basicData/commodityInformation/index.vue

@@ -24,6 +24,8 @@
               </el-button>
               <el-button type="primary" size="mini" icon="el-icon-top" @click="outExport">导出
               </el-button>
+              <el-button type="primary" size="mini" icon="el-icon-top" @click="synchronization">同步商品信息
+              </el-button>
             </template>
             <template slot="enableOrNot" slot-scope="{row,index,disabled}">
               <div v-if="row.enableOrNot === 1">是</div>
@@ -100,7 +102,7 @@
 <script>
 import detailsPage from "./detailsPage";
 import { option } from "./js/optionList";
-import { getList, remove, getCorpType } from "@/api/tirePartsMall/basicData/commodityInformation";
+import { getList, remove, getCorpType,synchronization } from "@/api/tirePartsMall/basicData/commodityInformation";
 import { getToken } from "@/util/auth";
 // import goodsType from '@/components/goodsType/index'
 import corpType from './components/index'
@@ -268,6 +270,18 @@ export default {
       })
       window.open(routeData.href.slice(1, routeData.href.length) + '&' + `${this.website.tokenHeader}=${getToken()}`);
     },
+    synchronization() {
+      this.loading = true;
+      synchronization().then(res => {
+        this.$nextTick(() => {
+          this.$refs.crud.doLayout();
+          this.$refs.crud.dicInit();
+        });
+        this.$message.success(res.data.msg);
+      }).finally(() => {
+        this.loading = false;
+      });
+    },
     uploadAfter(res, done, loading, column) {
       this.excelBox = false;
       this.refreshChange();