| | |
| | | <view class="vote bgc-ff"> |
| | | <view class="mb-20" v-for="(item,index) in voteTopicList" :key="index"> |
| | | <view class="vote-title"> |
| | | <text v-if="item.mandatoryFlag == 1">*</text> |
| | | <text class="f-30 fw">{{item.discussContent}}</text> |
| | | <text class="f-26 ml-10">{{item.optionRange == 0?"(单选)":"(多选)"}}</text> |
| | | <text class="f-26 ml-10" v-if="item.optionRange == 0">(单选)</text> |
| | | <text class="f-26 ml-10" v-if="item.optionRange == 1 && !item.optionNumber">(多选)</text> |
| | | <text class="f-26 ml-10" v-if="item.optionRange == 1 && item.optionNumber>0">(多选 |
| | | {{`最多可选${item.optionNumber}项`}})</text> |
| | | |
| | | </view> |
| | | <view class="" v-if="item.optionRange == 0"> |
| | | <u-radio-group size="22" iconPlacement="right" activeColor="#017BFC" placement="column" |
| | |
| | | :showText="false"></uv-line-progress> |
| | | </view> |
| | | |
| | | <text class="c-33 f-28" |
| | | v-if="i.number && item.isSubmit">{{i.number}}人</text> |
| | | <!-- <text class="c-33 f-28" |
| | | v-if="i.number && item.isSubmit">{{i.number}}人</text> --> |
| | | </view> |
| | | </view> |
| | | </u-radio-group> |
| | | </view> |
| | | <view class="" v-if="item.optionRange == 1"> |
| | | <u-checkbox-group size="22" iconPlacement="right" activeColor="#017BFC" |
| | | placement="column" v-model="item.selected" :disabled="isSubmit" |
| | | placement="column" v-model="item.selected" :disabled="item.isSubmit || isEnd" |
| | | @change="selectOption($event,index)" shape="circle" labelColor="#333"> |
| | | <view class="mb-30" v-for="(i,k) in item.children" :key="k"> |
| | | <u-checkbox :label="i.optionContent" :name="i.id" |
| | |
| | | <uv-line-progress v-else height="6" |
| | | :showText="false"></uv-line-progress> |
| | | </view> |
| | | <text class="c-33 f-28" v-if="i.number">{{i.number}}人</text> |
| | | <!-- <text class="c-33 f-28" v-if="i.number">{{i.number}}人</text> --> |
| | | </view> |
| | | </view> |
| | | </u-checkbox-group> |
| | |
| | | let endTimestamp = new Date(this.applyInfo.endTime).getTime(); |
| | | if (Number(endTimestamp) - Number(curTimestamp) <= 0) { |
| | | this.isEnd = true; |
| | | this.setOptionDisable() //时间结束,所有多项按钮禁用 |
| | | } |
| | | return Number(endTimestamp) - Number(curTimestamp) |
| | | } |
| | |
| | | |
| | | selectOption(id, index) { |
| | | let item = this.voteTopicList[index]; |
| | | // if (item.optionNumber == item.selected.length) { |
| | | // this.$showTips(`最多只能选${item.optionNumber}项`); |
| | | // return; |
| | | // } |
| | | item.selected = id; |
| | | let disableIndex = "" |
| | | this.$set(this.voteTopicList, index, item); |
| | | for (let i = 0, ii = item.selected.length; i < ii; i++) { |
| | | for (let k = 0, kk = item.children.length; k < kk; k++) { |
| | | if (item.selected[i] != item.children[k].id) { |
| | | if (item.selected.length == item.optionNumber) { |
| | | console.log("index ===>", k) |
| | | disableIndex = k; |
| | | break; |
| | | // item.children[k].disabled = true; |
| | | if (id.length <= item.optionNumber) { |
| | | item.selected = id; |
| | | } |
| | | for (let i = 0, ii = item.children.length; i < ii; i++) { |
| | | item.children[i].selected = false; |
| | | for (let k = 0, kk = item.selected.length; k < kk; k++) { |
| | | if (item.children[i].id === item.selected[k]) { |
| | | item.children[i].selected = true; |
| | | } |
| | | item.children[i].disabled = false; |
| | | if (item.selected.length == item.optionNumber) { |
| | | if (!item.children[i].selected) { |
| | | item.children[i].disabled = true; |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | | } |
| | | |
| | | console.log("disableIndex ===>", disableIndex); |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | this.$set(this.voteTopicList, index, item); |
| | | }, |
| | | |
| | | |
| | | setOptionDisable() { |
| | | for (let i = 0, ii = this.voteTopicList.length; i < ii; i++) { |
| | | for (let k = 0, kk = this.voteTopicList[i].children.length; k < kk; k++) { |
| | | this.voteTopicList[i].children[k].disabled = true; |
| | | } |
| | | } |
| | | }, |
| | | |
| | | |
| | | getParams(signPath) { |
| | | let list = JSON.parse(JSON.stringify(this.voteTopicList)); |
| | |
| | | i.houseCode = uni.getStorageSync("siteInfo").houseCode |
| | | i.signaturePath = signPath ? signPath : "" |
| | | arr.push(i) |
| | | } else if (!i.selected && i.mandatoryFlag) { |
| | | this.$showTips('必填议题请选择选项') |
| | | } |
| | | |
| | | } |
| | | return arr; |
| | | }, |