MONSTER-ygh 1 месяц назад
Родитель
Сommit
eaf3e3dec8

+ 3 - 3
src/views/priceConfigurationUilt/dialog/addAndEdit.vue

@@ -96,15 +96,15 @@
         
 
         <el-form-item v-if="!['window','group'].includes(channelType)" label="划线价:" prop="originalAmount">
-          <el-input-number v-model="form.originalAmount" :step="1" :precision="0" style="width: 350px"></el-input-number>
+          <el-input-number v-model="form.originalAmount" style="width: 350px"></el-input-number>
         </el-form-item>
         <el-form-item :label="setSaleAmounttile()" prop="saleAmount">
-          <el-input-number v-model="form.saleAmount" :step="1" :precision="0" style="width: 350px"></el-input-number>
+          <el-input-number v-model="form.saleAmount" style="width: 350px"></el-input-number>
           {{ !['group'].includes(channelType) ? '元':'元/人' }}
         </el-form-item>
         <el-form-item v-if="channelType == 'retail'" label="佣金:" prop="retailAmount">
-          <el-input-number v-model="form.retailAmount" :step="1" :precision="0" style="width: 350px"></el-input-number>
+          <el-input-number v-model="form.retailAmount" style="width: 350px"></el-input-number>
         </el-form-item>
         <el-form-item label="备注:" prop="remark">

+ 25 - 2
src/views/priceConfigurationUilt/dialog/bindTeamBox.vue

@@ -55,7 +55,7 @@
 </template>
 
 <script>
-import { bindTeamApi} from "@/api/priceConfiguration/index";
+import { bindTeamApi,getSelectById } from "@/api/priceConfiguration/index";
 import { pageList as goodsPageListApi } from '@/api/team/teamMr'
 export default {
   name: "addAndEdit",
@@ -100,11 +100,34 @@ export default {
         id: obj.id,
         teamIdList: []
       }
+      await this.getSelectByIdFun(obj)
       this.$nextTick(() => {
         this.$refs["form"].clearValidate();
       });
     },
-    /**  票务信息  */
+    /**  获取详情 */
+    async getSelectByIdFun(obj) {
+      try {
+        let res = await getSelectById({
+          id: obj.id
+        })
+        if(res.code == 200){
+          let list = []
+          res.data.teamList ? res.data.teamList.forEach((item)=>{
+              if(item.teamId) {
+                list.push(item.teamId)
+              }
+          }): ''
+          this.form = {
+            id: obj.id,
+            teamIdList: list
+          }
+          console.log("this.form===",this.form)
+        }
+      } catch (error) {      
+      }
+    },
+    /**  获取团队  */
     async goodsPageListFun(){
       try {
         let res = await goodsPageListApi({

+ 30 - 3
src/views/ticket/InventoryTemplate/dialog/addAndEdit.vue

@@ -41,6 +41,12 @@
             <el-form-item label="可配置数量:">
               {{ seatNum }}
             </el-form-item>
+            <el-form-item label="已配置数据:">
+              {{ configStockNum }}
+            </el-form-item>
+            <el-form-item label="未配置数量:">
+              {{ seatNum - configStockNum }}
+            </el-form-item>
           </div>
           <el-form-item label="库存模式:" class="is-required">
             <div class="inventory_box">
@@ -79,7 +85,13 @@
                     <el-table-column label="可配置数量" align="center" prop="stock"></el-table-column>
                     <el-table-column label="配置数量" align="center">
                       <template slot-scope="scope">
-                        <el-input v-model="form.chennelListForm[chennelAtion].seatTypeList[scope.$index].stockNum" type="number" clearable placeholder="请输入数量"></el-input>
+                        <el-input 
+                        v-model="form.chennelListForm[chennelAtion].seatTypeList[scope.$index].stockNum" 
+                        type="number" 
+                        clearable 
+                        placeholder="请输入数量"
+                        @input="(value)=>countNum(value,scope.$index)"
+                        ></el-input>
                       </template>
                     </el-table-column>
                   </el-table>
@@ -191,6 +203,7 @@ export default {
       dataList: [], // 座位
 
       seatNum: '',
+      configStockNum: 0, // 已分配的座位
     };
   },
   created() {
@@ -253,6 +266,7 @@ export default {
           await this.countBySeatTypFun(obj.auditoriumId,true)
           obj.chennelListForm = this.setDataTree(obj)
           this.form = obj
+          this.configStockNum = obj.configStockNum
           this.setDictLabel(obj.chennelListForm[0],0)
           console.log("list2====",this.form)
         }
@@ -501,15 +515,21 @@ export default {
         console.error("dfsdfdsfsd====",error)
       }
     },
+    // 选择渠道
     setDictLabel(obj,index){
       this.chennelAtion = index
       if(obj.stockType == 1) {
-        console.log('fsdfsdfsdfsdfsdfsdfsdfsfdsf')
         this.getSeatSelectById()
       }
     },
+    // 计算可分配数量
+    countStockNum() {
+      this.form.chennelListForm.forEach((item,index)=>{
+
+      })
+    },
+    // 选择模式
     setStockType(value) {
-      console.log('fsdfsdfsdfsdfsdfsdfsdfsfdsf======',value)
       if(value == 1) {
         this.getSeatSelectById()
       }
@@ -573,6 +593,13 @@ export default {
       this.form.chennelListForm[this.chennelAtion].chennelSeatList = JSON.stringify(obj) == '{}'?null:obj
       this.form.chennelListForm[this.chennelAtion].stockNum = list.length>0 ? list.length : ''
       console.log("已选择的====",list,this.form.chennelListForm[this.chennelAtion].chennelSeatList)
+    },
+    /**  计算可分配座位 */
+    countNum(value,index) {
+      console.log("value,index=====",value,index)
+      if(value>this.form.chennelListForm[this.chennelAtion].seatTypeList[index],'stock',this.form.chennelListForm[this.chennelAtion].seatTypeList[index].stock) {
+        
+      }
     }
   },
 };