Prechádzať zdrojové kódy

商品管理产品库数据分离

wenjie 7 mesiacov pred
rodič
commit
39b850ba73

+ 9 - 0
src/api/common.js

@@ -175,6 +175,15 @@ export function getCityList(params) {
   })
 }
 
+// 平台城市列表
+export function getChildRegionsList(params) {
+  return request({
+    url: '/productcenterserver/region/childRegionsList',
+    method: 'post',
+    params
+  })
+}
+
 // 新增修改城市
 export function putCity(data) {
   return request({

+ 29 - 2
src/views/operationManage/goodsManage/goodsDetail.vue

@@ -2,7 +2,7 @@
  * @Author: wj 1454560336@qq.com
  * @Date: 2023-11-24 14:39:54
  * @LastEditors: wenjie 1454560336@qq.com
- * @LastEditTime: 2024-07-30 16:52:31
+ * @LastEditTime: 2024-11-07 15:34:58
  * @FilePath: \admin-manage\src\views\operationManage\goodsManage\goodsDetail.vue
  * @Description: 
  * 
@@ -69,7 +69,23 @@
             </el-input>
           </el-form-item>
 
-          <el-form-item label="售价:" prop="realPrice">
+        <template v-if="setQuery.prePlatformType">
+          <el-form-item label="商品操作平台商品信息:">
+            <div class="platformType">{{filterMasterName(setQuery.prePlatformType)}}</div>
+          </el-form-item>
+           <el-form-item label="售价:" prop="platformPrice">
+            <el-input
+              type="number"
+              v-model="setQuery.platformPrice"
+              class="item-width-300"
+            >
+              <template slot="append">元</template>
+            </el-input>
+          </el-form-item>
+        </template>
+
+
+          <el-form-item label="售价:" v-else prop="realPrice">
             <el-input
               type="number"
               v-model="setQuery.realPrice"
@@ -804,6 +820,13 @@ export default Vue.extend({
         this.loading = false;
         if (res.state == "Success") {
           this.setQuery = res.content;
+          if(JSON.parse(this.setQuery.prices)){
+            JSON.parse(this.setQuery.prices).map(item=>{
+              if(item.platformType == this.setQuery.prePlatformType){
+                this.setQuery.platformPrice = item.price
+              }
+            })
+          }
           this.labelId = Number(res.content.goodsLabelId) || this.labelList[0].id
           this.setQuery.goodsCateId = Number(this.setQuery.goodsCateId);
             // 初始化购买设置
@@ -861,6 +884,10 @@ export default Vue.extend({
 @import "@/styles/element-variables";
 .addGoods {
   padding-bottom: 40px;
+  .platformType{
+    font-size: 14px;
+    color: #606266;
+  }
   .item {
     display: flex;
     align-items: center;

+ 14 - 1
src/views/operationManage/goodsManage/index.vue

@@ -98,6 +98,17 @@
         <span>{{scope.row.status|filterState}}</span>
        </template>
       </el-table-column>
+       <el-table-column
+          prop="accountChildType"
+          align="center"
+          label="操作平台"
+          fit
+        >
+       <template slot-scope="scope">
+            <div>{{filterMasterName(scope.row.prePlatformType)}}</div>
+          </template>
+        </el-table-column>
+
       <el-table-column
         prop="shopName"
         align="center"
@@ -106,6 +117,8 @@
       >
       </el-table-column>
 
+     
+
        <el-table-column
           prop="accountChildType"
           align="center"
@@ -270,7 +283,7 @@ export default {
         path:'/operationManage/goodsManage/goodsDetail',
         query:{
           id:row.goodsId,
-          mode
+          mode,
           // shopId:row.shopId
         }
       })

+ 29 - 4
src/views/operationManage/goodsManage/productLibrary.vue

@@ -10,7 +10,7 @@
           clearable
           class="item-width-200 "
         ></el-input>
-         <el-select v-model="platformType" size="small" filterable clearable class="item-width-200 ml10" placeholder="请选择平台">
+         <el-select v-model="query.parkId" size="small" filterable clearable class="item-width-200 ml10" placeholder="请选择平台">
               <el-option
                 v-for="item in platformTypeOptions"
                 :key="item.value"
@@ -18,7 +18,7 @@
                 :value="item.value">
               </el-option>
             </el-select>
-          <el-select v-model="query.regionCode" size="small" filterable clearable class="item-width-200 ml10" placeholder="请选择区域">
+          <el-select v-model="query.regionCode" size="small" no-data-text="无数据,先选择平台" filterable clearable class="item-width-200 ml10" placeholder="请选择区域">
               <el-option
                 v-for="item in cityOptions"
                 :key="item.value"
@@ -249,7 +249,7 @@
   
   <script>
 import { debounce } from "@/utils/index";
-import { getCityList } from "@/api/common";
+import { getCityList,getChildRegionsList } from "@/api/common";
 import { goodsStoreList,setHidden,listAllTypes,upsertProduct} from "@/api/goods";
 import guid from "@/utils/guid";
 import Upload from "@/components/Upload";
@@ -261,7 +261,6 @@ export default {
   },
   data() {
     return {
-      platformType:'',
       platformTypeOptions:[],
       title:'',
       tableData: [],
@@ -273,6 +272,7 @@ export default {
       btnLoading2: false,
       dialogFormVisible2: false,
       query: {
+        parkId:'',
         regionCode:'',
         productType:'',
         title:'',
@@ -376,6 +376,14 @@ export default {
 
     }
   },
+  watch: {
+    'query.parkId'(val) {
+      this.cityOptions = []
+      if(val){
+        this.getChildRegionsList(val)
+      }
+    }
+  },
   methods: {
     // 图片统一上传
     uploadEnd(val) {
@@ -515,6 +523,22 @@ export default {
       type:'Park',
         }).then((res) => {
         this.loading = false
+        if (res.state == "Success") {
+          this.platformTypeOptions = res.content.content.map(item => {
+            return {
+              value: item.code,
+              label: item.name
+              }
+            })
+        }
+      });
+    },
+    getChildRegionsList(parentId){
+      getChildRegionsList({
+      parentId,
+      page:0,
+      size:999
+      }).then((res) => {
         if (res.state == "Success") {
           this.cityOptions = res.content.content.map(item => {
             return {
@@ -574,6 +598,7 @@ export default {
     this.getList();
     this.listAllTypes()
     this.getCityList()
+    
   },
 };
 </script>