qymljy 2 лет назад
Родитель
Сommit
a53d795892

+ 40 - 3
src/HDrpManagement/contractManage/components/productDetailList/productDetailList.vue

@@ -23,7 +23,20 @@
       </div>
       <div class="produtMag-panel">
       </div>
-      <tableLayout v-tableLoad="tableLoad" checkbox="true"  :layout="tablecols" :data="list" :opwidth="200" height="calc(100vh - 356px)" :width="true" :custom="true" fixedName="operation amount" @selectionChange="selectionChange">
+      <tableLayout v-tableLoad="tableLoad" checkbox="true"  :layout="tablecols" :data="list" :opwidth="200" height="calc(100vh - 356px)" :width="true" :custom="true" fixedName="operation amount" @selectionChange="selectionChange" :headerOptions="['type']">
+        <template v-slot:header="scope">
+          <div v-if="scope.column.columnname == 'type'">
+            <el-select v-model="value" placeholder="请选择类型" v-if="tool.checkAuth($route.name,'productDetailManage') && data.status === '新建' && isLeader" @change="typeSelect">
+              <el-option
+                  v-for="item in options"
+                  :key="item.value"
+                  :label="item.label"
+                  :value="item.value">
+              </el-option>
+            </el-select>
+            <span v-else>类型</span>
+          </div>
+        </template>
         <template v-slot:customcol="scope">
           <div v-if="scope.column.columnname == 'qty'">
 <!--            <el-input-number size="mini" v-if="editIndex == scope.column.data.sa_contract_itemsid" v-model="scope.column.data.qty" @change="qtyChange" :min="1" label="描述文字"></el-input-number>-->
@@ -106,7 +119,7 @@
 import addProduct from '@/template/addProduct'
 import previewImage from '@/components/previewImage/index'
 import uploadAllData from '@/components/uploadAllData/index'
-import tableLayout from '@/components/dynamic-table/index2'
+import tableLayout from '@/components/dynamic-table/index3'
 import exportFile from '@/components/export_file/index1'
 export default {
   components: {addProduct,previewImage,uploadAllData,tableLayout,exportFile},
@@ -151,7 +164,15 @@ export default {
       tablecolsAdd:[],
       total:0,
       totalPage:0,
-      editIndex:''
+      editIndex:'',
+      options: [{
+        value: '折扣系数',
+        label: '折扣系数'
+      }, {
+        value: '指定单价',
+        label: '指定单价'
+      }],
+      value: ''
     };
   },
   computed:{
@@ -396,6 +417,22 @@ export default {
     closeDrawer(){
       this.listData()
       this.$emit("closeDrawer")
+    },
+    /*选择类型*/
+    async typeSelect(){
+      const res = await this.$api.requested({
+        "id": 20240110154404,
+        "content": {
+          "sa_contractid": this.$route.query.id,
+          "sa_contract_itemsids": [],
+          "isAll":1,
+          "type":this.value
+        }
+      })
+      this.tool.showMessage(res,()=>{
+        this.listData()
+      })
+
     }
   },
 };

+ 1 - 1
src/HDrpManagement/orderManage/modules/edit.vue

@@ -193,7 +193,7 @@
                     v-model="addressparam.content.where.condition"
                     placeholder="请输入搜索内容"
                     style="width:150px"
-                    @keyup.enter.native="receiveAddress(addressparam.content.pageNumber = 1)" @clear="receiveAddress(addressparam.content.pageNumber = 1)" clearable></el-input>&nbsp;
+                    @keyup.enter.native="receiveAddress(addressparam.content.pageNumber= 1)" @clear="receiveAddress(addressparam.content.pageNumber= 1)" clearable></el-input>
                   <addAddressInfo style="text-align:right" @onAddSuccess="receiveAddress()" :mainData="{sys_enterpriseid:data.sys_enterpriseid}"/>
                 </div>
                 <el-table

+ 42 - 4
src/SDrpManagement/QuotedPrice/detail/modules/productInventory/index.vue

@@ -40,7 +40,20 @@
       </importFile>
     </div>
     <div class="produtMag-panel">
