lmtapeople.vue 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191
  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="输入委员姓名进行查询" v-model="title" @confirm="getConfirm"/>
  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-tablesearch.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. title:'',
  79. }
  80. },
  81. onLoad(e) {
  82. this.init()
  83. if(e.data){
  84. var newobj=JSON.parse(decodeURIComponent(e.data));
  85. this.checkList=newobj.list;
  86. }
  87. },
  88. methods: {
  89. getLxFn(ite){
  90. var indexNum = (this.tableData || []).findIndex((item) => item.userId === ite.userId);
  91. if(indexNum!=-1){
  92. this.tableData[indexNum].type=ite.type
  93. }
  94. },
  95. getDelFn(ite,idx){
  96. this.checkList.splice(idx,1);
  97. // var indexNum = (this.tableData || []).findIndex((item) => item.userId === ite.userId);
  98. // console.log(indexNum)
  99. // this.tableData[indexNum].checked=false;
  100. },
  101. toggleRowSelection(e,data,item){
  102. this.checkList=JSON.parse(JSON.stringify(data))
  103. },
  104. getConfirm(){
  105. this.init()
  106. },
  107. toggleAllSelection(e){
  108. },
  109. init(){
  110. this.tableData=[]
  111. var params={
  112. name:this.title
  113. }
  114. getInfoListFn(params).then(res=>{
  115. if(res.code==200){
  116. var tableData=res.rows;
  117. var newArr=this.checkList;
  118. if(newArr&&newArr.length){
  119. newArr.forEach(ite=>{
  120. var indexNum = (tableData || []).findIndex((item) => item.userId === ite.userId);
  121. if(indexNum!=-1){
  122. tableData[indexNum].checked=true
  123. tableData[indexNum].type=ite.type
  124. }
  125. })
  126. }
  127. this.tableData=tableData;
  128. }
  129. })
  130. },
  131. getSure(){
  132. var list=this.checkList;
  133. var newArr = [];
  134. var a='';
  135. for(var i=0;i<list.length;i++){
  136. if (!list[i].type) {
  137. this.$toast("请选择"+list[i].name+"领衔/附议")
  138. return
  139. }
  140. newArr.push(list[i].name)
  141. }
  142. var obj={
  143. proposalUserList:this.checkList,
  144. namelist:newArr
  145. }
  146. uni.$emit("refreshtary",obj)
  147. uni.navigateBack({
  148. delta: 1 //返回层数,2则上上页
  149. });
  150. }
  151. }
  152. }
  153. </script>
  154. <style scoped lang="scss">
  155. .lmtac /deep/ .uni-data-checklist{display: flex;align-items: center;justify-content: flex-end;}
  156. .lmtac /deep/ .uni-data-checklist .checklist-box{margin-right: 0;}
  157. .lmtabox{display: flex;flex-direction: column;height: 100vh;
  158. .lmtatop{background: #ffffff;flex: 1;padding: 34rpx 24rpx 0;display: flex;flex-direction: column;overflow: auto;box-sizing: border-box;
  159. .table{flex: 1;height: calc(100% - 110rpx);}
  160. }
  161. .lmtac{margin-top: 24rpx;padding:30rpx 24rpx 58rpx;background-color: #ffffff;max-height: 512rpx;box-sizing: border-box;display: flex;flex-direction: column;
  162. .btns{width: 100%;height: 80rpx;margin-top: 30rpx;
  163. background: #1D64E2;font-weight: bold;font-size: 30rpx;
  164. color: #FFFFFF;display: flex;align-items: center;justify-content: center;
  165. border-radius: 40rpx;}
  166. // 表格
  167. .table{flex: 1;overflow: hidden;display: flex;flex-direction: column;
  168. .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;
  169. &.w60{width: 120rpx;}
  170. &.w50{width: 100rpx;}
  171. &.w70{width: 140rpx;}
  172. }
  173. .tab_head{display: flex;align-items: center;}
  174. .tab_list{display: flex;flex-direction: column;flex: 1;overflow: auto;}
  175. .tablist{
  176. display: flex;
  177. .tr{font-weight: 500;min-height: 64rpx;}
  178. }
  179. .staimg{width: 28rpx;height: 28rpx;}
  180. }
  181. }
  182. .scroll-view{width: 100%;}
  183. }
  184. </style>