Browse Source

添加选型单

xiaohaizhao 1 year ago
parent
commit
c7f04643eb

+ 481 - 298
src/HDrpManagement/contractManage/components/productDetailList/productDetailList.vue

@@ -1,67 +1,174 @@
 <template>
   <div>
     <div>
-      <div class="flex-align-center" style="margin-bottom:10px">
-        <el-input size="small" style="width:200px;margin-right:10px" v-model="params.content.where.condition" :placeholder="$t('输入搜索内容')" @clear="listData(params.content.pageNumber = 1)" @keyup.native.enter="listData(params.content.pageNumber = 1)" clearable></el-input>
+      <div class="flex-align-center" style="margin-bottom: 10px">
+        <el-input
+          size="small"
+          style="width: 200px; margin-right: 10px"
+          v-model="params.content.where.condition"
+          :placeholder="$t('输入搜索内容')"
+          @clear="listData((params.content.pageNumber = 1))"
+          @keyup.native.enter="listData((params.content.pageNumber = 1))"
+          clearable
+        ></el-input>
         <slot name="export"></slot>
         <uploadAllData
-            v-if="tool.checkAuth($route.name,'productDetailManage') && data.status === '新建' && isLeader"
-            :total="total"
-            @onSuccess="listData()"
-            @handlePullApi="handlePullApi"
-            @handleDelApi="handleDelApi"
-            idName="sa_contract_itemsid"
-            type="del"
+          v-if="
+            tool.checkAuth($route.name, 'productDetailManage') &&
+            data.status === '新建' &&
+            isLeader
+          "
+          :total="total"
+          @onSuccess="listData()"
+          @handlePullApi="handlePullApi"
+          @handleDelApi="handleDelApi"
+          idName="sa_contract_itemsid"
+          type="del"
         ></uploadAllData>
-        <el-button class="inline-16" size="small" v-if="tool.checkAuth($route.name,'productDetailManage') && data.status === '新建' && isLeader" :type="delProductData.length === 0?'':'primary'" @click="onDelProduct" :disabled="delProductData.length === 0">{{$t(`删 除`)}}</el-button>
-        <addProduct v-if="tool.checkAuth($route.name,'productDetailManage') && data.status === '新建' && isLeader"
-                    class="inline-16"  :params="paramsAdd" :tablecolsAdd="tablecolsAdd" title="添加" :typeName="data.type"
-                    @addSuccess="addProducts" @addProduct="addProduct" @uploadData="uploadData" @closeDrawer="closeDrawer"
-                     ref="addProduct"
+        <el-button
+          class="inline-16"
+          size="small"
+          v-if="
+            tool.checkAuth($route.name, 'productDetailManage') &&
+            data.status === '新建' &&
+            isLeader
+          "
+          :type="delProductData.length === 0 ? '' : 'primary'"
+          @click="onDelProduct"
+          :disabled="delProductData.length === 0"
+          >{{ $t(`删 除`) }}</el-button
         >
-        <!--阀门选型-->
-        <selectOption position="合同" slot="optionSystem" style="margin-left: 10px" @handleParam="handleOptionParam" v-if="tool.checkAuth($route.name,'optionSystem')"></selectOption>
+        <addProduct
+          v-if="
+            tool.checkAuth($route.name, 'productDetailManage') &&
+            data.status === '新建' &&
+            isLeader
+          "
+          class="inline-16"
+          :params="paramsAdd"
+          :tablecolsAdd="tablecolsAdd"
+          title="添加"
+          :typeName="data.type"
+          @addSuccess="addProducts"
+          @addProduct="addProduct"
+          @uploadData="uploadData"
+          @closeDrawer="closeDrawer"
+          ref="addProduct"
+        >
+          <!--阀门选型-->
+          <selectOption
+            position="合同"
+            slot="optionSystem"
+            style="margin-left: 10px"
+            @handleParam="handleOptionParam"
+            v-if="tool.checkAuth($route.name, 'optionSystem')"
+          ></selectOption>
+          <addSelectionList
+            style="margin-left: 10px"
+            slot="optionSystem"
+            sourcetable="sa_contract"
+            @showMessage="showMessage"
+            v-if="tool.checkAuth($route.name, 'addSelectionList')"
+          />
         </addProduct>
         <slot name="cooperate"></slot>
-        <exportFile v-if="tool.checkAuth($route.name,'export')" :param="params" :columns="tablecols" fileName="产品明细折扣"></exportFile>
-      </div>
-      <div class="produtMag-panel">
+        <exportFile
+          v-if="tool.checkAuth($route.name, 'export')"
+          :param="params"
+          :columns="tablecols"
+          fileName="产品明细折扣"
+        ></exportFile>
       </div>
+      <div class="produtMag-panel"></div>
       <SetOrder ref="setOrder"></SetOrder>
-      <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']">
+      <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-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="$t(item.label)"
-                  :value="item.value">
+                v-for="item in options"
+                :key="item.value"
+                :label="$t(item.label)"
+                :value="item.value"
+              >
               </el-option>
             </el-select>
-            <span v-else>{{$t('类型')}}</span>
+            <span v-else>{{ $t("类型") }}</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>-->
-            <el-input-number size="mini"  v-model="scope.column.data.qty" @change="qtyChange(scope.column.data.qty,scope.$index,scope.column.data)" :min="scope.column.data.orderminqty" :step="scope.column.data.orderaddqty"  label="描述文字" :disabled="!tool.checkAuth($route.name,'productDetailManage') || data.status !== '新建' || !isLeader"></el-input-number>
+            <!--            <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>-->
+            <el-input-number
+              size="mini"
+              v-model="scope.column.data.qty"
+              @change="
+                qtyChange(
+                  scope.column.data.qty,
+                  scope.$index,
+                  scope.column.data
+                )
+              "
+              :min="scope.column.data.orderminqty"
+              :step="scope.column.data.orderaddqty"
+              label="描述文字"
+              :disabled="
+                !tool.checkAuth($route.name, 'productDetailManage') ||
+                data.status !== '新建' ||
+                !isLeader
+              "
+            ></el-input-number>
           </div>
           <div v-else-if="scope.column.columnname == 'itemname'">
             <div v-if="scope.column.data.sa_lectotypecfgid">
-              <el-tooltip class="item" effect="dark" content="点击查看选型配置单" placement="top-start">
-                <el-button size="small" type="text" @click="$refs.setOrder.onShow(scope.column.data.sa_lectotypecfgid)">{{ scope.column.data.itemname }}</el-button>
+              <el-tooltip
+                class="item"
+                effect="dark"
+                content="点击查看选型配置单"
+                placement="top-start"
+              >
+                <el-button
+                  size="small"
+                  type="text"
+                  @click="
+                    $refs.setOrder.onShow(scope.column.data.sa_lectotypecfgid)
+                  "
+                  >{{ scope.column.data.itemname }}</el-button
+                >
               </el-tooltip>
             </div>
             <div v-else>{{ scope.column.data.itemname }}</div>
           </div>
           <div v-else-if="scope.column.columnname == 'itemno'">
-            <span :style="scope.column.data.itemid?'':'color:red'">{{ scope.column.data.itemno }}</span>
+            <span :style="scope.column.data.itemid ? '' : 'color:red'">{{
+              scope.column.data.itemno
+            }}</span>
           </div>
           <div v-else-if="scope.column.columnname == 'attinfos'">
             <previewImage
               v-if="scope.column.data.attinfos[0]"
-              style="width:38px;height:38px;margin:0px"
+              style="width: 38px; height: 38px; margin: 0px"
               class="image"
               :image="scope.column.data.attinfos[0]"
               :list="scope.column.data.attinfos"
@@ -70,8 +177,21 @@
           </div>
 
           <div v-else-if="scope.column.columnname == 'type'">
-            <el-select v-model="scope.column.data.type" @change="changeType(scope.column.data.type,scope.$index,scope.column.data)"
-            :disabled="!tool.checkAuth($route.name,'productDetailManage') || data.status !== '新建' || !isLeader" >
+            <el-select
+              v-model="scope.column.data.type"
+              @change="
+                changeType(
+                  scope.column.data.type,
+                  scope.$index,
+                  scope.column.data
+                )
+              "
+              :disabled="
+                !tool.checkAuth($route.name, 'productDetailManage') ||
+                data.status !== '新建' ||
+                !isLeader
+              "
+            >
               <el-option label="折扣系数" value="折扣系数"></el-option>
               <el-option label="指定单价" value="指定单价"></el-option>
             </el-select>
@@ -80,51 +200,85 @@
             <el-input
               size="mini"
               v-model="scope.column.data.discountrate"
-              :disabled="scope.column.data.type === '指定单价' || !tool.checkAuth($route.name,'productDetailManage') || data.status !== '新建' || !isLeader "
-              @change="discountrateChange(scope.column.data.discountrate,scope.$index,scope.column.data)"
+              :disabled="
+                scope.column.data.type === '指定单价' ||
+                !tool.checkAuth($route.name, 'productDetailManage') ||
+                data.status !== '新建' ||
+                !isLeader
+              "
+              @change="
+                discountrateChange(
+                  scope.column.data.discountrate,
+                  scope.$index,
+                  scope.column.data
+                )
+              "
             ></el-input>
           </div>
           <div v-else-if="scope.column.columnname == 'price'">
             <el-input
               size="mini"
