瀏覽代碼

Merge remote-tracking branch 'origin/mergeBranch' into mergeBranch

# Conflicts:
#	src/HManagement/salesForecastTemplate/modules/edit.vue
qymljy 2 年之前
父節點
當前提交
786d36ab57

+ 65 - 138
src/HDrpManagement/ProductGroupMag/modules/add.vue

@@ -5,12 +5,12 @@
       <div class="drawer__panel">
         <el-row :gutter="20">
           <el-form :model="form" :rules="rules"  ref="form"  size="small" label-position="right" label-width="100px">
-            <el-col :span="12">
+            <el-col :span="8">
               <el-form-item label="商品组名称:" prop="groupname">
                 <el-input v-model="form.groupname" placeholder="请输入商品组名称"></el-input>
               </el-form-item>
             </el-col>
-            <el-col :span="12">
+            <el-col :span="8">
               <el-form-item label="品牌:" prop="sa_brandid">
                 <el-select v-model="form.sa_brandid" placeholder="请选择品牌" @change="getProductList(params.content.pageNumber = 1,$refs.table.allArr=[])" style="width: 100%">
                   <el-option v-for="item in brandList()" :key="item.sa_brandid" :label="item.brandname"
@@ -19,33 +19,19 @@
                 </el-select>
               </el-form-item>
             </el-col>
-            <el-col :span="24" style="margin-bottom: 20px;margin-top: 22px">
-              <label class="inline-16" style="font-size: 14px">可选商品:</label>
-              <el-input  placeholder="请输入搜索内容" suffix-icon="el-icon-search" v-model="search" @keyup.native.enter="queryClick" @clear="clearData()" style="width:260px;float: right" size="small" class="input-with-select inline-16" clearable>
-              </el-input>
-            </el-col>
             <el-col :span="24">
-              <Table ref="table" v-model="form.itemno" :layout="tablecols" :data="productList" :custom="true" height="500px"  @upDateData="upDateData">
-                <template v-slot:customcol="scope">
-                    <div v-if="scope.column.columnname=='cover'">
-                      <previewImage style="width:38px;height:38px;margin:0px" v-if="scope.column.data.attinfos[0] && scope.column.data.attinfos[0].url"  :image="scope.column.data.attinfos[0]" :deletebtn="false"></previewImage>
-                    </div>
-                    <div v-else>{{scope.column.data[scope.column.columnname]}}</div>
-                </template>
-              </Table>
-              <div class="container normal-panel" style="text-align:right">
-                <el-pagination
-                    style="text-align:right"
-                    background
-                    small
-                    @size-change="handleSizeChange"
-                    @current-change="handleCurrentChange"
-                    :current-page="params.content.pageNumber"
-                    :page-sizes="[20, 50, 100, 200]"
-                    layout="total,sizes, prev, pager, next, jumper"
-                    :total="total">
-                </el-pagination>
-              </div>
+              <p class="normal-title normal-margin">
+                添加产品 
+                <el-button v-if="col === 0" type="text" size="mini" @click="col = 12">选择商品</el-button>
+                <el-button v-else type="text" size="mini" @click="col = 0">关闭选择</el-button>
+              </p>
+
+            </el-col>
+            <el-col :span="24 - col">
+              <Table :data="tableData" ref="submitProduct" @onSuccess="onSuccess" @deleteProduct="deleteProduct"></Table>
+            </el-col>
+            <el-col :span="col">
+              <selectTable @addProduct="addProduct"></selectTable>
             </el-col>
           </el-form>
         </el-row>
@@ -60,20 +46,16 @@
 
 <script>
 import previewImage from '@/components/previewImage/index.vue'
