lmtapeople.vue 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  1. <template>
  2. <view class="lmtabox">
  3. <!-- 上面 -->
  4. <view class="lmtatop">
  5. <!-- 搜索 -->
  6. <view class="search searchbg flex0">
  7. <image :src="searchimg"></image>
  8. <input placeholder="输入委员姓名进行查询" />
  9. </view>
  10. <view class="flex1 table">
  11. <zb-table
  12. :show-header="true"
  13. :columns="columns"
  14. :stripe="false"
  15. :fit="false"
  16. :checkList="checkList"
  17. @rowClick="rowClick"
  18. @toggleRowSelection="toggleRowSelection"
  19. @toggleAllSelection="toggleAllSelection"
  20. :border="border"
  21. @edit="buttonEdit"
  22. @dele="dele"
  23. :data="tableData"></zb-table>
  24. </view>
  25. </view>
  26. <!-- 弹窗 -->
  27. <view class="lmtac">
  28. <view class="flex1 table">
  29. <view class="tab_head">
  30. <view class="w60 tr">姓名</view>
  31. <view class="tr" style="flex: 1;">职务</view>
  32. <view class="w70 tr">领衔/附议</view>
  33. <!-- <view class="w50 tr">附议</view> -->
  34. <view class="w50 tr">操作</view>
  35. </view>
  36. <view class="tab_list">
  37. <view v-for="(ite,idx) in checkList" :key="idx" class="tablist">
  38. <view class="w60 tr">{{ite.name}}</view>
  39. <view class="tr" style="flex: 1;">{{ite.unit}}</view>
  40. <view class="tr w70" @click="getLxFn(ite)" >
  41. <uni-data-checkbox v-model="ite.type" :localdata="sfList" />
  42. <!-- <image :src="checkimg" class="staimg" v-if="ite.lx"></image>
  43. <image :src="ncheckimg" class="staimg" v-else></image> -->
  44. </view>
  45. <view class="w50 tr" @click="getDelFn(ite,idx)">
  46. <image :src="delimg" class="staimg"></image>
  47. </view>
  48. </view>
  49. </view>
  50. </view>
  51. <view class="btns" @click="getSure">确定</view>
  52. </view>
  53. </view>
  54. </template>
  55. <script>
  56. import {getInfoListFn} from "@/api/mine/case.js"
  57. import zbTable from "@/work/components/zb-table/zb-tables.vue"
  58. export default {
  59. components:{zbTable},
  60. data() {
  61. return {
  62. searchimg: require("@/work/static/images/hsearch.png"),
  63. checkimg: require("@/work/static/images/check.png"),
  64. ncheckimg: require("@/work/static/images/ncheck.png"),
  65. delimg: require("@/work/static/images/del.png"),
  66. searchVal: '',
  67. border: false,
  68. sfList:[{text: '领衔',value: '1'},{text: '附议',value: '2'}],
  69. tatype:'',
  70. columns: [
  71. { type:'selection', width:120,align:'center',},
  72. { name: 'name', label: '姓名',width:130,align:'center', },
  73. { name: 'unit', label: '职务',align:'center'},
  74. ],
  75. tableData:[],
  76. checkList:[],
  77. selectList:[]
  78. }
  79. },
  80. onLoad(e) {
  81. this.init()
  82. if(e.data){
  83. var newobj=JSON.parse(decodeURIComponent(e.data));
  84. this.checkList=newobj.list;
  85. }
  86. },
  87. methods: {
  88. getLxFn(ite){
  89. var indexNum = (this.tableData || []).findIndex((item) => item.userId === ite.userId);
  90. this.tableData[indexNum].type=ite.type
  91. },
  92. getDelFn(ite,idx){
  93. this.checkList.splice(idx,1);
  94. // var indexNum = (this.tableData || []).findIndex((item) => item.userId === ite.userId);
  95. // console.log(indexNum)
  96. // this.tableData[indexNum].checked=false;
  97. },
  98. toggleRowSelection(e,data){
  99. this.checkList=JSON.parse(JSON.stringify(data))
  100. },
  101. toggleAllSelection(e){
  102. },
  103. init(){
  104. getInfoListFn().then(res=>{
  105. if(res.code==200){
  106. this.tableData=res.rows;
  107. var newArr=this.checkList;
  108. if(newArr&&newArr.length){
  109. newArr.forEach(ite=>{
  110. var indexNum = (this.tableData || []).findIndex((item) => item.userId === ite.userId);
  111. this.tableData[indexNum].checked=true
  112. this.tableData[indexNum].type=ite.type
  113. })
  114. }
  115. }
  116. })
  117. },
  118. getSure(){
  119. var list=this.checkList;
  120. var newArr = [];
  121. var a='';
  122. for(var i=0;i<list.length;i++){
  123. if (!list[i].type) {
  124. this.$toast("请选择"+list[i].name+"领衔/附议")
  125. return
  126. }
  127. newArr.push(list[i].name)
  128. }
  129. var obj={
  130. proposalUserList:this.checkList,
  131. namelist:newArr
  132. }
  133. uni.$emit("refreshtary",obj)
  134. uni.navigateBack({
  135. delta: 1 //返回层数,2则上上页
  136. });
  137. }
  138. }
  139. }
  140. </script>
  141. <style scoped lang="scss">
  142. .lmtac /deep/ .uni-data-checklist{display: flex;align-items: center;justify-content: flex-end;}
  143. .lmtac /deep/ .uni-data-checklist .checklist-box{margin-right: 0;}
  144. .lmtabox{display: flex;flex-direction: column;height: 100vh;
  145. .lmtatop{background: #ffffff;flex: 1;padding: 34rpx 24rpx 0;display: flex;flex-direction: column;overflow: auto;box-sizing: border-box;
  146. .table{flex: 1;height: calc(100% - 110rpx);}
  147. }
  148. .lmtac{margin-top: 24rpx;padding:30rpx 24rpx 58rpx;background-color: #ffffff;max-height: 512rpx;box-sizing: border-box;display: flex;flex-direction: column;
  149. .btns{width: 100%;height: 80rpx;margin-top: 30rpx;
  150. background: #1D64E2;font-weight: bold;font-size: 30rpx;
  151. color: #FFFFFF;display: flex;align-items: center;justify-content: center;
  152. border-radius: 40rpx;}
  153. // 表格
  154. .table{flex: 1;overflow: hidden;display: flex;flex-direction: column;
  155. .tr{flex: 0 0 auto;font-size: 28rpx;font-weight: bold;color: #222327;text-align: center;min-height: 80rpx;padding: 8rpx;box-sizing: border-box;display: flex;align-items: center;justify-content: center;
  156. &.w60{width: 120rpx;}
  157. &.w50{width: 100rpx;}
  158. &.w70{width: 140rpx;}
  159. }
  160. .tab_head{display: flex;align-items: center;}
  161. .tab_list{display: flex;flex-direction: column;flex: 1;overflow: auto;}
  162. .tablist{
  163. display: flex;
  164. .tr{font-weight: 500;min-height: 64rpx;}
  165. }
  166. .staimg{width: 28rpx;height: 28rpx;}
  167. }
  168. }
  169. .scroll-view{width: 100%;}
  170. }
  171. </style>