lmtapeople.vue 5.6 KB

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