-import Table from './table'
+import selectTable from '@/template/product/index.vue'
+import Table from './table.vue'
 export default {
   props: ['data', 'type'],
-  components:{Table,previewImage},
+  components:{selectTable,previewImage,Table},
   data () {
     return {
       drawer:false,
-      dseleteGroup: '',
-      inputVisible: false,
-      inputValue: '',
-      productList:[],
-      tablecols:[],
-      total:0,
-      search:'',
+      col:0,
+      tableData:[],
       form: {
         sa_brandid: '',
         groupname: '',
@@ -90,123 +72,68 @@ export default {
         itemno: [
           { required: true, message: '请选择商品', trigger: 'blur' },
         ]
-      },
-      params: {
-          "id": "20220923112503",
-          "version":1,
-          "content": {
-            "nocache":true,
-            "sa_itemgroupid":"",
-            "pageNumber":1,
-            "pageSize":20,
-            "where":{
-                "condition":""
-            }
-          }
       }
     }
   },
   inject:['brandList'],
   created () {
-    this.tablecols = this.tool.tabelCol(this.$route.name)['addProductTable'].tablecols
-    if (this.brandList()) {
-      this.form.sa_brandid = this.brandList()[0].sa_brandid
-    }
-    console.log(this.brandList());
-    
-    this.getProductList()
   },
   methods: {
-    upDateData (data) {
-      if (data.length == 0) {
-        this.form.itemno = ''
-      } {
-        this.form.itemno = true
-      }
-    },
-    /* 可选择的商品列表 */
-    async getProductList() {
-      this.params.content.sa_brandid = this.form.sa_brandid
-      let res = await this.$api.requested(this.params)
-      this.productList = res.data
-      this.total = res.total
-      console.log(this.productList,'商品');
-    },
-    submit () {
-      this.$refs.form.validate(async val => {
-        if (val) {
-          let res = await this.$api.requested({
-            "id": "20220922164303",
-            "content": {
-              "sa_itemgroupid": 0,
-              "sa_brandid": this.form.sa_brandid,
-              "groupname": this.form.groupname,
-              "itemno": "",
-              "tag": []
-            }
-          })
-          this.tool.showMessage(res, async () => {
-            let itemno = this.$refs.table.allArr.map(item => {
-              return {
-                sa_itemgroupmxid:0,
-                itemno:item.itemno,
-                itemid:item.itemid
-              }
-            })
-            let res2 = await this.$api.requested({
-              "id": "20220923110303",
-              "version": 1,
-              "content": {
-                "sa_itemgroupid": res.data.sa_itemgroupid,
-                "itemclassinfos": itemno
-              }
-            })
-            await this.$api.requested({
-              "id": "20220922164303",
-              "content": {
-                "sa_itemgroupid": res.data.sa_itemgroupid,
-                "sa_brandid": this.form.sa_brandid,
-                "groupname": this.form.groupname,
-                "itemno": itemno[0].itemno,
-                "tag": []
-              }
-            })
-            this.$emit('onSuccess')
-            this.$refs.form.resetFields()
-            this.$refs.table.allArr = []
-            this.drawer = false
-          })
-        }
-      })
-    },
-    handleSizeChange(val) {
-      // console.log(`每页 ${val} 条`);
-      this.params.content.pageSize = val
-      this.getProductList()
-    },
-    handleCurrentChange(val) {
-      // console.log(`当前页: ${val}`);
-      this.params.content.pageNumber = val
-      this.getProductList()
-    },
     onCancel(){
       this.drawer = false
-      this.$refs.form.resetFields()
-      this.$refs.table.allArr = []
       this.form={
         sa_brandid: '',
         groupname: '',
         itemno: '',
         tag: []
-      }
+      },
+      this.tableData = []
+    },
+    addProduct (row) {
+      this.tableData.push(row)
+      const res = new Map();
+      this.tableData = this.tableData.filter((item) => !res.has(item['itemid']) && res.set(item['itemid'], 1));
+    },
+    deleteProduct (row) {
+      this.tableData = this.tableData.filter(e=>{
+        return e.itemid !== row.itemid
+      })
     },
-    clearData(){
-      this.search = ""
-      this.queryClick()
+    async submit() {
+      if (this.tableData.length === 0) 
+        return this.$message({
+          message:'商品组明细不能为空',
+          type:'error'
+        })
+      const res = await this.$api.requested({
+        "id": "20220922164303",
+        "content": {
+          "sa_itemgroupid":0,     //sa_itemgroupid<=0时 为新增
+          "sa_brandid":this.form.sa_brandid,
+          "groupname":this.form.groupname,
+          "itemno":"",
+          "tag": []
+        }
+      })
+      this.tool.showMessage(res,()=>{
+        this.groupdata = res.data
+        this.$refs['submitProduct'].submitProduct(res.data.sa_itemgroupid)
+      })
     },
-    queryClick(){
-      this.params.content.where.condition = this.search
-      this.getProductList()
+    async onSuccess () {
+      const res = await this.$api.requested({
+        "id": "20220922164303",
+        "content": {
+          "sa_itemgroupid":this.groupdata.sa_itemgroupid,     //sa_itemgroupid<=0时 为新增
+          "sa_brandid":this.groupdata.sa_brandid,
+          "groupname":this.groupdata.groupname,
+          "itemno":this.tableData[0].itemno,
+          "tag": []
+        }
+      })
+      this.$emit('onSuccess')
+      this.drawer = false
+      
     }
   }
 }

+ 5 - 6
src/HDrpManagement/ProductGroupMag/modules/addGroupDetail.vue

@@ -1,7 +1,7 @@
 <template>
   <div>
     <add-btn ref="add" :rowData="rowData" v-if="tool.checkAuth($route.name,'insert')" :disabled="disabled" @onSuccess="getDetail" style="margin-bottom:16px" />
-    <tableLayout :layout="tablecols" :data="list" :opwidth="200" :custom="true" height="40vh" fixedName="operation">
+    <!-- <tableLayout :layout="tablecols" :data="list" :opwidth="200" :custom="true" height="40vh" fixedName="operation">
       <template v-slot:customcol="scope">
           <span v-if="scope.column.data[scope.column.columnname]">{{scope.column.data[scope.column.columnname]}}</span>
           <span v-else-if="scope.column.columnname === 'itemclassname'">
@@ -12,10 +12,10 @@
       <template v-slot:opreation="scope">
         <div >
           <Del type="detail" v-if="tool.checkAuth($route.name,'delete')" :id="rowData.sa_itemgroupid" @deleteSuccess="getDetail" :detailId="scope.data.sa_itemgroupmxid"/>
-          <!-- <editBtn v-if="tool.checkAuth($route.name,'update')" :id="rowData.sa_itemgroupid" @onSuccess="getDetail" :rowData="scope.data"/> -->
         </div>
       </template>
-    </tableLayout>
+    </tableLayout> -->
+    <Table :data="list"></Table>
     <el-pagination
       background
       small
@@ -32,7 +32,7 @@
 <script>
 import AddBtn from './addGroupDetailBtn'
 import editBtn from './editGroupDetailBtn'
-import { log } from '@antv/g2plot/lib/utils'
+import Table from './table.vue'
 import Del from './delete'
 
 export default {
@@ -61,13 +61,12 @@ export default {
     }
   },
   props:['rowData','disabled'],
-  components:{AddBtn,Del,editBtn},
+  components:{AddBtn,Del,Table},
 
   watch: {
   },
   created() {
     this.getDetail()
-    this.tablecols = this.tool.tabelCol(this.$route.name).groupDetailTable.tablecols
   },
   methods: {
     async getDetail() {

+ 15 - 98
src/HDrpManagement/ProductGroupMag/modules/addGroupDetailBtn.vue

@@ -1,11 +1,11 @@
 <template>
   <div>
     <el-button type="primary" size="small" :disabled="!!disabled" @click="editBtn">新增商品明细</el-button>
-    <el-drawer title="新增商品明细" :visible.sync="drawer" size="50%" direction="rtl" append-to-body>
+    <el-drawer title="新增商品明细" :visible.sync="drawer" size="80%" direction="rtl" append-to-body>
       <div class="drawer__panel">
           <el-row>
             <el-form label-position="right" ref="form" :rules="rules" inline label-width="100px" :model="form" size="small">
-              <el-col :span="24" style="display:flex">
+              <!-- <el-col :span="24" style="display:flex">
                 <el-form-item label="产品组名称" prop="groupname">
                   <el-input :disabled="true" v-model="form.groupname" placeholder="请输入商品组名称"></el-input>
                 </el-form-item>
@@ -16,48 +16,27 @@
                     </el-option>
                   </el-select>
                 </el-form-item>
-              </el-col>
-              <el-col :span="24" style="margin-bottom: 20px;margin-top: 22px">
-                <label class="inline-16" style="font-size: 14px">可选商品:</label>
-                <el-input placeholder="请输入搜索内容" suffix-icon="el-icon-search" v-model="search" @input="queryClick" @keyup.native.enter="queryClick" @clear="clearData()" style="width:260px;float: right" size="small" class="input-with-select inline-16" clearable>
-                </el-input>
-              </el-col>
+              </el-col> -->
+              <!-- <el-col :span="24">
+                <p class="normal-margin normal-title">可选商品:</p>
+              </el-col> -->
               <el-col :span="24">
-                <Table ref="table" v-model="form.itemno" :layout="tablecols" :data="productList" :custom="true" height="500px"  @upDateData="upDateData">
-                  <template v-slot:customcol="scope">
-                    <div v-if="scope.column.columnname=='cover'">
-                      <previewImage style="width:38px;height:38px;margin:0px" v-if="scope.column.data.attinfos[0] && scope.column.data.attinfos[0].url"  :image="scope.column.data.attinfos[0]" :deletebtn="false"></previewImage>
-                    </div>
-                    <div v-else>{{scope.column.data[scope.column.columnname]}}</div>
-                  </template>
+                <Table @addProduct="submit">
                 </Table>
-                <div class="container normal-panel" style="text-align:right">
-                  <el-pagination
-                      style="text-align:right"
-                      background
-                      small
-                      @size-change="handleSizeChange"
-                      @current-change="handleCurrentChange"
-                      :current-page="params.content.pageNumber"
-                      :page-sizes="[20, 50, 100, 200]"
-                      layout="total,sizes, prev, pager, next, jumper"
-                      :total="total">
-                  </el-pagination>
-                </div>
               </el-col>
             </el-form>
           </el-row>
       </div>
       <div class="fixed__btn__panel">
         <el-button size="small" @click="drawer = false" class="normal-btn-width">取 消</el-button>
-        <el-button size="small" type="primary" @click="submit" class="normal-btn-width">确 定</el-button>
+        <el-button size="small" type="primary" @click="drawer = false" class="normal-btn-width">确 定</el-button>
       </div>
     </el-drawer>
   </div>
 </template>
 
 <script>
-import Table from './table'
+import Table from '@/template/product/index.vue'
 import previewImage from '@/components/previewImage/index.vue'
 export default {
   props: ['data', 'type','rowData','disabled'],
@@ -86,65 +65,23 @@ export default {
           { required: true, message: '请输入商品组名称', trigger: 'blur' },
         ],
       },
-      params: {
-          "id": "20220923112503",
-          "version":1,
-          "content": {
-            "nocache":true,
-            "sa_itemgroupid":"",
-            "pageNumber":1,
-            "pageSize":20,
-            "where":{
-                "condition":""
-            }
-          }
-      }
-    }
-  },
-  watch: {
-    drawer (val) {
-      !val ? this.$refs.table.$refs.tables.clearSelection() : ''
     }
   },
   inject:['brandList'],
-  created () {
-    this.tablecols = this.tool.tabelCol(this.$route.name)['addProductTable'].tablecols
-    this.form.sa_brandid = this.brandList()[0].sa_brandid
-    console.log(this.brandList());
-    
-    this.getProductList()
-  },
   methods: {
     editBtn () {
       this.drawer = true
       this.form = Object.assign({},this.form,this.rowData)
       this.form.itemno = ''
     },
-    upDateData (data) {
-      if (data.length == 0) {
-        this.form.itemno = ''
-      } {
-        this.form.itemno = true
-      }
-    },
-    /* 可选择的商品列表 */
-    async getProductList() {
-      this.params.content.sa_brandid = this.form.sa_brandid
-      let res = await this.$api.requested(this.params)
-      this.productList = res.data
-      this.total = res.total
-      console.log(this.productList,'商品数据',this.params);
-    },
-    submit () {
+    submit (row) {
       this.$refs.form.validate(async val => {
         if (val) {
-          let itemno = this.$refs.table.allArr.map(item => {
-            return {
-              sa_itemgroupmxid:0,
-              itemno:item.itemno,
-              itemid:item.itemid
-            }
-          })
+          let itemno = [{
+            sa_itemgroupmxid:0,
+            itemno:row.itemno,
+            itemid:row.itemid
+          }]
           let res = await this.$api.requested({
             "id": "20220923110303",
             "version": 1,
@@ -155,31 +92,11 @@ export default {
           })
           this.tool.showMessage(res, () => {
             this.$emit('onSuccess')
-            this.$refs.form.resetFields()
-            this.$refs.table.$refs.tables.clearSelection()
-            this.$refs.table.allArr = []
             this.drawer = false
           })
         }
       })
     },
-    handleSizeChange(val) {
-      // console.log(`每页 ${val} 条`);
-      this.params.content.pageSize = val
-      this.getProductList()
-    },
-    handleCurrentChange(val) {
-      // console.log(`当前页: ${val}`);
-      this.params.content.pageNumber = val
-      this.getProductList()
-    },
-    clearData(){
-      this.search = ""
-    },
-    queryClick(){
-      this.params.content.where.condition = this.search
-      this.getProductList()
-    }
   }
 }
 

+ 110 - 67
src/HDrpManagement/ProductGroupMag/modules/table.vue

@@ -1,20 +1,93 @@
 <template>
   <div>
-    <el-table ref="tables"  @select="aaaa" @select-all="selectAll" v-loading="loading" highlight-current-row :data="data" :header-cell-style="{background:'#EEEEEE',color:'#333'}" size="mini" :height="height" style="width:100%"  border>
-        <el-table-column
-        type="selection"
-        width="45"
-        align="center"
-        fixed>
+    <el-table
+      ref="multipleTable"
+      :data="data"
+      style="width: 100%"
+      :header-cell-style="{height:'50px',color:'#606266',fontWeight:'400'}"
+      :cell-style="{height:'50px',color:'#666666',fontWeight:'400'}">
+      <el-table-column
+          align="center"
+          label="产品图"
+          width="80">
+        <template slot-scope="scope">
+          <div v-if="scope.row.attinfos[0]">
+            <previewImage style="height:38px;width:38px" :image="scope.row.attinfos[0]" :list="scope.row.attinfos" :deletebtn="false"></previewImage>
+          </div>
+        </template>
+      </el-table-column>
+      <el-table-column
+          prop="itemno"
+          label="产品编号"
+          width="180">
+      </el-table-column>
+      <el-table-column
+          prop="itemname"
+          label="产品名称"
+          width="180">
       </el-table-column>
-      <el-table-column :show-overflow-tooltip="col.title == '来源' || col.title == '地址' || col.title == '备注'" v-for="col in layout" :key="col.tablecolid" :prop="col.columnname" :label="col.title" :width="col.width" :fixed="col.columnname === fixedName?'right':false">
+      <el-table-column
+          label="型号/规格"
+          width="180">
         <template slot-scope="scope">
-          <!-- 自定义表格显示内容 -->
-          <slot v-if="custom" name="customcol" :column="{data:scope.row,columnname:col.columnname}"></slot>
-          <!-- 否则就是默认 -->
-          <span v-else>{{scope.row[col.columnname]}}</span>
-          <!-- 操作结构内容 -->
-          <slot v-if="col.columnname === 'operation'" name="opreation" :data="scope.row"></slot>
+          <p><span>{{scope.row.model}}</span>&nbsp;/&nbsp;<span>{{scope.row.spec}}</span></p>
+        </template>
+      </el-table-column>
+      <el-table-column
+          prop="caliber"
+          label="口径"
+          width="180">
+      </el-table-column>
+      <el-table-column
+          prop="pressure"
+          label="压力"
+          width="180">
+      </el-table-column>
+      <el-table-column
+          prop="material"
+          label="材质"
+          width="180">
+      </el-table-column>
+      <el-table-column
+          prop="brand"
+          label="品牌"
+          width="180">
+        <template slot-scope="scope">
+          <p v-for="(item,index) in scope.row.brand" :key="index">
+            <span style="float: left" v-if="index === scope.row.brand.length -1">{{item?item.brandname+'':'--'}}</span>
+            <span style="float: left" v-else>{{item?item.brandname+',':'--'}}</span>
+          </p>
+        </template>
+      </el-table-column>
+      <el-table-column
+          prop="itemclass"
+          label="类别"
+          width="180">
+        <template slot-scope="scope">
+          <span v-for="(item,index) in scope.row.itemclass" :key="index">
+            {{item?item.itemclassname+',':'--'}}
+          </span>
+        </template>
+      </el-table-column>
+      <el-table-column
+          prop="unitid"
+          label="计量单位"
+          width="100">
+        <template slot-scope="scope">
+          <el-tag size="mini" type="info" effect="plain">{{scope.row.unitname}}/{{scope.row.axunitname}}</el-tag>
+        </template>
+      </el-table-column>
+      <el-table-column
+          prop="marketprice"
+          label="牌价"
+          width="100">
+      </el-table-column>
+      <el-table-column
+          label="操作"
+          width="90"
+          fixed="right">
+        <template slot-scope="scope">
+          <el-button type="text" size="small" @click="deleteProduct(scope.row)">删 除</el-button>
         </template>
       </el-table-column>
     </el-table>
@@ -22,68 +95,38 @@
 </template>
 
 <script>
-import {mapGetters} from "vuex"
+import previewImage from '@/components/previewImage/index'
+
 export default {
-  /*
-    layout:表结构数据;
-    data:表渲染数据;
-    custom:是否启用自定义结构;
-    opwidth:操作列宽度
-  */
-  props:['layout','data','custom','height','fixedName'],
+  components:{
+    previewImage
+  },
+  props:['data'],
   data () {
     return {
-      list:[],
-      allArr:[]
-    }
-  },
-  computed:{
-    ...mapGetters({
-      loading:'loading'
-    })
-  },
-  watch: {
-    data (val) {
-      console.log(val);
-      
-      this.data.forEach((row) => {
-        this.allArr.forEach(item => {
-          if (row.itemid == item.itemid) {
-            this.$nextTick(() => {
-              this.$refs["tables"].toggleRowSelection(row, true);
-            })
-          }
-        })
-      });    
-    },
-    allArr (val) {
-      this.$emit('upDateData',val)
     }
   },
   methods:{
-    aaaa(e,a) {
-      let index = this.allArr.findIndex(v=>v.itemid == a.itemid)
-      if(index == -1) {
-        this.allArr.push(a)
-      } else {
-        this.allArr.splice(index,1)
-      }
-      console.log(this.allArr);
-      this.$emit('selectArr',this.allArr)
+    async submitProduct (id) {
+      const res = await this.$api.requested({
+        "id": "20220923110303",
+        "content": {
+          "sa_itemgroupid":id,
+          "itemclassinfos":this.data.map(e=>{
+            return {
+              "sa_itemgroupmxid":0,
+              "itemno":e.itemno,
+              "itemid":e.itemid
+            }
+          })
+        }
+      })
+      res.code === 1?this.$emit('onSuccess'):this.tool.showMessage(res)
       
     },
-    selectAll (val) {
-      if (val.length == 0) {
-        this.data.forEach(item => {
-          this.allArr.splice(item,1)
-        })
-      } else {
-        val.forEach(item => {
-          let res = this.allArr.every(item2 => item.itemid != item2.itemid)
-          res ? this.allArr.push(item) : ''
-        })
-      }
-    },
+    deleteProduct (row) {
+      this.$emit('deleteProduct',row)
+    }
   },
 }
 

+ 3 - 3
src/HDrpManagement/ProductMag/modules/edit.vue

@@ -1,7 +1,7 @@
 <template>
   <div>
-    <el-button type="default" size="mini" @click="onShow(dialogFormVisible=true)" >编 辑</el-button>
-    <el-drawer append-to-body title="新增产品" :visible.sync="dialogFormVisible" size="900px" @close="onCancel">
+    <el-button type="default" size="mini" :disabled="data.status !== '新建'" @click="onShow(dialogFormVisible=true)" >编 辑</el-button>
+    <el-drawer append-to-body title="编辑产品" :visible.sync="dialogFormVisible" size="900px" @close="onCancel">
       <div class="drawer__panel" >
         <el-row :gutter="10">
           <el-form label-position="right" label-width="90px" :model="form" :rules="rules" ref="form" size="small">
@@ -317,7 +317,7 @@
                       :folderid="folderid"
                       accept=".JPG,.PNG,.jpg,.png"
                       btntype="image"
-                      :bindData="{ownertable:'plm_item',ownerid:form.itemid,usetype:'default'}"
+                      :bindData="bindData"
                       @onSuccess="uploadSuccess">
                   </uploadFile>
                   <previewImage style="margin-right: 10px;margin-bottom:10px" v-for="image in form.attinfos" :key="image.index" :image="image"  :deletebtn="true"

+ 13 - 9
src/HManagement/salesForecastTemplate/modules/edit.vue

@@ -150,17 +150,21 @@ export default {
   methods:{
     onShow () {
       this.queryRoles()
-      this.data.periodpointchange.forEach(e=>{
-        this.sdList.push({
-          periodpoint:e,
-          taskday:'',
+      if (this.data.isrepeat === 1) {
+        this.data.periodpointchange.forEach(e=>{
+          this.sdList.push({
+            periodpoint:e,
+            taskday:'',
+          })
         })
-      })
-      this.sdList.forEach(e=>{
-        this.data.taskdayschange.forEach(t=>{
-          e.taskday = t
+        this.sdList.forEach(e=>{
+          this.data.taskdayschange.forEach(t=>{
+            e.taskday = t
+          })
         })
-      })
+      } else {
+        this.addDate.taskday = this.data.taskdayschange[0]
+      }
       this.form = Object.assign({},this.form, this.data)
       this.form.roles = this.form.roles.map(e=>{
         return e.roleid

+ 10 - 15
src/SDrpManagement/ProductGroup/index.vue

@@ -1,8 +1,8 @@
 <template>
   <div class="group container normal-panel normal-margin">
     <selectClass @brandChange="brandChange" @onClassChange="onClassChange" @Search="Search" @clearSearch="clearSearch" :default="true"></selectClass>
-    <div class="content" v-if="Object.keys(productGroup).length > 0">
-      <div class="group-list">
+    <div v-if="Object.keys(productGroup).length > 0">
+      <div class="group-list content">
         <div class="group-item" v-for="item in productGroup" :key="item.sa_itemgroupid" @click="itemClick(item)">
           <div class="top">
             <el-image style="width:100%" :src="Object.keys(item.attinfos).length > 0 ? item.attinfos[0].url : ''" fit="cover" />
@@ -15,12 +15,6 @@
           </div>
         </div>
       </div>
-      <div class="page">
-        <pagination style="padding-bottom:0" :total="total" :pageSize="params.content.pageSize" :currentPage="params.content.pageNumber"
-          @pageChange="pageChange">
-        </pagination>
-      </div>
-      
     </div>
     <el-empty description="暂无数据" v-else></el-empty>
     
@@ -29,8 +23,6 @@
 
 <script>
 import selectClass from './modules/Select'
-import Pagination from '@/components/pagination/Pagination'
-import { log } from '@antv/g2plot/lib/utils';
 export default {
   name: '',
   data() {
@@ -55,7 +47,7 @@ export default {
       total:0,
     };
   },
-  components:{selectClass,Pagination},
+  components:{selectClass},
   computed:{
   },
   watch:{
@@ -85,7 +77,6 @@ export default {
       })
       this.brandId = this.brandList ? [this.brandList[0].value] : [0]
       this.getProductGroup()
-      console.log(this.brandList,'品牌');
     },
     async getProductGroup() {
       this.params.content.brandids = this.brandId
@@ -95,6 +86,7 @@ export default {
       console.log(this.productGroup);
     },
     itemClick(id) {
+      this.$store.dispatch('changeDetailDrawer',true)
       this.$router.push({
         path:'/groupDetail',
         query: {
@@ -136,7 +128,7 @@ export default {
   }
 }
 .content{
-  height:calc(100vh - 250px)
+  height:calc(100vh - 370px)
 }
 .group .group-list {
   display: grid;
@@ -172,6 +164,7 @@ export default {
 .group .group-list .group-item .bottom {
   padding: 10px;
   border:1px solid #f1f2f3;
+  border-top:none;
 }
 .group .group-list .group-item .bottom .title {
   font-size: 14px;
@@ -180,7 +173,8 @@ export default {
   color: #333333;
   overflow: hidden;
   text-overflow: ellipsis;
-  -webkit-line-clamp: 2;
+  white-space: nowrap;
+  -webkit-line-clamp: 1;
   width: 100%;
   margin-bottom: 5px;
 }
@@ -191,7 +185,8 @@ export default {
   color: #666666;
   overflow: hidden;
   text-overflow: ellipsis;
-  -webkit-line-clamp: 2;
+  white-space: nowrap;
+  -webkit-line-clamp: 1;
   width: 100%;
   margin-bottom: 4px;
 }

+ 0 - 185
src/SDrpManagement/ProductGroup/modules/GroupDetail/groupDetail copy.vue

@@ -1,185 +0,0 @@
-<template>
-  <div class="detail normal-panel" v-if="selectProduct">
-    <div class="left">
-      <el-image :src="selectProduct.attinfos[0].url" fit="fill"></el-image>
-    </div>
-    <div class="right container">
-      <div class="header">
-        <p class="title">{{selectProduct.itemname}}</p>
-        <p class="code"><span class="small">编号:</span>{{selectProduct.itemno}}</p>
-        <div class="price">
-          <span class="small">价格:</span>
-          <div class="number">
-            <span class="new">¥<span style="font-size:24px">{{this.selectProduct.gradeprice}}</span></span>
-            <span class="small"><span
-                class="old">¥{{selectProduct.oldprice}}</span>{{`(/${this.selectProduct.unitname})`}}</span>
-          </div>
-        </div>
-      </div>
-      <div class="count-box">
-        <span class="small">数量:</span>
-        <div class="count-handle">
-          <el-input-number size="small" v-model="count" @change="countChange" :min="1"></el-input-number>
-        </div>
-      </div>
-      <div class="type">
-        <span class="small">型号</span>
-        <div class="content">
-          <el-tag @click="typeClick(item)" v-for="(item,index) in detail" :key="index"
-            :style="selectProduct.itemno == item.itemno ? 'background:#2b3e68;color:#ffffff' : ''">{{item.model}}
-          </el-tag>
-        </div>
-      </div>
-      <div class="shopping">
-        <el-button size="small" type="primary" icon="el-icon-shopping-cart-1" @click="addCart">加入购物车</el-button>
-      </div>
-    </div>
-  </div>
-</template>
-
-<script>
-import { log } from '@antv/g2plot/lib/utils';
-export default {
-  name: '',
-  data () {
-    return {
-      detail: '',
-      count: 1,
-      selectProduct: ''
-    };
-  },
-  computed: {
-  },
-  watch: {
-  },
-  created () {
-    this.getDetail()
-  },
-  methods: {
-    async getDetail () {
-      let res = await this.$api.requested({
-        "id": "20220926142403",
-        "version": 1,
-        "content": {
-          "sa_itemgroupid": this.$route.query.id
-        }
-      })
-      this.detail = res.data
-      this.selectProduct = this.detail ? this.detail[0] : ''
-      console.log(this.selectProduct);
-
-    },
-    countChange (num) {
-      this.count = num
-      console.log(this.count, '数量');
-    },
-    typeClick (data) {
-      console.log(data);
-      this.selectProduct = data
-      this.count = 1
-    },
-    
-    async addCart () {
-      let res = await this.$api.requested({
-        "id": 20220924095102,
-        "content": {
-          "sa_brandid": this.$route.query.brandid, //品牌id
-          "itemid": this.selectProduct.itemid, //货品id
-          "qty": this.count, //数量
-          "itemno": this.selectProduct.itemno //货品编号
-        },
-      })
-      console.log(res);
-
-      if (res.code == 1) {
-        this.$message({
-          message: '加入购物车成功',
-          type: 'success'
-        })
-      }
-    }
-  },
-};
-</script>
-
-<style scoped>
-* {
-  box-sizing: border-box;
-}
-.detail {
-  height: calc(100vh - 100px);
-  display: flex;
-  padding: 10px 10px 0 10px;
-}
-.detail .left {
-  flex: 1.5;
-  height: 100%;
-  border: 1px solid rgba(0, 0, 0, 0.05);
-}
-.detail .right {
-  flex: 3;
-  height: 100%;
-}
-.detail .right .header {
-  padding-bottom: 12px;
-  border-bottom: 1px solid #cccccc;
-}
-.detail .right .header .title {
-  font-size: 20px;
-  font-weight: 700;
-}
-.detail .right .header .code {
-  color: #0250a3;
-  height: 50px;
-  line-height: 50px;
-}
-.detail .right .header .price {
-  display: flex;
-  height: 50px;
-  line-height: 50px;
-}
-.detail .right .header .price .number {
-}
-.detail .right .header .price .number .new {
-  color: #dc3545;
-  font-size: 12px;
-  margin-right: 12px;
-}
-.detail .right .header .price .number .old {
-  text-decoration: line-through;
-}
-
-.detail .right .count-box {
-  display: flex;
-  align-items: center;
-  height: 80px;
-  border-bottom: 1px solid #cccccc;
-  padding: 12px 0;
-  margin-bottom: 10px;
-}
-
-.detail .right .type {
-  display: flex;
-}
-.detail .right .type .content {
-  display: flex;
-  flex-wrap: wrap;
-  min-height: 100px;
-  max-height: 300px;
-  overflow-y: scroll;
-  width: 100%;
-}
-.detail .right .type .content .el-tag {
-  margin: 0 10px 10px 0;
-  cursor: pointer;
-}
-.detail .right .shopping {
-  padding-left: 100px;
-}
-
-.small {
-  font-size: 12px;
-  color: #a7a7a9;
-  width: 100px;
-}
-</style>

+ 70 - 56
src/SDrpManagement/ProductGroup/modules/GroupDetail/groupDetail.vue

@@ -1,53 +1,56 @@
 <template>
 <div class="container normal-panel">
-  <div class="product-detail container">
-    <el-row :gutter="20">
-      <el-col :span="7">
-        <img style="width:100%" :src="selectProduct.attinfos?selectProduct.attinfos[0].url:''">
-      </el-col>
-      <el-col :span="17">
+  <div class="product-detail container flex-align-stretch">
+    <div class="flex-align-stretch column">
+      <el-image class="thumImage mt-10" :class="item.attachmentid === actImage.attachmentid?'act':''" v-for="item in selectProduct.attinfos" :key="item.index" :src="item.url" @click="actImage = item" fit="cover" />
+    </div>
+    <el-image style="width:400px;height:400px;margin-right:30px" :src="actImage.url" fit="cover" />
+    <div style="flex:1">
+      <p class="productName normal-margin">{{selectProduct.itemname}}</p>
+      <p class="normal-margin" style="color:#888;">编码:&emsp;{{selectProduct.itemno}}</p>
+      <p class="normal-margin">价格:&emsp;<span class="product-price">¥{{selectProduct.gradeprice}}</span>&nbsp;<span class="text-throughline">¥{{selectProduct.gradeprice}}</span></p>
+      <div class="line normal-margin"></div>
+      <div>
+        <p class="normal-margin">规格:&emsp;{{selectProduct.spec}}</p>
+      </div>
+      <div class="flex-align-center" style="margin-bottom:30px">
+        <p>数量:&emsp;</p>
+        <el-input-number v-model="count" :min="selectProduct.orderminqty" :step="selectProduct.orderaddqty" size="small" label="描述文字"></el-input-number>
+      </div>
+      <p class="normal-margin">当前型号:&emsp;{{selectProduct.model}}</p>
+      <div class="type">
+        <div class="content normal-margin">
+          <p class="inline-16">更多型号:</p>
+          <el-tag class="inline-16" @click="typeClick(item)" v-for="(item,index) in detail" :key="index"
+            :style="selectProduct.itemno == item.itemno ? 'background:#2b3e68;color:#ffffff' : ''" size="small">{{item.model}}
+          </el-tag>
+        </div>
+      </div>
+      <el-button class="normal-margin" type="primary" style="width:200px" @click="addCart">加入购物车</el-button>
+      <div style="display:flex">
+        <p>相关链接:&emsp;</p>
         <div>
-          <p class="productName normal-margin">{{selectProduct.itemname}}</p>
-          <p class="normal-margin" style="color:#888;">编码:&emsp;{{selectProduct.itemno}}</p>
-          <p class="normal-margin">价格:&emsp;<span class="product-price">¥{{selectProduct.gradeprice}}</span>&nbsp;<span class="text-throughline">¥{{selectProduct.gradeprice}}</span></p>
-          <div class="line normal-margin"></div>
-          <div>
-            <p class="normal-margin">规格:{{selectProduct.spec}}</p>
-          </div>
-          <div class="flex-align-center" style="margin-bottom:30px">
-            <p>数量:&emsp;</p>
-            <el-input-number v-model="count" :min="selectProduct.orderminqty" :step="selectProduct.orderaddqty" label="描述文字"></el-input-number>
-          </div>
-          <p class="normal-margin">型号:&emsp;{{selectProduct.model}}</p>
-          <div class="type">
-            <span class="small">型号</span>
-            <div class="content">
-              <el-tag @click="typeClick(item)" v-for="(item,index) in detail" :key="index"
-                :style="selectProduct.itemno == item.itemno ? 'background:#2b3e68;color:#ffffff' : ''">{{item.model}}
-              </el-tag>
+          <div v-for="item in selectProduct.technicalinfo" :key="item.index">
+            <div class="file-link" v-for="att in item.attinfos" :key="att.index">
+              <el-tag size="mini">{{item.type}}</el-tag><a :href="att.url">{{att.document}}</a>
             </div>
           </div>
-          <!-- <p class="normal-margin">材质:&emsp;{{selectProduct.model}}</p> -->
-          <el-button class="normal-margin" type="primary" style="width:200px" @click="addCart">加入购物车</el-button>
-          <div>
-            <p>相关链接</p>
-          </div>
         </div>
-      </el-col>
-    </el-row>
+      </div>
+    </div>
   </div>
 </div>
 </template>
 
 <script>
-import { log } from '@antv/g2plot/lib/utils';
 export default {
   name: '',
   data () {
     return {
       detail: '',
       count: 1,
-      selectProduct: ''
+      selectProduct: '',
+      actImage:{}
     };
   },
   computed: {
@@ -68,16 +71,17 @@ export default {
       })
       this.detail = res.data
       this.selectProduct = this.detail ? this.detail[0] : ''
+      this.actImage = this.detail ? this.detail[0].attinfos[0] : {}
       console.log(this.selectProduct);
 
     },
     countChange (num) {
       this.count = num
-      console.log(this.count, '数量');
     },
     typeClick (data) {
-      console.log(data);
+      console.log(data)
       this.selectProduct = data
+      this.actImage = data.attinfos[0]
       this.count = 1
     },
     
@@ -91,14 +95,7 @@ export default {
           "itemno": this.selectProduct.itemno //货品编号
         },
       })
-      console.log(res);
-
-      if (res.code == 1) {
-        this.$message({
-          message: '加入购物车成功',
-          type: 'success'
-        })
-      }
+      this.tool.showMessage(res)
     }
   },
 };
@@ -106,14 +103,9 @@ export default {
 
 <style scoped>
 .product-detail{
-  background: #fff;
-  width: 80%;
-  margin:30px 0;
-  border-radius: 10px;
-}
-.product-detail p{
-  font-size: 14px;
-  color:#888 ;
+  height: calc(100vh - 210px);
+  width: 900px;
+  margin: 0 auto;
 }
 .productName{
   font-size: 1.75rem !important;
@@ -138,11 +130,6 @@ export default {
   font-size: 14px;
   text-decoration: line-through;
   color:#999
-}.product-detail{
-  background: #fff;
-  width: 80%;
-  margin:30px 0;
-  border-radius: 10px;
 }
 .product-detail p{
   font-size: 14px;
@@ -172,4 +159,31 @@ export default {
   text-decoration: line-through;
   color:#999
 }
+.thumImage{
+  width:100px;
+  height:100px;
+  margin-right:30px;
+  border:1px solid #f1f2f3;
+  cursor: pointer;
+  
+}
+.column{
+  flex-direction: column;
+}
+.act{
+  border:1px solid #607d8b;
+}
+.file-link{
+  font-size: 12px;
+  margin-bottom:10px
+}
+.file-link a{
+  text-decoration: none;
+  margin-left:10px;
+  color:#999
+}
+.file-link a:hover{
+  color:#4F7BFD;
+  text-decoration: underline;
+}
 </style>

+ 6 - 11
src/SDrpManagement/ProductGroup/modules/Select.vue

@@ -2,18 +2,18 @@
   <div class="border-bottom">
     <div>
       <ul class="flex-align-center normal-margin">
-        <li style="color:#999;font-size: 14px;">领域:</li>
+        <li style="color:#999;font-size: 13px;">领域:</li>
         <li :class="field_act === item.sys_enterprise_tradefieldid?'act':''" class="brand-item" v-for="item in fields" :key="item.sys_enterprise_tradefieldid" @click="clickField(item.sys_enterprise_tradefieldid)">{{item.tradefield}}</li>
       </ul>
       <ul class="flex-align-center normal-margin">
-        <li style="color:#999;font-size: 14px;">品牌:</li>
+        <li style="color:#999;font-size: 13px;">品牌:</li>
         <li :class="brand_act === item.sa_brandid?'act':''" class="brand-item" v-for="item in brands" :key="item.sa_brandid" @click="clickBrand(item.sa_brandid)">{{item.brandname}}</li>
       </ul>
       <ul class="flex-align-center normal-margin">
-        <li style="color:#999;font-size: 14px;">分类:</li>
+        <li style="color:#999;font-size: 13px;">分类:</li>
         <li :class="class_act === item.itemclassnum?'act':''" class="brand-item" v-for="item in itemclass" :key="item.itemclassnum" @click="clickClass(item)">{{item.itemclassname}}</li>
       </ul>
-      <classTree v-if="show" style="padding-left:31px" :data="activeClass.subdep" @onClassChange="change"></classTree>
+      <classTree style="padding-left:31px" :data="activeClass.subdep" @onClassChange="change"></classTree>
     </div>
     <div>
 
@@ -33,8 +33,7 @@ export default {
       activeClass:{},
       field_act:0,
       brand_act:0,
-      class_act:0,
-      show:true,
+      class_act:0
     }
   },
   props: {
@@ -98,10 +97,6 @@ export default {
     clickClass (item) {
       this.activeClass = item
       this.class_act = item.itemclassnum
-      this.show = false
-      setTimeout(() => {
-        this.show = true
-      }, 100);
       this.change(item)
     },
     change(n) {
@@ -127,7 +122,7 @@ export default {
   color: #333;
   cursor: pointer;
   transition: .2s all linear;
-  font-size: 14px;
+  font-size: 13px;
 }
 .act{
   color:#3874f6;

+ 5 - 10
src/SDrpManagement/ProductGroup/modules/classTree.vue

@@ -1,11 +1,11 @@
 <template>
   <div>
-    <div class="normal-margin">
-      <div class="class-item"  :class="class_act === item.itemclassnum?'act':''" v-for="item in data" :key="item.index" @click="classClick(item)">
-        {{item.itemclassname}}
+    <div class="flex-align-center">
+      <div v-for="item in data" :key="item.index" @click="classClick(item)">
+        <p class="normal-margin class-item"  :class="class_act === item.itemclassnum?'act':''">{{item.itemclassname}}</p>
+        <Tree v-if="item.subdep" :data="item.subdep" @onClassChange="change"></Tree>
       </div>
     </div>
-    <Tree v-if="activeClass.subdep && show" :data="activeClass.subdep" @onClassChange="change"></Tree>
   </div>
 </template>
 
@@ -16,7 +16,6 @@ export default {
   data () {
     return {
       activeClass:{},
-      show:true,
       class_act:0,
     }
   },
@@ -24,10 +23,6 @@ export default {
     classClick (item) {
       this.activeClass = item
       this.class_act = item.itemclassnum
-      this.show = false
-      setTimeout(() => {
-          this.show = true
-      }, 100);
       this.change(item)
     },
     change(item) {
@@ -42,7 +37,7 @@ export default {
   color: #333;
   cursor: pointer;
   transition: .2s all linear;
-  font-size: 14px;
+  font-size: 13px;
   
 }
 .act{

+ 1 - 0
src/components/upload/preview_upload.vue

@@ -28,6 +28,7 @@
         </div>
       </div>
       <el-upload
+        ref="upload"
         :accept="accept"
         action="#"
         :on-change="onChange"

+ 63 - 33
src/template/product/index.vue

@@ -1,5 +1,5 @@
 <template>
-<div class="container"> 
+<div> 
   <div class="flex-align-center flex-between normal-margin">
     <slot name="operation"></slot>
     <div class="flex-align-center">
@@ -11,73 +11,100 @@
       ref="multipleTable"
       :data="tableData"
       style="width: 100%"
-      :header-cell-style="{height:'50px',color:'#768093',fontWeight:'100'}"
-      :cell-style="{height:'50px',color:'#768093',fontWeight:'200'}"
-      @selection-change="selectionChange">
+      :header-cell-style="{height:'50px',color:'#606266',fontWeight:'400'}"
+      :cell-style="{height:'50px',color:'#666666',fontWeight:'400'}">
       <el-table-column
-        type="selection"
-        width="55">
-      </el-table-column>
-      <el-table-column
-        align="center"
-        label="产品图"
-        width="80">
+          align="center"
+          label="产品图"
+          width="80">
         <template slot-scope="scope">
           <div v-if="scope.row.attinfos[0]">
-            <previewImage class="image" :image="scope.row.attinfos[0]" :list="scope.row.attinfos" :deletebtn="false"></previewImage>
+            <previewImage style="height:38px;width:38px" :image="scope.row.attinfos[0]" :list="scope.row.attinfos" :deletebtn="false"></previewImage>
           </div>
         </template>
       </el-table-column>
       <el-table-column
-        prop="itemname"
-        label="产品名称"
-        width="180">
+          prop="itemno"
+          label="产品编号"
+          width="180">
       </el-table-column>
       <el-table-column
-        prop="itemno"
-        label="产品编号"
-        width="180">
+          prop="itemname"
+          label="产品名称"
+          width="180">
       </el-table-column>
       <el-table-column
-        label="型号/规格">
+          label="型号/规格"
+           width="180">
         <template slot-scope="scope">
           <p><span>{{scope.row.model}}</span>&nbsp;/&nbsp;<span>{{scope.row.spec}}</span></p>
         </template>
       </el-table-column>
       <el-table-column
-        prop="unitid"
-        label="起订量/增量"
-        width="150">
+          prop="caliber"
+          label="口径"
+          width="180">
+      </el-table-column>
+      <el-table-column
+          prop="pressure"
+          label="压力"
+          width="180">
+      </el-table-column>
+      <el-table-column
+          prop="material"
+          label="材质"
+          width="180">
+      </el-table-column>
+      <el-table-column
+          prop="brand"
+          label="品牌"
+          width="180">
         <template slot-scope="scope">
-          <p><span>{{scope.row.orderminqty}}</span>&nbsp;/&nbsp;<span>{{scope.row.orderaddqty}}</span></p>
+          <p v-for="(item,index) in scope.row.brand" :key="index">
+            <span style="float: left" v-if="index === scope.row.brand.length -1">{{item?item.brandname+'':'--'}}</span>
+            <span style="float: left" v-else>{{item?item.brandname+',':'--'}}</span>
+          </p>
         </template>
       </el-table-column>
       <el-table-column
-        prop="unitid"
-        label="计量单位"
-        width="90">
+          prop="itemclass"
+          label="类别"
+          width="180">
+        <template slot-scope="scope">
+          <span v-for="(item,index) in scope.row.itemclass" :key="index">
+            {{item?item.itemclassname+',':'--'}}
+          </span>
+        </template>
+      </el-table-column>
+      <el-table-column
+          prop="unitid"
+          label="计量单位"
+          width="100">
         <template slot-scope="scope">
           <el-tag size="mini" type="info" effect="plain">{{scope.row.unitname}}/{{scope.row.axunitname}}</el-tag>
         </template>
       </el-table-column>
       <el-table-column
-        prop="status"
-        label="状态"
-        width="90">
+          prop="marketprice"
+          label="牌价"
+          width="100">
+      </el-table-column>
+      <el-table-column
+          label="操作"
+          fixed="right">
         <template slot-scope="scope">
-          <span :style="scope.row.status === '新建'?{color:'#52C41A'}:{color:'red'}">{{scope.row.status}}</span>
+          <el-button type="text" size="small" @click="addProduct(scope.row)">添 加</el-button>
         </template>
       </el-table-column>
     </el-table>
-    <div style="margin-top:16px;text-align:right">
+    <div style="margin-top:16px;float:right">
       <el-pagination
         background
-        small
         @size-change="handleSizeChange"
         @current-change="handleCurrentChange"
         :current-page="currentPage"
         :page-size="params.content.pageSize"
-        layout="total, prev, pager, next, jumper"
+        layout="total,sizes, prev, pager, next, jumper"
         :total="total">
       </el-pagination>
     </div>
@@ -136,6 +163,9 @@ export default {
     },
     clearSelection () {
       this.$refs.multipleTable.clearSelection();
+    },
+    addProduct (row) {
+      this.$emit('addProduct',row)
     }
   },
   mounted () {