-              :disabled="scope.column.data.type === '折扣系数' || !tool.checkAuth($route.name,'productDetailManage') || data.status !== '新建' || !isLeader"
+              :disabled="
+                scope.column.data.type === '折扣系数' ||
+                !tool.checkAuth($route.name, 'productDetailManage') ||
+                data.status !== '新建' ||
+                !isLeader
+              "
               v-model="scope.column.data.price"
-              @change="priceChange(scope.column.data.price,scope.$index,scope.column.data)"
+              @change="
+                priceChange(
+                  scope.column.data.price,
+                  scope.$index,
+                  scope.column.data
+                )
+              "
             ></el-input>
           </div>
           <div v-else-if="scope.column.columnname == 'countPrice'">
-            <span>{{tool.formatAmount(scope.column.data.price * scope.column.data.qty,2)}}</span>
+            <span>{{
+              tool.formatAmount(
+                scope.column.data.price * scope.column.data.qty,
+                2
+              )
+            }}</span>
           </div>
           <div v-else-if="scope.column.columnname == 'marketprice'">
-            <span>{{tool.formatAmount((scope.column.data.marketprice),2)}}</span>
+            <span>{{
+              tool.formatAmount(scope.column.data.marketprice, 2)
+            }}</span>
           </div>
           <div v-else-if="scope.column.columnname == 'amount'">
-            <span>{{tool.formatAmount((scope.column.data.amount),2)}}</span>
+            <span>{{ tool.formatAmount(scope.column.data.amount, 2) }}</span>
           </div>
           <div v-else-if="scope.column.columnname == 'brand'">
-            {{scope.column.data[scope.column.columnname][0] && scope.column.data[scope.column.columnname][0].brandname}}
+            {{
+              scope.column.data[scope.column.columnname][0] &&
+              scope.column.data[scope.column.columnname][0].brandname
+            }}
           </div>
-          <span v-else>{{$t(scope.column.data[scope.column.columnname])}}</span>
-        </template>
-        <template v-slot:opreation="scope">
+          <span v-else>{{
+            $t(scope.column.data[scope.column.columnname])
+          }}</span>
         </template>
+        <template v-slot:opreation="scope"> </template>
       </tableLayout>
     </div>
-     <div style="height: 35px;margin-top: 16px">
-<!--      <div v-if="$route.query.type != '框架'" style="float: left">金额(元):{{ data.signamount ? tool.formatAmount(data.signamount,2) : '0.00'}}</div>-->
+    <div style="height: 35px; margin-top: 16px">
+      <!--      <div v-if="$route.query.type != '框架'" style="float: left">金额(元):{{ data.signamount ? tool.formatAmount(data.signamount,2) : '0.00'}}</div>-->
       <div style="float: right">
         <el-pagination
-            background
-            @size-change="handleSizeChange"
-            @current-change="handleCurrentChange"
-            :current-page="params.content.pageNumber"
-            :page-sizes="[20, 50, 100, 200]"
-            :page-size="20"
-            layout="total,sizes, prev, pager, next, jumper"
-            :total="total">
+          background
+          @size-change="handleSizeChange"
+          @current-change="handleCurrentChange"
+          :current-page="params.content.pageNumber"
+          :page-sizes="[20, 50, 100, 200]"
+          :page-size="20"
+          layout="total,sizes, prev, pager, next, jumper"
+          :total="total"
+        >
         </el-pagination>
       </div>
-     </div>
+    </div>
   </div>
 </template>
 
@@ -132,124 +286,141 @@
 // import edit from './editProduct'
 
 // import addProduct from './addProduct'
