|
|
@@ -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>
|