-      <table-new-layout :layout="tablecols" checkbox="true"  :data="list" :opwidth="200" height="calc(100vh - 400px)" :width="true" :custom="true" fixedName="offerPrice amount" @selectionChange="selectionChange">
+      <tableNewLayout :layout="tablecols" checkbox="true"  :data="list" :opwidth="200" height="calc(100vh - 400px)" :width="true" :custom="true" fixedName="offerPrice amount" @selectionChange="selectionChange" :headerOptions="['pricetype']">
+        <template v-slot:header="scope">
+          <div v-if="scope.column.columnname == 'pricetype'">
+            <el-select v-model="value" placeholder="请选择类型" v-if="tool.checkAuth($route.name,'productDetails') && data.status === '新建' &&  disabled" @change="typeSelect">
+              <el-option
+                  v-for="item in options"
+                  :key="item.value"
+                  :label="item.label"
+                  :value="item.value">
+              </el-option>
+            </el-select>
+            <span v-else>类型</span>
+          </div>
+        </template>
         <template v-slot:customcol="scope">
           <div v-if="scope.column.columnname == 'qty'">
             <el-input-number :disabled="data.status !== '新建' || !tool.checkAuth($route.name,'productDetails') || !disabled" v-model="scope.column.data.qty" size="mini"  :min="scope.column.data.orderminqty" :step="scope.column.data.orderaddqty"  label="描述文字" @change="onChangeNum(scope.column.data.qty,scope.column.data,scope.$index)"></el-input-number>
@@ -75,7 +88,7 @@
           </div>
           <p v-else>{{scope.column.data[scope.column.columnname]}}</p>
         </template>
-      </table-new-layout>
+      </tableNewLayout>
       <div style="height: 35px;margin-top: 20px">
         <div style="float: left">总金额(元):{{ tool.formatAmount(data.sumamount,2) }}</div>
         <div style="float: right">
@@ -106,10 +119,11 @@ import addProduct from '@/template/addProduct'
 import addProductProject from '@/template/addProduct'
 import uploadAllData from '@/components/uploadAllData/index'
 import importFile from '@/template/importFile/index'
