|
|
@@ -62,6 +62,16 @@
|
|
|
</view>
|
|
|
</tui-list-cell>
|
|
|
|
|
|
+ <tui-list-cell class="line-cell" :hover="false">
|
|
|
+ <view class="tui-title">所属产品</view>
|
|
|
+ <view>
|
|
|
+ <block v-if="form.cpInfo && !$util.isEmpty(form.cpInfo)">
|
|
|
+ <button v-for="(cpItem, cpIndex) in form.cpInfo" class="admin-button-com blue mini-btn" style="margin-right:8upx;" @click.stop="delOneCp(cpItem,cpIndex)">{{cpItem.cpName}} ×</button>
|
|
|
+ </block>
|
|
|
+ <button class="admin-button-com default mini-btn" @click.stop="changeCp()">添加产品</button>
|
|
|
+ </view>
|
|
|
+ </tui-list-cell>
|
|
|
+
|
|
|
<tui-list-cell class="line-cell" :hover="false">
|
|
|
<div class="tui-title">比例类型</div>
|
|
|
<radio-group class="tui-input" @change="ratioTypeChange">
|
|
|
@@ -230,7 +240,8 @@ export default {
|
|
|
itemId:0,
|
|
|
smallRatio:1,
|
|
|
ratioType:0,
|
|
|
- inTurn:100
|
|
|
+ inTurn:100,
|
|
|
+ cpInfo:[]
|
|
|
},
|
|
|
itemClassSelectedData:{},
|
|
|
itemClassData:[],
|
|
|
@@ -239,12 +250,31 @@ export default {
|
|
|
bigUnitSelectedData:{},
|
|
|
hasRequest:0,
|
|
|
productData:{id:0},
|
|
|
- headers:{token:''}
|
|
|
+ headers:{token:''},
|
|
|
+ backCpInfo:{cpId:0,cpName:'',needUpdate:0}
|
|
|
};
|
|
|
},
|
|
|
computed:{
|
|
|
...mapGetters(["getLoginInfo","getDictionariesInfo"])
|
|
|
},
|
|
|
+ onShow(){
|
|
|
+ let that = this
|
|
|
+ if(this.backCpInfo.needUpdate == 1){
|
|
|
+ let needAdd = 1;
|
|
|
+ if (!this.$util.isEmpty(this.form.cpInfo)) {
|
|
|
+ that.form.cpInfo.forEach((item) => {
|
|
|
+ if(item.cpId == that.backCpInfo.cpId){
|
|
|
+ needAdd = 0
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ if(needAdd == 1){
|
|
|
+ that.form.cpInfo.push({cpId:that.backCpInfo.cpId,cpName:that.backCpInfo.cpName})
|
|
|
+ that.backCpInfo.needUpdate = 0
|
|
|
+ that.$forceUpdate()
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
onLoad(option) {
|
|
|
if(option.id){
|
|
|
this.form.id = this.option.id
|
|
|
@@ -253,6 +283,16 @@ export default {
|
|
|
this.headers.token = token
|
|
|
},
|
|
|
methods: {
|
|
|
+ delOneCp(info,index){
|
|
|
+ let that = this
|
|
|
+ that.$util.confirmModal({content:'确认删除'+info.cpName+'?'},() => {
|
|
|
+ that.form.cpInfo.splice(index,1)
|
|
|
+ that.$forceUpdate()
|
|
|
+ })
|
|
|
+ },
|
|
|
+ changeCp(item){
|
|
|
+ this.$util.pageTo({url: '/admin/cp/list?skip=1'})
|
|
|
+ },
|
|
|
changeClass(item){
|
|
|
this.$refs.classRef.open('center')
|
|
|
},
|