Jelajahi Sumber

批量改价格

shish 2 tahun lalu
induk
melakukan
9dc4d3a06a

+ 1 - 0
ghs/src/mock/userInfo.js

@@ -160,6 +160,7 @@ let menu = {
 		{id: '1420',parentId: 1400,name: '改价入库',type: 1,icon: 'icondingdanguanli',orderNum: 3,router: '/in/change',viewPath: 'views/in/change.vue',keepAlive: 1},
 		{id: '1420',parentId: 1400,name: '改价入库',type: 1,icon: 'icondingdanguanli',orderNum: 3,router: '/in/change',viewPath: 'views/in/change.vue',keepAlive: 1},
 		{id: '4',parentId: null,name: '花材',type: 0,icon: 'iconshangpinguanli',orderNum: 4,router: '/item/list',viewPath: 'views/item/list.vue',keepAlive: 1},
 		{id: '4',parentId: null,name: '花材',type: 0,icon: 'iconshangpinguanli',orderNum: 4,router: '/item/list',viewPath: 'views/item/list.vue',keepAlive: 1},
 		{id: '405',	parentId: '4',name: '花材列表',type: 1,icon: 'icon-user',orderNum: 4,router: '/item/list',viewPath: 'views/item/list.vue',keepAlive: 1},
 		{id: '405',	parentId: '4',name: '花材列表',type: 1,icon: 'icon-user',orderNum: 4,router: '/item/list',viewPath: 'views/item/list.vue',keepAlive: 1},
+		{id: '403',	parentId: '4',name: '批量改价',type: 1,icon: 'icon-user',orderNum: 4,router: '/item/batch-modify',viewPath: 'views/item/batch-modify.vue',keepAlive: 1},
 		{id: '401',parentId: '4',name: '花材分类',type: 1,icon: 'icon-user',orderNum: 4,router: '/item-class/list',viewPath: 'views/item-class/list.vue',keepAlive: 1},
 		{id: '401',parentId: '4',name: '花材分类',type: 1,icon: 'icon-user',orderNum: 4,router: '/item-class/list',viewPath: 'views/item-class/list.vue',keepAlive: 1},
 		{id: '809',parentId: '4',name: '花材导入',type: 1,icon: 'icongongzuotai',orderNum: 4,router: '/item/import',viewPath: 'views/item/import.vue',keepAlive: 1},
 		{id: '809',parentId: '4',name: '花材导入',type: 1,icon: 'icongongzuotai',orderNum: 4,router: '/item/import',viewPath: 'views/item/import.vue',keepAlive: 1},
 		{id: '9',parentId: null,name: '员工',type: 0,icon: 'iconyuangongguanli',orderNum: 9,router: '/staff/list',viewPath: 'views/staff/list.vue',keepAlive: 1},
 		{id: '9',parentId: null,name: '员工',type: 0,icon: 'iconyuangongguanli',orderNum: 9,router: '/staff/list',viewPath: 'views/staff/list.vue',keepAlive: 1},

+ 7 - 0
ghs/src/service/product/index.js

@@ -3,6 +3,13 @@ import { BaseService, Service } from '@/cool';
 @Service('product')
 @Service('product')
 export class ProductService extends BaseService {
 export class ProductService extends BaseService {
 
 
+  showProduct(data) {
+    return this.request({
+      url: '/show',
+      params: data
+    });
+  }
+
 //获取拼音首字母
 //获取拼音首字母
 py(data) {
 py(data) {
   return this.request({
   return this.request({

+ 113 - 0
ghs/src/views/item/batch-modify.vue

@@ -0,0 +1,113 @@
+<template>
+    <div>
+        <div style="width:100%;height:auto;text-align: left;" v-for="(sonProduct, index) in allProdct">
+
+            <div style="font-weight:bold;text-align: left;width:100%;padding:6px 0 5px 8px;">{{ sonProduct.className }}</div>
+
+            <div style="width:100%;height:auto;background-color: white;" v-if="sonProduct.child && !$util.isEmpty(sonProduct.child)">
+
+                <div style="width:33%;height:50px;display:inline-block;height:auto;vertical-align: top;text-align:center;" v-for="(sonChild, indexChild) in sonProduct.child">
+
+
+                    <el-table :data="sonChild" border :show-header="false" size="mini" style="width: 100%;margin:0 auto;">
+
+                        <el-table-column prop="cover" label="图片" align="center" width="50">
+                            <template slot-scope="scope">
+                                <img :src="scope.row.cover" style="width:30px;margin:0 auto;" />
+                            </template>
+                        </el-table-column>
+
+                        <el-table-column prop="name" label="花材" width="160">
+                            <template slot-scope="scope">
+                                <span>{{ scope.row.name }}</span>
+                            </template>
+                        </el-table-column>
+
+                        <el-table-column prop="hjPrice" label="大客价" align="center" width="80">
+                            <template slot-scope="scope">
+                                <el-input v-model="scope.row.hjPrice" @focus="scope.row.hjPrice=''" placeholder="大客价" size="small"></el-input>
+                            </template>
+                        </el-table-column>
+
+                        <el-table-column prop="price" label="批发价" align="center" width="90">
+                            <template slot-scope="scope">
+                                <el-input v-model="scope.row.price" @focus="scope.row.price=''" placeholder="批发价" size="small">
+                                </el-input>
+                            </template>
+                        </el-table-column>
+
+                        <el-table-column prop="skPrice" label="散客价" align="center" width="80">
+                            <template slot-scope="scope">
+                                <el-input v-model="scope.row.skPrice" @focus="scope.row.skPrice=''" placeholder="散客价" size="small"></el-input>
+                            </template>
+                        </el-table-column>
+
+                        <el-table-column prop="cost" label="成本" align="center" width="70">
+                            <template slot-scope="scope">
+                                <span>{{ scope.row.cost?parseFloat(scope.row.cost):0 }}</span>
+                            </template>
+                        </el-table-column>
+
+                    </el-table>
+
+
+                </div>
+
+            </div>
+
+        </div>
+        <div>
+        </div>
+    </div>
+  </template>
+  <script>
+  import { mapGetters } from 'vuex';
+  export default {
+    name: 'item_add',
+    components: {},
+    data () {
+      return {
+        allProdct:[]
+      };
+    },
+    mounted () {
+        this.show()
+    },
+    methods: {
+        show(){
+            let that = this
+            this.$service.product.showProduct({requestType:'hasStockList'}).then(res => {
+                if (!this.$util.isEmpty(res.classItem)) {
+                    res.classItem.forEach((item,idx,arr) => {
+                        //console.log(item.child)
+                        if (item.child && !this.$util.isEmpty(item.child)) {
+
+                                // 分三组
+                                let segmentsCount = 3;
+                                let length = item.child.length
+                                let offset = (Number(length)/segmentsCount).toFixed(2)
+                                offset = Math.ceil(offset)
+
+                                var result = [];
+                                for(var i=0;i<item.child.length;i+=offset){
+                                    result.push(item.child.slice(i,i+offset));
+                                }
+
+                                item.child = result
+                                that.allProdct[idx] = item
+
+                        }else{
+                            that.allProdct[idx] = item
+                        }
+                    })
+                    this.$forceUpdate()
+                    console.log(that.allProdct)
+                }
+            })
+        }
+    }
+  };
+  </script>
+  <style lang="scss" scoped>
+  
+  </style>