+import tableNewLayout from '@/components/dynamic-newTable/index1'
 export default {
   props:["data","disabled","isLeader"],
   name: "productInventory",
-  components:{uploadAllData,addProductProject,addProduct,uploadFile, previewImage,product_table,productTableProject,productTable,importFile},
+  components:{uploadAllData,addProductProject,addProduct,uploadFile, previewImage,product_table,productTableProject,productTable,importFile,tableNewLayout},
   data(){
     return {
       errorurl:null,
@@ -175,7 +189,15 @@ export default {
         }
       },
       itemids:[],
-      items:[]
+      items:[],
+      options: [{
+        value: '指定系数',
+        label: '指定系数'
+      }, {
+        value: '指定单价',
+        label: '指定单价'
+      }],
+      value: ''
     }
   },
   methods:{
@@ -475,6 +497,22 @@ export default {
       }
       this.onSuccess()
 
+    },
+    /*选择类型*/
+    async typeSelect(){
+      const res = await this.$api.requested({
+        "id": 20240110155304,
+        "content": {
+          "sa_quotedpriceid": this.$route.query.id,
+          "sa_quotedprice_itemsids": [],
+          "isAll":1,
+          "type":this.value
+        }
+      })
+      this.tool.showMessage(res,()=>{
+        this.productData()
+      })
+
     }
   },
   mounted() {

+ 78 - 0
src/components/dynamic-newTable/index1.vue

@@ -0,0 +1,78 @@
+<template>
+  <div>
+    <!-- :header-cell-style="{background:'#EEEEEE',color:'#333'}" -->
+    <el-table ref="table" :row-class-name="tableClassName" highlight-current-row :data="data"  size="mini" :height="height ? height : data.length <= 5?'280px':'calc(100vh - 268px)'"  @row-click="rowClick" style="width:100%;" :header-cell-style="{height:'40px',color:'#606266',fontWeight:'400',fontSize:'14px'}"
+              :cell-style="{height:'40px',color:'#666666',fontWeight:'400'}" border @selection-change="selectionChange">
+      <el-table-column
+          type="selection"
+          width="35" fixed v-if="checkbox">
+      </el-table-column>
+      <el-table-column show-overflow-tooltip v-for="col in layout" :key="col.tablecolid" :prop="col.columnname" :label="col.title" :width="width ? col.width : 150" :fixed="fixedName ? fixedName.indexOf(col.columnname)!= -1?redirect ? redirect : 'right' :false : false">
+        <template :slot="headerOptions ? headerOptions.includes(col.columnname) ? 'header' : '' : ''" slot-scope="scope">
+          <slot name="header" :column="{data:scope.row,columnname:col.columnname}"></slot>
+        </template>
+        <template slot-scope="scope">
+          <div class="table-panel">
+            <!-- 自定义表格显示内容 -->
+            <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>
+          </div>
+        </template>
+      </el-table-column>
+    </el-table>
+  </div>
+</template>
+
+<script>
+import {mapGetters} from "vuex"
+export default {
+  /*
+    layout:表结构数据;
+    data:表渲染数据;
+    custom:是否启用自定义结构;
+    opwidth:操作列宽度
+  */
+  props:['layout','data','custom','height','fixedName','width','checkbox','redirect','customHeader','headerOptions'],
+  data () {
+    return {
+      list:[],
+    }
+  },
+  computed:{
+    ...mapGetters({
+      loading:'loading'
+    })
+  },
+  watch:{
+    data(val){
+      this.doLayout()
+    }
+  },
+  methods:{
+    rowClick (row) {
+      this.$emit('rowClick',row)
+    },
+    tableClassName ({row,rowIndex}) {
+      row.index = rowIndex
+    },
+    selectionChange(row){
+      this.$emit('selectionChange',row)
+    },
+    doLayout(){
+      if (this.$refs.table){
+        this.$nextTick(()=>{
+          this.$refs.table.doLayout()
+        })
+      }
+    }
+  },
+  mounted () {
+  }
+}
+
+</script>
+<style>
+</style>

+ 66 - 0
src/components/dynamic-table/index3.vue

@@ -0,0 +1,66 @@
+<template>
+  <div>
+    <!-- :header-cell-style="{background:'#EEEEEE',color:'#333'}" -->
+    <el-table ref="table" :row-class-name="tableClassName" highlight-current-row :data="data"  size="mini" :height="height ? height : data.length <= 4?'260px':data.length <= 20?'calc(100vh - 354px)':'calc(100vh - 354px)'"  @row-click="rowClick" style="width:100%;min-height:260px;" :header-cell-style="{height:'40px',color:'#606266',fontWeight:'400',fontSize:'14px'}"
+              :cell-style="{height:'40px',color:'#666666',fontWeight:'400'}" border @selection-change="selectionChange">
+      <el-table-column
+          type="selection"
+          width="35" fixed v-if="checkbox">
+      </el-table-column>
+      <el-table-column v-for="col in layout" :key="col.tablecolid" :prop="col.columnname" :label="col.title" :width="width?col.width:'150px'" :fixed="fixedName ? fixedName.indexOf(col.columnname)!= -1?redirect ? redirect : 'right' :false : false">
+        <template :slot="headerOptions ? headerOptions.includes(col.columnname) ? 'header' : '' : ''" slot-scope="scope">
+          <slot name="header" :column="{data:scope.row,columnname:col.columnname}"></slot>
+        </template>
+        <template slot-scope="scope">
+          <div class="table-panel">
+            <!-- 自定义表格显示内容 -->
+            <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>
+          </div>
+        </template>
+      </el-table-column>
+    </el-table>
+  </div>
+</template>
+
+<script>
+import {mapGetters} from "vuex"
+export default {
+  /*
+    layout:表结构数据;
+    data:表渲染数据;
+    custom:是否启用自定义结构;
+    opwidth:操作列宽度
+  */
+  props:['layout','data','custom','height','fixedName','width','checkbox','redirect','customHeader','headerOptions'],
+  data () {
+    return {
+      list:[],
+    }
+  },
+  computed:{
+    ...mapGetters({
+      loading:'loading'
+    })
+  },
+  methods:{
+    rowClick (row) {
+      this.$emit('rowClick',row)
+    },
+    tableClassName ({row,rowIndex}) {
+      row.index = rowIndex
+    },
+    selectionChange(row){
+      this.$emit('selectionChange',row)
+    }
+  },
+  mounted () {
+  }
+}
+
+</script>
+<style>
+</style>