-import addProduct from '@/template/addProduct'
-import previewImage from '@/components/previewImage/index'
-import uploadAllData from '@/components/uploadAllData/index'
-import tableLayout from '@/components/dynamic-table/index3'
-import exportFile from '@/components/export_file/index1'
-import SelectOption from '@/optionSystem/selectOption/add.vue'
-import SetOrder from '@/optionSystem/selectOption/components/setOrder.vue'
+import addProduct from "@/template/addProduct";
+import previewImage from "@/components/previewImage/index";
+import uploadAllData from "@/components/uploadAllData/index";
+import tableLayout from "@/components/dynamic-table/index3";
+import exportFile from "@/components/export_file/index1";
+import SelectOption from "@/optionSystem/selectOption/add.vue";
+import SetOrder from "@/optionSystem/selectOption/components/setOrder.vue";
+import addSelectionList from "@/SDrpManagement/QuotedPrice/detail/modules/productInventory/addSelectionList";
+
 export default {
-  components: {addProduct,previewImage,uploadAllData,tableLayout,exportFile,SelectOption,SetOrder},
-  name: '',
-  props:["data","isLeader"],
+  components: {
+    addProduct,
+    previewImage,
+    uploadAllData,
+    tableLayout,
+    exportFile,
+    SelectOption,
+    SetOrder,
+    addSelectionList
+  },
+  name: "",
+  props: ["data", "isLeader"],
   data() {
     return {
-      list:[],
-      delProductData:[],
-      paramsAdd:{
-        "id": 20221124093602,
-        "content": {
-          "sa_contractid": this.$route.query.id,
-          "pageNumber": 1,
-          "pageSize": 100,
-          "where": {
-            "condition": "",
-            "istool":0//是否是工具
-          }
+      list: [],
+      delProductData: [],
+      paramsAdd: {
+        id: 20221124093602,
+        content: {
+          sa_contractid: this.$route.query.id,
+          pageNumber: 1,
+          pageSize: 100,
+          where: {
+            condition: "",
+            istool: 0, //是否是工具
+          },
         },
       },
       params: {
-          "id": 20221122165302,
-          "content": {
-              "sa_contractid": this.$route.query.id,
-              "pageNumber": 1,
-              "pageSize": 20,
-              "where": {
-                  "condition": "",
-              }
+        id: 20221122165302,
+        content: {
+          sa_contractid: this.$route.query.id,
+          pageNumber: 1,
+          pageSize: 20,
+          where: {
+            condition: "",
           },
+        },
       },
       form: {
-        itemid:'',
-        sa_contract_itemsid:'',
-        qty:'',
-        discountrate:'',
-        price:'',
-        type:''
+        itemid: "",
+        sa_contract_itemsid: "",
+        qty: "",
+        discountrate: "",
+        price: "",
+        type: "",
       },
-      tablecols:[],
-      tablecolsAdd:[],
-      total:0,
-      totalPage:0,
-      editIndex:'',
-      options: [{
-        value: '折扣系数',
-        label: '折扣系数'
-      }, {
-        value: '指定单价',
-        label: '指定单价'
-      }],
-      value: ''
+      tablecols: [],
+      tablecolsAdd: [],
+      total: 0,
+      totalPage: 0,
+      editIndex: "",
+      options: [
+        {
+          value: "折扣系数",
+          label: "折扣系数",
+        },
+        {
+          value: "指定单价",
+          label: "指定单价",
+        },
+      ],
+      value: "",
     };
   },
-  computed:{
-  },
-  watch:{
-  },
-  created () {
-    if (this.$route.query.id) this.listData()
-    this.tablecols = this.$route.query.type == '居间'?this.tool.tabelCol(this.$route.name).productDetaiIntermediationTable.tablecols:this.tool.tabelCol(this.$route.name).productDetailTable.tablecols
-    this.$route.query.type == '框架' && this.tablecols.forEach((item,index) => {
-      if (item.columnname == 'qty' || item.columnname == 'amount') {
-        this.tablecols.splice(index,1)
-      }
-    })
-    this.tablecolsAdd = this.tool.tabelCol(this.$route.name).addProductTable.tablecols
-
+  computed: {},
+  watch: {},
+  created() {
+    if (this.$route.query.id) this.listData();
+    this.tablecols =
+      this.$route.query.type == "居间"
+        ? this.tool.tabelCol(this.$route.name).productDetaiIntermediationTable
+            .tablecols
+        : this.tool.tabelCol(this.$route.name).productDetailTable.tablecols;
+    this.$route.query.type == "框架" &&
+      this.tablecols.forEach((item, index) => {
+        if (item.columnname == "qty" || item.columnname == "amount") {
+          this.tablecols.splice(index, 1);
+        }
+      });
+    this.tablecolsAdd = this.tool.tabelCol(
+      this.$route.name
+    ).addProductTable.tablecols;
   },
   methods: {
-    async listData(){
-      this.params.content.sa_contractid = this.$route.query.id
-      const res = await this.$api.requested(this.params)
-      res.data.forEach((e,index)=>{
-        res.data[index].discountrate = Math.round((e.discountrate * 100)*100)/100
-      })
+    async listData() {
+      this.params.content.sa_contractid = this.$route.query.id;
+      const res = await this.$api.requested(this.params);
+      res.data.forEach((e, index) => {
+        res.data[index].discountrate =
+          Math.round(e.discountrate * 100 * 100) / 100;
+      });
       /*this.list = this.params.content.pageNumber == 1 ? res.data : this.list.concat(res.data)*/
-      this.list = res.data
-      console.log(this.list,res.data);
-      this.total = res.total
-      this.totalPage = res.pageTotal
+      this.list = res.data;
+      console.log(this.list, res.data);
+      this.total = res.total;
+      this.totalPage = res.pageTotal;
       // this.$emit('priceChange')
     },
     //处理选型请求参数
-    handleOptionParam (param) {
-      param.content.enterprisename = this.data.enterprisename
-      param.content.projectname = this.data.projectname
-      param.content.sourcetable = 'sa_contract'
-      param.content.source = `合同:${this.data.billno}`
-    },
-    tableLoad () {
-      if (this.params.content.pageNumber == this.totalPage) return
-      this.params.content.pageNumber += 1
-      this.listData()
-      console.log('触底');
+    handleOptionParam(param) {
+      param.content.enterprisename = this.data.enterprisename;
+      param.content.projectname = this.data.projectname;
+      param.content.sourcetable = "sa_contract";
+      param.content.source = `合同:${this.data.billno}`;
     },
-    qtyChange (num,index,data) {
-      data.qty = num
-      this.$set(this.list,index,data)
-      this.save(data)
+    tableLoad() {
+      if (this.params.content.pageNumber == this.totalPage) return;
+      this.params.content.pageNumber += 1;
+      this.listData();
+      console.log("触底");
     },
-    handleChange(num) {
-
+    qtyChange(num, index, data) {
+      data.qty = num;
+      this.$set(this.list, index, data);
+      this.save(data);
     },
-    changeType(num,index,data){
-      console.log(num)
-      data.type = num
-      this.$set(this.list,index,data)
-      this.save(data)
+    handleChange(num) {},
+    changeType(num, index, data) {
+      console.log(num);
+      data.type = num;
+      this.$set(this.list, index, data);
+      this.save(data);
     },
-    discountrateChange (num,index,data) {
+    discountrateChange(num, index, data) {
       // if (num > 100){
       //   data.discountrate = 100
       // }else if (num < 0){
@@ -257,13 +428,13 @@ export default {
       // }else {
       //   data.discountrate = Math.round(num*100)/100
       // }
-      data.discountrate = Math.round(num*100)/100
+      data.discountrate = Math.round(num * 100) / 100;
 
-      data.price = (data.discountrate / 100 * data.marketprice).toFixed(2)
-      this.$set(this.list,index,data)
-      this.save(data)
+      data.price = ((data.discountrate / 100) * data.marketprice).toFixed(2);
+      this.$set(this.list, index, data);
+      this.save(data);
     },
-    priceChange (num,index,data) {
+    priceChange(num, index, data) {
       // if (num > data.marketprice){
       //   data.price = data.marketprice
       // }else if (num < 0 ){
@@ -271,200 +442,212 @@ export default {
       // }else {
       //   data.price = Math.round(num*100)/100
       // }
-      data.price = Math.round(num*100)/100
+      data.price = Math.round(num * 100) / 100;
 
-      console.log(data.price)
-      data.discountrate = Math.round((data.price / data.marketprice * 100)*100)/100
-      console.log(data.discountrate)
-      this.$set(this.list,index,data)
-      this.save(data)
+      console.log(data.price);
+      data.discountrate =
+        Math.round((data.price / data.marketprice) * 100 * 100) / 100;
+      console.log(data.discountrate);
+      this.$set(this.list, index, data);
+      this.save(data);
     },
-    async save (data) {
+    async save(data) {
       let res = await this.$api.requested({
-        "id": 20221122200302,
-        "content": {
-          "sa_contractid":this.$route.query.id,
-          "items": [
+        id: 20221122200302,
+        content: {
+          sa_contractid: this.$route.query.id,
+          items: [
             {
-              marketprice:data.marketprice,
-              itemid:data.itemid,
-              sa_contract_itemsid:data.sa_contract_itemsid,
-              qty:data.qty,
-              discountrate:(data.discountrate/100).toFixed(4),
-              price:data.price,
-              type:data.type
-            }
-          ]
+              marketprice: data.marketprice,
+              itemid: data.itemid,
+              sa_contract_itemsid: data.sa_contract_itemsid,
+              qty: data.qty,
+              discountrate: (data.discountrate / 100).toFixed(4),
+              price: data.price,
+              type: data.type,
+            },
+          ],
         },
-      })
-      this.tool.showMessage(res,() => {
-        this.editIndex = ''
-        this.listData()
-        this.$emit('editSuccess',res.data.signamount)
-      })
+      });
+      this.tool.showMessage(res, () => {
+        this.editIndex = "";
+        this.listData();
+        this.$emit("editSuccess", res.data.signamount);
+      });
     },
     handleSizeChange(val) {
       // console.log(`每页 ${val} 条`);
-      this.params.content.pageSize = val
-      this.listData()
+      this.params.content.pageSize = val;
+      this.listData();
     },
     handleCurrentChange(val) {
       // console.log(`当前页: ${val}`);
-      this.params.content.pageNumber = val
-      this.listData()
+      this.params.content.pageNumber = val;
+      this.listData();
     },
     /*批量添加*/
-    async addProducts(data){
-      let item = data.map(item => {
+    async addProducts(data) {
+      let item = data.map((item) => {
         return {
-          "itemid": item.itemid,
-          "price": item.marketprice,
-          "qty": item.orderminqty,
-          'marketprice':item.marketprice,
-          type:'折扣系数'
-        }
-      })
+          itemid: item.itemid,
+          price: item.marketprice,
+          qty: item.orderminqty,
+          marketprice: item.marketprice,
+          type: "折扣系数",
+        };
+      });
       const res = await this.$api.requested({
-        "id": 20221123164402,
-        "content": {
-          "sa_contractid": this.$route.query.id,
-          "items": item
+        id: 20221123164402,
+        content: {
+          sa_contractid: this.$route.query.id,
+          items: item,
         },
-      })
-      this.tool.showMessage(res,()=>{
-        this.list.unshift(...res.data)
+      });
+      this.tool.showMessage(res, () => {
+        this.list.unshift(...res.data);
         // this.listData()
-        this.$refs.addProduct.listData()
-      })
+        this.$refs.addProduct.listData();
+      });
     },
     /*单独添加*/
-    async addProduct(data){
+    async addProduct(data) {
       let res = await this.$api.requested({
-        "id": 20221123164402,
-        "content": {
-          "sa_contractid": this.$route.query.id,
-          "items": [
+        id: 20221123164402,
+        content: {
+          sa_contractid: this.$route.query.id,
+          items: [
             {
-              "itemid": data.itemid,
-              "price": data.marketprice,
-              "qty": data.orderminqty,
-              'marketprice':data.marketprice,
-              type:'折扣系数'
-            }
-          ]
+              itemid: data.itemid,
+              price: data.marketprice,
+              qty: data.orderminqty,
+              marketprice: data.marketprice,
+              type: "折扣系数",
+            },
+          ],
         },
-      })
-      this.tool.showMessage(res,() => {
-        this.list.unshift(res.data[0])
-        console.log(this.list[0],res.data);
+      });
+      this.tool.showMessage(res, () => {
+        this.list.unshift(res.data[0]);
+        console.log(this.list[0], res.data);
         // this.listData()
-        this.$refs.addProduct.listData()
-      })
+        this.$refs.addProduct.listData();
+      });
+    },
+    showMessage(res) {
+      this.tool.showMessage(res, () => {
+        this.listData()
+        this.$refs.addProduct.listData();
+      });
     },
     /*一键添加*/
-    uploadData(uploadApi,data){
-      uploadApi.id = 20221123164402
+    uploadData(uploadApi, data) {
+      uploadApi.id = 20221123164402;
       uploadApi.content = {
-        "sa_contractid": this.$route.query.id, //订单ID
-        "items": data.map(e=>{
+        sa_contractid: this.$route.query.id, //订单ID
+        items: data.map((e) => {
           return {
-            "itemid": e.itemid,
-            "price": e.marketprice,
-            "qty": e.orderminqty,
-            'marketprice':e.marketprice,
-            type:'折扣系数'
-          }
-        })
-      }
-      this.listData()
-      this.$refs.addProduct.listData()
+            itemid: e.itemid,
+            price: e.marketprice,
+            qty: e.orderminqty,
+            marketprice: e.marketprice,
+            type: "折扣系数",
+          };
+        }),
+      };
+      this.listData();
+      this.$refs.addProduct.listData();
     },
     /*获取要删除的数据*/
-    handlePullApi (pullApi) {
-      pullApi.content = JSON.parse(JSON.stringify(this.params.content))
-      pullApi.id = 20221122165302
-      pullApi.content.sa_contractid = this.$route.query.id
+    handlePullApi(pullApi) {
+      pullApi.content = JSON.parse(JSON.stringify(this.params.content));
+      pullApi.id = 20221122165302;
+      pullApi.content.sa_contractid = this.$route.query.id;
     },
     /*一键删除*/
-    handleDelApi (delApi,data) {
-      delApi.id = 20221123164502
+    handleDelApi(delApi, data) {
+      delApi.id = 20221123164502;
       delApi.content = {
-        "sa_contractid":this.$route.query.id,
-        "sa_contract_itemsids":data,
-        "pageNumber":0,
-        "pageSize":0
-      }
-      this.listData()
+        sa_contractid: this.$route.query.id,
+        sa_contract_itemsids: data,
+        pageNumber: 0,
+        pageSize: 0,
+      };
+      this.listData();
     },
-    selectionChange(val){
-      this.delProductData = []
-      val.forEach((item,index) => {
-        this.delProductData[index] = item.sa_contract_itemsid
-      })
+    selectionChange(val) {
+      this.delProductData = [];
+      val.forEach((item, index) => {
+        this.delProductData[index] = item.sa_contract_itemsid;
+      });
     },
     /*批量删除判断*/
     onDelProduct() {
-      this.$confirm(this.$t('此操作将删除这些商品, 是否继续') + '?', this.$t('提示'), {
-        confirmButtonText: this.$t('确定'),
-        cancelButtonText: this.$t('取消'),
-        type: 'warning'
-      }).then(() => {
-        this.delProduct()
-      }).catch(() => {
-        this.$message({
-          type: 'info',
-          message: this.$t('取消删除')
+      this.$confirm(
+        this.$t("此操作将删除这些商品, 是否继续") + "?",
+        this.$t("提示"),
+        {
+          confirmButtonText: this.$t("确定"),
+          cancelButtonText: this.$t("取消"),
+          type: "warning",
+        }
+      )
+        .then(() => {
+          this.delProduct();
+        })
+        .catch(() => {
+          this.$message({
+            type: "info",
+            message: this.$t("取消删除"),
+          });
         });
-      });
     },
     /*批量删除商品*/
-    async delProduct(){
+    async delProduct() {
       const res = await this.$api.requested({
-        "id": 20221123164502,
-        "content": {
-          "sa_contractid":this.$route.query.id,
-          "sa_contract_itemsids":this.delProductData
+        id: 20221123164502,
+        content: {
+          sa_contractid: this.$route.query.id,
+          sa_contract_itemsids: this.delProductData,
         },
-      })
-      this.tool.showMessage(res,()=>{
+      });
+      this.tool.showMessage(res, () => {
         // this.listData()
-        this.list.forEach(item => {
-          this.delProductData.forEach(item2 => {
+        this.list.forEach((item) => {
+          this.delProductData.forEach((item2) => {
             if (item.sa_contract_itemsid == item2) {
-              this.list.splice(this.list.indexOf(item),1)
+              this.list.splice(this.list.indexOf(item), 1);
             }
-          })
-        })
-        this.listData()
-        this.$emit("delSuccess")
-      })
+          });
+        });
+        this.listData();
+        this.$emit("delSuccess");
+      });
     },
-    closeDrawer(){
-      this.listData()
-      this.$emit("closeDrawer")
+    closeDrawer() {
+      this.listData();
+      this.$emit("closeDrawer");
     },
     /*选择类型*/
-    async typeSelect(){
+    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()
-      })
-
-    }
+        id: 20240110154404,
+        content: {
+          sa_contractid: this.$route.query.id,
+          sa_contract_itemsids: [],
+          isAll: 1,
+          type: this.value,
+        },
+      });
+      this.tool.showMessage(res, () => {
+        this.listData();
+      });
+    },
   },
 };
 </script>
 
 <style scoped>
-/deep/ .el-input.is-disabled .el-input__inner{
+/deep/ .el-input.is-disabled .el-input__inner {
   color: #666666;
 }
 </style>

+ 529 - 323
src/HDrpManagement/contractManage/components/productList/productBillno.vue

@@ -1,44 +1,141 @@
 <template>
   <div>
     <div>
-      <div class="flex-align-center" style="margin-bottom:10px">
-        <el-input size="small" style="width:200px;margin-right:10px" v-model="params.content.where.condition" :placeholder="$t(`输入搜索内容`)" @clear="listData(params.content.pageNumber = 1)" @keyup.native.enter="listData(params.content.pageNumber = 1)" clearable></el-input>
-        <slot name="addProduct"/>
+      <div class="flex-align-center" style="margin-bottom: 10px">
+        <el-input
+          size="small"
+          style="width: 200px; margin-right: 10px"
+          v-model="params.content.where.condition"
+          :placeholder="$t(`输入搜索内容`)"
+          @clear="listData((params.content.pageNumber = 1))"
+          @keyup.native.enter="listData((params.content.pageNumber = 1))"
+          clearable
+        ></el-input>
+        <slot name="addProduct" />
         <uploadAllData
-            v-if="tool.checkAuth($route.name,'productBillManage') && data.status === '新建' && isLeader"
-            :total="total"
-            @onSuccess="listData();$emit('onSuccess')"
-            @handlePullApi="handlePullApi"
-            @handleDelApi="handleDelApi"
-            idName="sa_contract_itemsid"
-            type="del"
+          v-if="
+            tool.checkAuth($route.name, 'productBillManage') &&
+            data.status === '新建' &&
+            isLeader
+          "
+          :total="total"
+          @onSuccess="
+            listData();
+            $emit('onSuccess');
+          "
+          @handlePullApi="handlePullApi"
+          @handleDelApi="handleDelApi"
+          idName="sa_contract_itemsid"
+          type="del"
         ></uploadAllData>
-        <el-button class="inline-16" v-if="tool.checkAuth($route.name,'productBillManage') && data.status === '新建' && isLeader" size="small" :type="delProductData.length === 0?'':'primary'" @click="onDelProduct" :disabled="delProductData.length === 0">{{$t(`删 除`)}}</el-button>
-        <addProductContract class="inline-16"  title="自报价单添加" :tablecolsAdd="tablecolsAdd" :tradefield="data.tradefield" :data="data"  @closeDrawer="closeDrawer"
-                            @addSuccess="queryProuctAdds" @addAll="addAll" ref="addProduct" @addProduct="queryProuctAdd" @uploadData="queryUploadData" v-if="tool.checkAuth($route.name,'productBillManage') && data.status === '新建' && isLeader"
+        <el-button
+          class="inline-16"
+          v-if="
+            tool.checkAuth($route.name, 'productBillManage') &&
+            data.status === '新建' &&
+            isLeader
+          "
+          size="small"
+          :type="delProductData.length === 0 ? '' : 'primary'"
+          @click="onDelProduct"
+          :disabled="delProductData.length === 0"
+          >{{ $t(`删 除`) }}</el-button
+        >
+        <addProductContract
+          class="inline-16"
+          title="自报价单添加"
+          :tablecolsAdd="tablecolsAdd"
+          :tradefield="data.tradefield"
+          :data="data"
+          @closeDrawer="closeDrawer"
+          @addSuccess="queryProuctAdds"
+          @addAll="addAll"
+          ref="addProduct"
+          @addProduct="queryProuctAdd"
+          @uploadData="queryUploadData"
+          v-if="
+            tool.checkAuth($route.name, 'productBillManage') &&
+            data.status === '新建' &&
+            isLeader
+          "
         >
         </addProductContract>
-        <addProduct v-if="tool.checkAuth($route.name,'productBillManage') && data.status === '新建' && isLeader"
-                    class="inline-16" @productAdd="queryProuctAdd" :params="paramProductAdd" :tablecolsAdd="tablecolsProductAdd" title="自产品档案添加"
-                    @addSuccess="queryProuctAdds" @addProduct="queryProuctAdd" @uploadData="queryUploadData" @closeDrawer="closeDrawer"
-                    :tradefield="data.tradefield" ref="addArchivesProduct"
+        <addProduct
+          v-if="
+            tool.checkAuth($route.name, 'productBillManage') &&
+            data.status === '新建' &&
+            isLeader
+          "
+          class="inline-16"
+          @productAdd="queryProuctAdd"
+          :params="paramProductAdd"
+          :tablecolsAdd="tablecolsProductAdd"
+          title="自产品档案添加"
+          @addSuccess="queryProuctAdds"
+          @addProduct="queryProuctAdd"
+          @uploadData="queryUploadData"
+          @closeDrawer="closeDrawer"
+          :tradefield="data.tradefield"
+          ref="addArchivesProduct"
         >
           <!--阀门选型-->
-          <selectOption position="报价单" slot="optionSystem" style="margin-left: 10px" @handleParam="handleOptionParam"  v-if="tool.checkAuth($route.name,'optionSystem')"></selectOption>
+          <selectOption
+            position="报价单"
+            slot="optionSystem"
+            style="margin-left: 10px"
+            @handleParam="handleOptionParam"
+            v-if="tool.checkAuth($route.name, 'optionSystem')"
+          ></selectOption>
+          <addSelectionList
+            style="margin-left: 10px"
+            slot="optionSystem"
+            sourcetable="sa_contract"
+            @showMessage="showMessage"
+            v-if="tool.checkAuth($route.name, 'addSelectionList')"
+          />
         </addProduct>
-        <exportFile v-if="tool.checkAuth($route.name,'export')" :param="params" :columns="tablecols" fileName="产品明细折扣"></exportFile>
+        <exportFile
+          v-if="tool.checkAuth($route.name, 'export')"
+          :param="params"
+          :columns="tablecols"
+          fileName="产品明细折扣"
+        ></exportFile>
         <slot name="cooperate"></slot>
       </div>
       <SetOrder ref="setOrder"></SetOrder>
-      <tableLayout checkbox="true" :layout="tablecols" :data="list" :width="true" :opwidth="200" height="calc(100vh - 380px)" :custom="true" fixedName="operation countPrice" @selectionChange="selectionChange">
+      <tableLayout
+        checkbox="true"
+        :layout="tablecols"
+        :data="list"
+        :width="true"
+        :opwidth="200"
+        height="calc(100vh - 380px)"
+        :custom="true"
+        fixedName="operation countPrice"
+        @selectionChange="selectionChange"
+      >
         <template v-slot:customcol="scope">
           <div v-if="scope.column.columnname == 'qty'">
-            <el-input-number size="mini" v-model="scope.column.data.qty" @change="qtyChange($event,scope.column.data,scope.column.data.index)" :min="scope.column.data.orderminqty" :step="scope.column.data.orderaddqty" label="描述文字" :disabled="!tool.checkAuth($route.name,'productBillManage') || data.status !== '新建' || !isLeader"></el-input-number>
+            <el-input-number
+              size="mini"
+              v-model="scope.column.data.qty"
+              @change="
+                qtyChange($event, scope.column.data, scope.column.data.index)
+              "
+              :min="scope.column.data.orderminqty"
+              :step="scope.column.data.orderaddqty"
+              label="描述文字"
+              :disabled="
+                !tool.checkAuth($route.name, 'productBillManage') ||
+                data.status !== '新建' ||
+                !isLeader
+              "
+            ></el-input-number>
           </div>
           <div v-else-if="scope.column.columnname == 'attinfos'">
             <previewImage
               v-if="scope.column.data.attinfos[0]"
-              style="width:38px;height:38px;margin:0px"
+              style="width: 38px; height: 38px; margin: 0px"
               class="image"
               :image="scope.column.data.attinfos[0]"
               :list="scope.column.data.attinfos"
@@ -46,43 +143,112 @@
             ></previewImage>
           </div>
           <div v-else-if="scope.column.columnname == 'remarks'">
-            <el-input size="mini" v-if="editIndex == scope.column.data.sa_contract_itemsid" v-model="form.remarks" @change="remarksChange($event,scope.column.data,scope.column.data.index)" ></el-input>
-            <p v-else>{{$t(scope.column.data[scope.column.columnname])}}</p>
+            <el-input
+              size="mini"
+              v-if="editIndex == scope.column.data.sa_contract_itemsid"
+              v-model="form.remarks"
+              @change="
+                remarksChange(
+                  $event,
+                  scope.column.data,
+                  scope.column.data.index
+                )
+              "
+            ></el-input>
+            <p v-else>{{ $t(scope.column.data[scope.column.columnname]) }}</p>
           </div>
           <div v-else-if="scope.column.columnname == 'itemno'">
-            <span :style="scope.column.data.itemid?'':'color:red'">{{ scope.column.data.itemno }}</span>
+            <span :style="scope.column.data.itemid ? '' : 'color:red'">{{
+              scope.column.data.itemno
+            }}</span>
           </div>
           <div v-else-if="scope.column.columnname == 'discountrate'">
-            <el-input size="mini"v-model="scope.column.data.discountrate" @change="discountrateChange($event,scope.column.data,scope.column.data.index)" :disabled="!tool.checkAuth($route.name,'productBillManage') || data.status !== '新建' || !isLeader"></el-input>
+            <el-input
+              size="mini"
+              v-model="scope.column.data.discountrate"
+              @change="
+                discountrateChange(
+                  $event,
+                  scope.column.data,
+                  scope.column.data.index
+                )
+              "
+              :disabled="
+                !tool.checkAuth($route.name, 'productBillManage') ||
+                data.status !== '新建' ||
+                !isLeader
+              "
+            ></el-input>
           </div>
           <div v-else-if="scope.column.columnname == 'price'">
-            <el-input size="mini"  v-model="scope.column.data.price" @change="priceChange($event,scope.column.data,scope.column.data.index)" :disabled="!tool.checkAuth($route.name,'productBillManage') || data.status !== '新建' || !isLeader"></el-input>
+            <el-input
+              size="mini"
+              v-model="scope.column.data.price"
+              @change="
+                priceChange($event, scope.column.data, scope.column.data.index)
+              "
+              :disabled="
+                !tool.checkAuth($route.name, 'productBillManage') ||
+                data.status !== '新建' ||
+                !isLeader
+              "
+            ></el-input>
           </div>
           <div v-else-if="scope.column.columnname == 'countPrice'">
-            <p>{{tool.formatAmount((scope.column.data.price * scope.column.data.qty),2)}}</p>
+            <p>
+              {{
+                tool.formatAmount(
+                  scope.column.data.price * scope.column.data.qty,
+                  2
+                )
+              }}
+            </p>
           </div>
           <div v-else-if="scope.column.columnname == 'marketprice'">
-            <p>{{tool.formatAmount((scope.column.data.marketprice),2)}}</p>
+            <p>{{ tool.formatAmount(scope.column.data.marketprice, 2) }}</p>
           </div>
           <div v-else-if="scope.column.columnname == 'brand'">
-            {{scope.column.data[scope.column.columnname][0] && scope.column.data[scope.column.columnname][0].brandname}}
+            {{
+              scope.column.data[scope.column.columnname][0] &&
+              scope.column.data[scope.column.columnname][0].brandname
+            }}
           </div>
           <div v-else-if="scope.column.columnname == 'itemname'">
             <div v-if="scope.column.data.sa_lectotypecfgid">
-              <el-tooltip class="item" effect="dark" content="点击查看选型配置单" placement="top-start">
-                <el-button size="small" type="text" @click="$refs.setOrder.onShow(scope.column.data.sa_lectotypecfgid)">{{ scope.column.data.itemname }}</el-button>
+              <el-tooltip
+                class="item"
+                effect="dark"
+                content="点击查看选型配置单"
+                placement="top-start"
+              >
+                <el-button
+                  size="small"
+                  type="text"
+                  @click="
+                    $refs.setOrder.onShow(scope.column.data.sa_lectotypecfgid)
+                  "
+                  >{{ scope.column.data.itemname }}</el-button
+                >
               </el-tooltip>
             </div>
             <div v-else>{{ scope.column.data.itemname }}</div>
           </div>
-          <p v-else>{{$t(scope.column.data[scope.column.columnname])}}</p>
-          <p v-if="!scope.column.data[scope.column.columnname] && scope.column.data[[scope.column.columnname]] !== 0 && scope.column.columnname != 'operation' && scope.column.columnname != 'countPrice'">--</p>
-        </template>
-        <template v-slot:opreation="scope">
+          <p v-else>{{ $t(scope.column.data[scope.column.columnname]) }}</p>
+          <p
+            v-if="
+              !scope.column.data[scope.column.columnname] &&
+              scope.column.data[[scope.column.columnname]] !== 0 &&
+              scope.column.columnname != 'operation' &&
+              scope.column.columnname != 'countPrice'
+            "
+          >
+            --
+          </p>
         </template>
+        <template v-slot:opreation="scope"> </template>
       </tableLayout>
     </div>
-<!--    <div style="margin-top:16px;text-align:right">
+    <!--    <div style="margin-top:16px;text-align:right">
       <el-pagination
           background
           small
@@ -94,135 +260,150 @@
           :total="total">
       </el-pagination>
     </div>-->
-    <div style="height: 35px;margin-top: 20px">
+    <div style="height: 35px; margin-top: 20px">
       <div style="float: left">合计(元):{{ totalPrice }}</div>
       <div style="float: right">
         <el-pagination
-            background
-            @size-change="handleSizeChange"
-            @current-change="handleCurrentChange"
-            :current-page="params.content.pageNumber"
-            :page-sizes="[20, 50, 100, 200]"
-            :page-size="100"
-            layout="total,sizes, prev, pager, next, jumper"
-            :total="total">
+          background
+          @size-change="handleSizeChange"
+          @current-change="handleCurrentChange"
+          :current-page="params.content.pageNumber"
+          :page-sizes="[20, 50, 100, 200]"
+          :page-size="100"
+          layout="total,sizes, prev, pager, next, jumper"
+          :total="total"
+        >
         </el-pagination>
       </div>
-
     </div>
   </div>
 </template>
 
 <script>
 // import edit from './editProduct'
-import tableLayout from '@/components/dynamic-table/index2'
+import tableLayout from "@/components/dynamic-table/index2";
 // import addProduct from './addProduct'
-import previewImage from '@/components/previewImage/index'
-import addProductContract from '@/template/addProductContract/index'
-import uploadAllData from '@/components/uploadAllData/index'
-import exportFile from '@/components/export_file/index1'
-import addProduct from '@/template/addProduct'
-import SelectOption from '@/optionSystem/selectOption/add.vue'
-import SetOrder from '@/optionSystem/selectOption/components/setOrder.vue'
+import previewImage from "@/components/previewImage/index";
+import addProductContract from "@/template/addProductContract/index";
+import uploadAllData from "@/components/uploadAllData/index";
+import exportFile from "@/components/export_file/index1";
+import addProduct from "@/template/addProduct";
+import SelectOption from "@/optionSystem/selectOption/add.vue";
+import SetOrder from "@/optionSystem/selectOption/components/setOrder.vue";
+import addSelectionList from "@/SDrpManagement/QuotedPrice/detail/modules/productInventory/addSelectionList";
+
 export default {
-  components: {addProduct,previewImage,addProductContract,uploadAllData,tableLayout,exportFile,SelectOption,SetOrder},
-  name: '',
-  props:["data","isLeader"],
+  components: {
+    addProduct,
+    previewImage,
+    addProductContract,
+    uploadAllData,
+    tableLayout,
+    exportFile,
+    SelectOption,
+    SetOrder,
+    addSelectionList,
+  },
+  name: "",
+  props: ["data", "isLeader"],
   data() {
     return {
-      list:[],
-      delProductData:[],
+      list: [],
+      delProductData: [],
       params: {
-      "id": 20221122165302,
-        "content": {
-          "sa_contractid": '',
-          "pageNumber": 1,
-          "pageSize": 100,
-          "where": {
-              "condition": ""
-          }
+        id: 20221122165302,
+        content: {
+          sa_contractid: "",
+          pageNumber: 1,
+          pageSize: 100,
+          where: {
+            condition: "",
+          },
         },
       },
       form: {
-        qty:'',
-        discountrate:'',
-        price:'',
+        qty: "",
+        discountrate: "",
+        price: "",
       },
-      tablecols:[],
-      tablecolsAdd:[],
-      tablecolsProductAdd:[],
-      total:0,
-      editIndex:'',
-      totalPrice:0,
-      paramProductAdd:{
-        "id": 20221124093602,
-        "content": {
-          "sa_contractid": this.$route.query.id,
-          "pageNumber": 1,
-          "pageSize": 100,
-          "where": {
-            "condition": "",
-            "istool": 0
-          }
+      tablecols: [],
+      tablecolsAdd: [],
+      tablecolsProductAdd: [],
+      total: 0,
+      editIndex: "",
+      totalPrice: 0,
+      paramProductAdd: {
+        id: 20221124093602,
+        content: {
+          sa_contractid: this.$route.query.id,
+          pageNumber: 1,
+          pageSize: 100,
+          where: {
+            condition: "",
+            istool: 0,
+          },
         },
-      }
+      },
     };
   },
-  computed:{
-  },
-  watch:{
-    "data":function (val){
-      if(val){
-        this.listData()
+  computed: {},
+  watch: {
+    data: function (val) {
+      if (val) {
+        this.listData();
       }
-    }
-  },
-  created () {
-    if (this.$route.query.id) this.listData()
-    this.tablecols = this.tool.tabelCol(this.$route.name).productBillnoTable.tablecols
-    this.tablecolsAdd = this.tool.tabelCol(this.$route.name).addProuctProject.tablecols
-    this.tablecolsProductAdd = this.tool.tabelCol(this.$route.name).productArchivesTable.tablecols
+    },
   },
-  mounted() {
-
+  created() {
+    if (this.$route.query.id) this.listData();
+    this.tablecols = this.tool.tabelCol(
+      this.$route.name
+    ).productBillnoTable.tablecols;
+    this.tablecolsAdd = this.tool.tabelCol(
+      this.$route.name
+    ).addProuctProject.tablecols;
+    this.tablecolsProductAdd = this.tool.tabelCol(
+      this.$route.name
+    ).productArchivesTable.tablecols;
   },
+  mounted() {},
   methods: {
-    handleOptionParam (param) {
-      param.content.enterprisename = this.data.enterprisename
-      param.content.projectname = this.data.projectname
-      param.content.sourcetable = 'sa_contract'
-      param.content.source = `项目合同:${this.data.billno}`
+    handleOptionParam(param) {
+      param.content.enterprisename = this.data.enterprisename;
+      param.content.projectname = this.data.projectname;
+      param.content.sourcetable = "sa_contract";
+      param.content.source = `项目合同:${this.data.billno}`;
     },
-    async listData(){
-      this.totalPrice = 0
-      this.params.content.sa_contractid = this.$route.query.id
-      const res = await this.$api.requested(this.params)
-      res.data.forEach((e,index)=>{
-        res.data[index].discountrate = Math.round((res.data[index].discountrate *100)*100)/100
-        this.totalPrice = this.totalPrice + res.data[index].amount
-      })
-      this.totalPrice = this.tool.formatAmount(this.totalPrice,2)
-      this.list = res.data
-      this.total = res.total
-      this.$refs.addProduct.doLayout()
-      this.$emit('priceChange')
+    async listData() {
+      this.totalPrice = 0;
+      this.params.content.sa_contractid = this.$route.query.id;
+      const res = await this.$api.requested(this.params);
+      res.data.forEach((e, index) => {
+        res.data[index].discountrate =
+          Math.round(res.data[index].discountrate * 100 * 100) / 100;
+        this.totalPrice = this.totalPrice + res.data[index].amount;
+      });
+      this.totalPrice = this.tool.formatAmount(this.totalPrice, 2);
+      this.list = res.data;
+      this.total = res.total;
+      this.$refs.addProduct.doLayout();
+      this.$emit("priceChange");
     },
     /*修改数量*/
-    qtyChange (num,data,index) {
-      data.qty = Math.round(num *100)/100
-      this.$set(this.list,index,data)
-      this.save(data)
+    qtyChange(num, data, index) {
+      data.qty = Math.round(num * 100) / 100;
+      this.$set(this.list, index, data);
+      this.save(data);
     },
     handleChange(num) {
       console.log(num);
-
     },
     /*修改备注*/
-    remarksChange (val,data,index){
-      this.$set(this.list,index,data)
+    remarksChange(val, data, index) {
+      this.$set(this.list, index, data);
     },
     /*修改折扣*/
-    discountrateChange (num,data,index) {
+    discountrateChange(num, data, index) {
       // if (num>100){
       //   data.discountrate = 100
       // }else if (num < 0){
@@ -230,17 +411,18 @@ export default {
       // }else {
       //   data.discountrate = Math.round(num *100)/100
       // }
-      if (num < 0){
-        data.discountrate = 0
-      }else {
-        data.discountrate = Math.round(num *100)/100
+      if (num < 0) {
+        data.discountrate = 0;
+      } else {
+        data.discountrate = Math.round(num * 100) / 100;
       }
-     data.price = Math.round((data.discountrate / 100 * data.marketprice)*100)/100
-      this.$set(this.list,index,data)
-      this.save(data)
+      data.price =
+        Math.round((data.discountrate / 100) * data.marketprice * 100) / 100;
+      this.$set(this.list, index, data);
+      this.save(data);
     },
     /*修改价格*/
-    priceChange (num,data,index) {
+    priceChange(num, data, index) {
       // if (num > data.marketprice){
       //  data.price = data.marketprice
       // }else if (num < 0){
@@ -248,260 +430,284 @@ export default {
       // }else {
       //   data.price = Math.round(num * 100)/100
       // }
-      if (num < 0){
-        data.price = 0
-      }else {
-        data.price = Math.round(num * 100)/100
+      if (num < 0) {
+        data.price = 0;
+      } else {
+        data.price = Math.round(num * 100) / 100;
       }
-      data.discountrate = Math.round((data.price / data.marketprice * 100)*100)/100
-      this.$set(this.list,index,data)
-      this.save(data)
+      data.discountrate =
+        Math.round((data.price / data.marketprice) * 100 * 100) / 100;
+      this.$set(this.list, index, data);
+      this.save(data);
     },
-    async save (data) {
+    async save(data) {
       let res = await this.$api.requested({
-        "id": 20221122200302,
-        "content": {
-          "sa_contractid":this.$route.query.id,
-          "items": [
+        id: 20221122200302,
+        content: {
+          sa_contractid: this.$route.query.id,
+          items: [
             {
-              marketprice:data.marketprice,
-              itemid:data.itemid,
-              sa_contract_itemsid:data.sa_contract_itemsid,
-              qty:data.qty,
-              discountrate:(data.discountrate/100).toFixed(4),
-              price:data.price,
-              type:data.type
-            }
-          ]
+              marketprice: data.marketprice,
+              itemid: data.itemid,
+              sa_contract_itemsid: data.sa_contract_itemsid,
+              qty: data.qty,
+              discountrate: (data.discountrate / 100).toFixed(4),
+              price: data.price,
+              type: data.type,
+            },
+          ],
         },
-      })
-      this.tool.showMessage(res,() => {
-        this.editIndex = ''
-        this.listData()
-        this.$emit('editSuccess',res.data.signamount)
-      })
+      });
+      this.tool.showMessage(res, () => {
+        this.editIndex = "";
+        this.listData();
+        this.$emit("editSuccess", res.data.signamount);
+      });
     },
     handleSizeChange(val) {
       // console.log(`每页 ${val} 条`);
-      this.params.content.pageSize = val
-      this.listData()
+      this.params.content.pageSize = val;
+      this.listData();
     },
     handleCurrentChange(val) {
       // console.log(`当前页: ${val}`);
-      this.params.content.pageNumber = val
-      this.listData()
+      this.params.content.pageNumber = val;
+      this.listData();
     },
 
     /*拉取数据*/
-    handlePullApi (pullApi) {
-      pullApi.content = JSON.parse(JSON.stringify(this.params.content))
-      pullApi.id = 20221122165302
-      pullApi.content.sa_contractid = this.$route.query.id
+    handlePullApi(pullApi) {
+      pullApi.content = JSON.parse(JSON.stringify(this.params.content));
+      pullApi.id = 20221122165302;
+      pullApi.content.sa_contractid = this.$route.query.id;
     },
     /*一键删除*/
-    handleDelApi (delApi,data) {
-      delApi.id = 20221123164502
+    handleDelApi(delApi, data) {
+      delApi.id = 20221123164502;
       delApi.content = {
-        "sa_contractid":this.$route.query.id,
-        "sa_contract_itemsids": data,
-        "pageNumber":0,
-        "pageSize":0
-      }
-      this.$refs.addProduct.listData()
+        sa_contractid: this.$route.query.id,
+        sa_contract_itemsids: data,
+        pageNumber: 0,
+        pageSize: 0,
+      };
+      this.$refs.addProduct.listData();
     },
 
-
     /*一键添加*/
-    async queryUploadData(uploadApi,data){
-      uploadApi.id = 20221123164402
+    async queryUploadData(uploadApi, data) {
+      uploadApi.id = 20221123164402;
       uploadApi.content = {
-        "sa_contractid": this.$route.query.id,
-        "items": data.map(e=>{
+        sa_contractid: this.$route.query.id,
+        items: data.map((e) => {
           return {
-            "itemid": e.itemid,
-            "price": e.price || (e.marketprice * 1).toFixed(4),
-            "qty": e.qty || e.orderminqty,
-            "marketprice":e.marketprice,
-            "discountrate":e.discountrate || 1,
-            "type":'指定单价'
-          }
-        })
-      }
-      this.$refs.addProduct.listData()
-      this.$emit('onSuccess')
+            itemid: e.itemid,
+            price: e.price || (e.marketprice * 1).toFixed(4),
+            qty: e.qty || e.orderminqty,
+            marketprice: e.marketprice,
+            discountrate: e.discountrate || 1,
+            type: "指定单价",
+          };
+        }),
+      };
+      this.$refs.addProduct.listData();
+      this.$emit("onSuccess");
+    },
+    showMessage(res) {
+      this.tool.showMessage(res, () => {
+        this.listData();
+        this.$refs.addProduct.listData();
+        this.$emit("onSuccess");
+      });
     },
 
     /*批量添加校验是否重复*/
-    async queryProuctAdds(data){
-      let item = data.map(item => {
+    async queryProuctAdds(data) {
+      let item = data.map((item) => {
         return {
-          "itemid": item.itemid,
-          "price": item.price || (item.marketprice * 1).toFixed(4),
-          "qty": item.qty || item.orderminqty,
-          "marketprice":item.marketprice,
-          "discountrate":item.discountrate || 1,
-          "type":'指定单价'
-        }
-      })
-      let checkItem = []
-      item.forEach((item,index)=>{
-        checkItem[index] = item.itemid
-      })
+          itemid: item.itemid,
+          price: item.price || (item.marketprice * 1).toFixed(4),
+          qty: item.qty || item.orderminqty,
+          marketprice: item.marketprice,
+          discountrate: item.discountrate || 1,
+          type: "指定单价",
+        };
+      });
+      let checkItem = [];
+      item.forEach((item, index) => {
+        checkItem[index] = item.itemid;
+      });
       const res = await this.$api.requested({
-        "id": 20230221151903,
-        "content": {
-          "sa_contractid": this.$route.query.id,
-          "itemids":checkItem
+        id: 20230221151903,
+        content: {
+          sa_contractid: this.$route.query.id,
+          itemids: checkItem,
         },
-      })
-      if (!res.data){
+      });
+      if (!res.data) {
         /*直接添加*/
-        this.addProducts(item)
-      }else {
+        this.addProducts(item);
+      } else {
         /*询问是否覆盖*/
-        this.checkItems(item)
+        this.checkItems(item);
       }
     },
     checkItems(data) {
-      this.$confirm(this.$t('商品已存在, 是否更新最新价格')+'?', this.$t('提示'), {
-        confirmButtonText: this.$t('确定'),
-        cancelButtonText: this.$t('取消'),
-        closeOnClickModal:false,
-        type: 'warning'
-      }).then(() => {
-        this.addProducts(data)
-      }).catch(() => {
-        this.$message({
-          type: 'info',
-          message: this.$t('已取消添加')
+      this.$confirm(
+        this.$t("商品已存在, 是否更新最新价格") + "?",
+        this.$t("提示"),
+        {
+          confirmButtonText: this.$t("确定"),
+          cancelButtonText: this.$t("取消"),
+          closeOnClickModal: false,
+          type: "warning",
+        }
+      )
+        .then(() => {
+          this.addProducts(data);
+        })
+        .catch(() => {
+          this.$message({
+            type: "info",
+            message: this.$t("已取消添加"),
+          });
         });
-      });
     },
     /*批量添加商品*/
-    async addProducts (data) {
+    async addProducts(data) {
       let res = await this.$api.requested({
-        "id": 20221123164402,
-        "content": {
-          "sa_contractid": this.$route.query.id,
-          "items": data
+        id: 20221123164402,
+        content: {
+          sa_contractid: this.$route.query.id,
+          items: data,
         },
-      })
-      this.tool.showMessage(res,() => {
-        this.$emit('onSuccess')
-        this.listData()
-        this.$refs.addProduct.listData()
-        this.$refs.addArchivesProduct.listData()
-      })
+      });
+      this.tool.showMessage(res, () => {
+        this.$emit("onSuccess");
+        this.listData();
+        this.$refs.addProduct.listData();
+        this.$refs.addArchivesProduct.listData();
+      });
     },
     /*单个商品添加校验*/
-    async queryProuctAdd(data){
+    async queryProuctAdd(data) {
       const res = await this.$api.requested({
-        "id": 20230221151903,
-        "content": {
-          "sa_contractid": this.$route.query.id,
-          "itemids":[data.itemid]
+        id: 20230221151903,
+        content: {
+          sa_contractid: this.$route.query.id,
+          itemids: [data.itemid],
         },
-      })
-      if (!res.data){
-        this.addProduct(data)
-      }else {
-        this.checkItem(data)
+      });
+      if (!res.data) {
+        this.addProduct(data);
+      } else {
+        this.checkItem(data);
       }
     },
     checkItem(data) {
-      this.$confirm(this.$t('商品已存在, 是否更新最新价格')+'?', this.$t('提示'), {
-        confirmButtonText: this.$t('确定'),
-        cancelButtonText: this.$t('取消'),
-        closeOnClickModal:false,
-        type: 'warning'
-      }).then(() => {
-        this.addProduct(data)
-      }).catch(() => {
-        this.$message({
-          type: 'info',
-          message: this.$t('已取消添加')
+      this.$confirm(
+        this.$t("商品已存在, 是否更新最新价格") + "?",
+        this.$t("提示"),
+        {
+          confirmButtonText: this.$t("确定"),
+          cancelButtonText: this.$t("取消"),
+          closeOnClickModal: false,
+          type: "warning",
+        }
+      )
+        .then(() => {
+          this.addProduct(data);
+        })
+        .catch(() => {
+          this.$message({
+            type: "info",
+            message: this.$t("已取消添加"),
+          });
         });
-      });
     },
     /*单个添加商品*/
-    async addProduct (data) {
-      let price = 0
-      if (!data.price){
-        price = (data.marketprice * 1).toFixed(4)
+    async addProduct(data) {
+      let price = 0;
+      if (!data.price) {
+        price = (data.marketprice * 1).toFixed(4);
       }
       let res = await this.$api.requested({
-        "id": 20221123164402,
-        "content": {
-          "sa_contractid": this.$route.query.id,
-          "items": [
+        id: 20221123164402,
+        content: {
+          sa_contractid: this.$route.query.id,
+          items: [
             {
-              "itemid": data.itemid,
-              "price": data.price || price,
-              "qty": data.qty || data.orderminqty,
-              "marketprice":data.marketprice,
-              "discountrate":data.discountrate || 1,
-              "type":'指定单价'
-            }
-          ]
+              itemid: data.itemid,
+              price: data.price || price,
+              qty: data.qty || data.orderminqty,
+              marketprice: data.marketprice,
+              discountrate: data.discountrate || 1,
+              type: "指定单价",
+            },
+          ],
         },
-      })
-      this.tool.showMessage(res,() => {
-        this.$refs.addProduct.listData()
-        this.$refs.addArchivesProduct.listData()
-        this.listData()
-        this.$emit('onSuccess')
-      })
+      });
+      this.tool.showMessage(res, () => {
+        this.$refs.addProduct.listData();
+        this.$refs.addArchivesProduct.listData();
+        this.listData();
+        this.$emit("onSuccess");
+      });
     },
-    selectionChange(val){
-      this.delProductData = []
-      val.forEach((item,index) => {
-        this.delProductData[index] = item.sa_contract_itemsid
-      })
+    selectionChange(val) {
+      this.delProductData = [];
+      val.forEach((item, index) => {
+        this.delProductData[index] = item.sa_contract_itemsid;
+      });
     },
     /*批量删除判断*/
     onDelProduct() {
-      this.$confirm(this.$t('此操作将删除这些商品, 是否继续')+'?', this.$t('提示'), {
-        confirmButtonText: this.$t('确定'),
-        cancelButtonText: this.$t('取消'),
-        type: 'warning'
-      }).then(() => {
-        this.delProduct()
-      }).catch(() => {
-        this.$message({
-          type: 'info',
-          message: this.$t('取消删除')
+      this.$confirm(
+        this.$t("此操作将删除这些商品, 是否继续") + "?",
+        this.$t("提示"),
+        {
+          confirmButtonText: this.$t("确定"),
+          cancelButtonText: this.$t("取消"),
+          type: "warning",
+        }
+      )
+        .then(() => {
+          this.delProduct();
+        })
+        .catch(() => {
+          this.$message({
+            type: "info",
+            message: this.$t("取消删除"),
+          });
         });
-      });
     },
     /*批量删除商品*/
-    async delProduct(){
+    async delProduct() {
       const res = await this.$api.requested({
-        "id": 20221123164502,
-        "content": {
-          "sa_contractid":this.$route.query.id,
-          "sa_contract_itemsids":this.delProductData
+        id: 20221123164502,
+        content: {
+          sa_contractid: this.$route.query.id,
+          sa_contract_itemsids: this.delProductData,
         },
-      })
-      this.tool.showMessage(res,()=>{
-        this.listData()
-        this.$emit("delSuccess")
-      })
+      });
+      this.tool.showMessage(res, () => {
+        this.listData();
+        this.$emit("delSuccess");
+      });
     },
-    addAll(){
-      this.listData()
-      this.$emit('onSuccess')
+    addAll() {
+      this.listData();
+      this.$emit("onSuccess");
+    },
+    closeDrawer() {
+      this.listData();
+      this.$emit("delSuccess");
     },
-    closeDrawer(){
-      this.listData()
-      this.$emit("delSuccess")
-    }
-
   },
 };
 </script>
 
 <style scoped>
-/deep/ .el-input.is-disabled .el-input__inner{
+/deep/ .el-input.is-disabled .el-input__inner {
   color: #666666;
 }
 </style>

+ 29 - 8
src/HDrpManagement/projectChange/modules/modules/productSet/index.vue

@@ -29,6 +29,13 @@
           @handleParam="handleOptionParam"
           v-if="tool.checkAuth($route.name, 'optionSystem')"
         ></selectOption>
+        <addSelectionList
+          style="margin-left: 10px"
+          slot="optionSystem"
+          sourcetable="sa_project"
+          @showMessage="showMessage"
+          v-if="tool.checkAuth($route.name, 'addSelectionList')"
+        />
       </addProduct>
       <!--      <uploadAllData
           v-if="tool.checkAuth($route.name,'productSetManage') && data.disabled "
@@ -50,7 +57,7 @@
           data.status !== '已结案'
         "
         @click="onDelAll"
-        >{{$t('一键删除')}}</el-button
+        >{{ $t("一键删除") }}</el-button
       >
       <el-button
         v-if="
@@ -110,7 +117,7 @@
         >
       </importFile>
       <div style="float: right">
-        <label class="search__label">{{$t('预计折扣')}}(%):</label>
+        <label class="search__label">{{ $t("预计折扣") }}(%):</label>
         <el-input
           style="width: 100px"
           v-model="discountrate"
@@ -222,7 +229,7 @@
       <div style="margin-top: 16px">
         <div style="float: left">
           <span
-            >{{$t('金额(元)')}}:{{
+            >{{ $t("金额(元)") }}:{{
               totalPrice ? tool.formatAmount(totalPrice, 2) : "0.00"
             }}</span
           >
@@ -257,6 +264,8 @@ import uploadAllData from "@/components/uploadAllData/index";
 import importFile from "@/template/importFile/index";
 import SelectOption from "@/optionSystem/selectOption/add.vue";
 import SetOrder from "@/optionSystem/selectOption/components/setOrder.vue";
+import addSelectionList from "@/SDrpManagement/QuotedPrice/detail/modules/productInventory/addSelectionList";
+
 export default {
   props: ["data", "disabled", "flagTag", "isLeader"],
   components: {
@@ -269,6 +278,7 @@ export default {
     importFile,
     SelectOption,
     SetOrder,
+    addSelectionList
   },
   data() {
     return {
@@ -434,6 +444,13 @@ export default {
       this.$refs.addProduct.listData();
       this.listData();
     },
+    showMessage(res){
+      this.tool.showMessage(res, () => {
+          this.$refs.addProduct.listData();
+          this.listData();
+          this.$emit("productSetSuccess");
+      });
+    },
     onSuccess() {
       this.listData();
       this.$emit("productSetSuccess");
@@ -455,11 +472,15 @@ export default {
     },
     /*批量删除判断*/
     onDelProduct() {
-      this.$confirm(this.$t('此操作将删除这些商品, 是否继续')+"?", this.$t("提示"), {
-        confirmButtonText: this.$t("确定"),
-        cancelButtonText: this.$t("取消"),
-        type: "warning",
-      })
+      this.$confirm(
+        this.$t("此操作将删除这些商品, 是否继续") + "?",
+        this.$t("提示"),
+        {
+          confirmButtonText: this.$t("确定"),
+          cancelButtonText: this.$t("取消"),
+          type: "warning",
+        }
+      )
         .then(() => {
           this.delProduct();
         })

+ 189 - 0
src/SDrpManagement/QuotedPrice/detail/modules/productInventory/addSelectionList.vue

@@ -0,0 +1,189 @@
+<template>
+  <div style="display: inline">
+    <el-button type="primary" size="small" @click="onShow()">
+      {{ $t("添加选型单") }}
+    </el-button>
+    <el-drawer
+      :visible.sync="drawer"
+      :title="$t('添加选型单')"
+      size="1300px"
+      append-to-body
+    >
+      <div class="drawer__panel">
+        <div class="flex-align-center flex-between">
+          <slot name="operation"></slot>
+          <div class="flex-align-center">
+            <el-input
+              size="small"
+              suffix-icon="el-icon-search"
+              v-model="params.content.where.condition"
+              :placeholder="$t(`搜索关键字`)"
+              @keyup.enter.native="getList((params.content.pageNumber = 1))"
+              @clear="getList((params.content.pageNumber = 1))"
+              clearable
+            ></el-input
+            >&nbsp;
+          </div>
+        </div>
+        <div class="produtMag-panel">
+          <div style="height: 5px"></div>
+          <tableTemp
+            ref="table"
+            :layout="tableLayout"
+            :tableName="tableName"
+            :custom="true"
+            :data="list"
+          >
+            <template v-slot:customcol="scope">
+              <el-popconfirm
+                v-if="scope.column.columnname == 'operation'"
+                :confirm-button-text="$t('确定')"
+                :cancel-button-text="$t('取消')"
+                :title="$t('确认加入单据吗?')"
+                @confirm="confirm(scope.column.data)"
+              >
+                <el-button slot="reference" type="text" size="mini">{{
+                  $t("选择")
+                }}</el-button>
+              </el-popconfirm>
+              <p v-else-if="scope.column.columnname == 'price'">
+                ¥{{
+                  scope.column.data[scope.column.columnname]
+                    ? scope.column.data[scope.column.columnname].toFixed(2)
+                    : "0.00"
+                }}
+              </p>
+              <p v-else>
+                {{ $t(scope.column.data[scope.column.columnname]) || "--" }}
+              </p>
+            </template>
+          </tableTemp>
+          <div style="margin-top: 16px; text-align: 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"
+              :total="total"
+            >
+            </el-pagination>
+          </div>
+        </div>
+      </div>
+    </el-drawer>
+  </div>
+</template>
+    
+<script>
+import tableTemp from "@/components/table";
+import { mapGetters } from "vuex";
+export default {
+  name: "AddSelectionList",
+  props: ["sourcetable", "showMessage"],
+  components: { tableTemp },
+  data() {
+    return {
+      drawer: false,
+      tableName: "addSelectionList",
+      tableLayout: [],
+      list: [],
+      currentPage: 1,
+      total: 0,
+      params: {
+        id: 2024102810021402,
+        content: {
+          pageNumber: 1,
+          pageSize: 20,
+          where: {
+            condition: "",
+          },
+        },
+      },
+    };
+  },
+  computed: {
+    ...mapGetters({
+      loading: "loading",
+    }),
+  },
+  methods: {
+    onShow(type) {
+      this.type = type;
+      this.drawer = true;
+      if (this.list.length == 0) this.getList();
+    },
+    getList() {
+      this.$api.requested(this.params).then((res) => {
+        console.log("选择可添加的选型单", res);
+        this.list = res.data;
+        this.total = res.total;
+      });
+    },
+    confirm(data) {
+      this.$api
+        .requested({
+          id: 2024102810420802,
+          content: {
+            sa_lectotypecfgid: data.sa_lectotypecfgid,
+            sourceid: this.$route.query.id,
+            sourcetable: this.sourcetable,
+            valvetype: "蝶阀",
+          },
+        })
+        .then((res) => {
+          console.log("添加选型单", res);
+          this.$emit("showMessage", res);
+          if (res.code !== 0) {
+            if (this.params.content.pageNumber == 1 || this.list.length > 1) {
+              this.getList();
+            } else {
+              this.params.content.pageNumber -= 1;
+              this.getList();
+            }
+          }
+        });
+    },
+    handleSizeChange(val) {
+      this.param.content.pageSize = val;
+      this.getList();
+    },
+    handleCurrentChange(val) {
+      this.param.content.pageNumber = val;
+      this.getList();
+    },
+  },
+  created() {
+    let apps = sessionStorage
+      .getItem("module_info")
+      .find((v) => v.systemname == "CRM")
+      .modules.find((v) => v.systemmodule == "project");
+    let module_list = apps.apps;
+    // 获取当前应用数据
+    let active_modules = module_list.filter((item) => {
+      return item.name === appname;
+    });
+    // 获取当前应用表格数据
+    let tablecols = active_modules[0].meta.tables;
+    this.tableLayout = this.tool.tabelCol("")[this.tableName].tablecols;
+  },
+
+  created() {
+    let apps = JSON.parse(sessionStorage.getItem("module_info"))
+      .find((v) => v.systemname == "CRM")
+      .modules.find((v) => v.systemmodule == "project")
+      .apps.find((v) => v.name == "quotedprice").meta.tables.addSelectionList;
+    console.log("apps", apps);
+    this.tableLayout = apps.tablecols;
+  },
+};
+</script>
+<style scoped>
+.table-box {
+  width: 99%;
+  margin: 5px auto 0;
+}
+</style>
+    

File diff suppressed because it is too large
+ 553 - 326
src/SDrpManagement/QuotedPrice/detail/modules/productInventory/index.vue


Some files were not shown because too many files changed in this diff