移动端
25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

contractor.vue 8.1 KiB

1 년 전
1 년 전
1 년 전
1 년 전
1 년 전
1 년 전
1 년 전
1 년 전
1 년 전
1 년 전
1 년 전
1 년 전
1 년 전
1 년 전
1 년 전
1 년 전
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307
  1. <template>
  2. <div class="app-container">
  3. <van-nav-bar :title="$route.query.deptName" left-arrow fixed placeholder @click-left="$router.push({path:'/contracted/index'})" />
  4. <div class="tap_block">
  5. <p class="active">承包方</p>
  6. <p @click="$router.push({path:'/contracted/village/employer', query: { deptId: $route.query.deptId, deptName: $route.query.deptName }})">发包方</p>
  7. <p @click="$router.push({path:'/contracted/village/massif', query: { deptId: $route.query.deptId, deptName: $route.query.deptName }})">地块</p>
  8. <p @click="$router.push({path:'/contracted/village/map', query: { deptId: $route.query.deptId, deptName: $route.query.deptName }})">地图</p>
  9. </div>
  10. <div class="search_main">
  11. <van-search
  12. v-model="value"
  13. shape="round"
  14. background="transparent"
  15. placeholder="请输入姓名搜索"
  16. @search="onSearch"
  17. ></van-search>
  18. <div class="search_btn" @click="addContractor">
  19. <p class="active"> + 新增</p>
  20. </div>
  21. </div>
  22. <div class="second_tap">
  23. <!-- <p class="active">待调查 1553</p>
  24. <p>挂起 527</p>
  25. <p>已完成 321</p> -->
  26. <p v-for="dict in surveyStatusOptions" :key="dict.dictValue" :class="{active: surveyStatus === dict.dictValue}" @click="surveyStatusChange(dict.dictValue, dict.dictLabel)">{{dict.dictLabel}}</p>
  27. </div>
  28. <p class="page_tab">{{ tagName }} <span>{{ totalNum }} 户</span></p>
  29. <div class="list_main">
  30. <van-row style="color: #888888;font-size: 14px;">
  31. <van-col span="5">姓名</van-col>
  32. <van-col span="14">证件号</van-col>
  33. <van-col span="5">成员数</van-col>
  34. </van-row>
  35. <van-list
  36. v-model="loading"
  37. :finished="finished"
  38. finished-text="没有更多了"
  39. :immediate-check="false"
  40. @load="getList"
  41. >
  42. <van-swipe-cell v-for="(item,index) in cbfList" :key="item.id">
  43. <van-row @click="goDetail(item)">
  44. <van-col span="5">{{ item.cbfmc }}</van-col>
  45. <van-col span="14">{{ item.cbfzjhm }}</van-col>
  46. <van-col span="5" style="color: #f78200">{{ item.cbfcysl }}</van-col>
  47. </van-row>
  48. <template #right>
  49. <van-button square type="danger" text="删除" native-type="button" @click="deleteContractor(item.id, index)" />
  50. </template>
  51. </van-swipe-cell>
  52. </van-list>
  53. </div>
  54. </div>
  55. </template>
  56. <script>
  57. import Cookies from "js-cookie";
  58. import { listCbf, deleteCbf } from "@/api/contracted/cbf";
  59. export default {
  60. name: "contractedVillageContractor",
  61. data() {
  62. return {
  63. loading:false,
  64. finished:false,
  65. value:'',
  66. // 确权调查状态字典
  67. surveyStatusOptions: [],
  68. // 调查状态
  69. surveyStatus: null,
  70. // 查询参数
  71. queryParams: {
  72. deptId: null,
  73. cbfmc: null,
  74. surveyStatus: null,
  75. pageNum:1,
  76. pageSize:20,
  77. },
  78. // 承包方列表
  79. cbfList: [],
  80. // 当前选中的调查状态
  81. tagName: null,
  82. // 当前调查状态下的承包方总数
  83. totalNum: 0,
  84. };
  85. },
  86. created() {
  87. this.queryParams.deptId = this.$route.query.deptId;
  88. this.getDicts("confirmed_survey_status").then(response => {
  89. this.surveyStatusOptions = response.data;
  90. if (this.surveyStatusOptions.length > 0) {
  91. this.surveyStatus = this.surveyStatusOptions[0].dictValue;
  92. this.queryParams.surveyStatus = this.surveyStatusOptions[0].dictValue;
  93. this.tagName = this.surveyStatusOptions[0].dictLabel;
  94. }
  95. this.getList();
  96. });
  97. },
  98. methods: {
  99. getList(){
  100. this.loading = true;
  101. listCbf(this.queryParams).then(response => {
  102. response.rows.forEach(item => {
  103. this.cbfList.push(item);
  104. });
  105. this.totalNum = response.total;
  106. if (this.cbfList.length >= response.total) {
  107. this.finished = true;
  108. return;
  109. } else {
  110. this.loading = false;
  111. this.queryParams.pageNum += 1;
  112. }
  113. });
  114. },
  115. onSearch(){
  116. this.queryParams.cbfmc = this.value;
  117. this.queryData();
  118. },
  119. surveyStatusChange(dictValue, dictLabel) {
  120. this.surveyStatus = dictValue;
  121. this.queryParams.surveyStatus = dictValue;
  122. this.tagName = dictLabel;
  123. this.totalNum = 0;
  124. this.queryData();
  125. },
  126. queryData() {
  127. this.queryParams.pageNum = 1;
  128. this.finished = false;
  129. this.cbfList = [];
  130. this.getList();
  131. },
  132. goDetail(item){
  133. this.$router.push({
  134. name: 'contractedVillageContractorDetail',
  135. params: {
  136. deptId: item.deptId,
  137. cbfbm: item.cbfbm,
  138. cbfmc: item.cbfmc,
  139. surveyStatus: item.surveyStatus
  140. }
  141. });
  142. },
  143. addContractor() {
  144. this.$router.push({
  145. name: 'contractedVillageContractorDetailAdd',
  146. params: {
  147. deptId: this.$route.query.deptId
  148. }
  149. });
  150. },
  151. deleteContractor(id, index) {
  152. this.$dialog.confirm({
  153. message: '是否确认删除此条承包方信息?',
  154. }).then(() => {
  155. // on confirm
  156. deleteCbf(id).then(res => {
  157. if(res.code == 200){
  158. this.$toast({
  159. icon: 'success',
  160. message: '删除成功',
  161. duration: "1000",
  162. onClose: () => {
  163. this.cbfList.splice(index, 1);
  164. this.totalNum = this.totalNum - 1;
  165. }
  166. });
  167. }
  168. });
  169. }).catch(() => {
  170. // on cancel
  171. });
  172. }
  173. },
  174. };
  175. </script>
  176. <style scoped lang="scss">
  177. .app-container{
  178. background: #fff url("../../../../../static/images/contracted/contracted_index_bg.png") no-repeat center;
  179. background-size: 100% 100%;
  180. height: 100vh;
  181. padding: 0 4vw;
  182. }
  183. /deep/ .van-nav-bar{
  184. background: transparent;
  185. }
  186. /deep/ .van-nav-bar .van-icon{
  187. color: #000000;
  188. }
  189. /deep/ .van-hairline--bottom::after{
  190. border: none;
  191. }
  192. /deep/ .van-search__content{
  193. background: rgba(255,255,255,.5);
  194. }
  195. /deep/ .van-search{
  196. padding: 0;
  197. flex: 1;
  198. }
  199. .tap_block{
  200. width: 100%;
  201. display: flex;
  202. justify-content: space-between;
  203. background: #ebfaf2;
  204. padding: 2PX 4PX;
  205. border-radius: 10PX;
  206. margin-top: 1vh;
  207. .active{
  208. background-image: linear-gradient(to right,#c6fe8b,#48e5a2);
  209. box-shadow: 0 0 10PX #cccccc;
  210. color: #333333;
  211. }
  212. p{
  213. width: 25%;
  214. text-align: center;
  215. padding: 5PX 0;
  216. border-radius: 10PX;
  217. color: #666666;
  218. }
  219. }
  220. .search_main{
  221. display: flex;
  222. margin-top: 2vh;
  223. .search_btn{
  224. background: rgba(255,255,255,.5);
  225. width: 25%;
  226. border-radius: 50PX;
  227. margin-left: 10PX;
  228. padding: 2PX;
  229. .active{
  230. background-image: linear-gradient(to right,#c6fe8b,#48e5a2);
  231. color: #333333;
  232. border-radius: 50PX;
  233. display: flex;
  234. align-items: center;
  235. justify-content: center;
  236. height: 100%;
  237. }
  238. }
  239. }
  240. .second_tap{
  241. display: flex;
  242. align-items: center;
  243. margin-top: 1vh;
  244. p{
  245. background: #dbf1ea;
  246. border: 1px solid #cdcdcd;
  247. color: #5f5f5f;
  248. padding: 5PX 15PX;
  249. margin-right: 3vw;
  250. border-radius: 50PX;
  251. }
  252. .active{
  253. background: #99eecb;
  254. border-color: #48e5a2;
  255. color: #333333;
  256. }
  257. }
  258. .list_main{
  259. margin-top: 4vh;
  260. overflow-y: scroll;
  261. text-align: center;
  262. background: #ffffff;
  263. border-top-left-radius: 10PX;
  264. border-top-right-radius: 10PX;
  265. height: 77vh;
  266. overflow-y: scroll;
  267. .van-col{
  268. padding: 15PX 0;
  269. }
  270. }
  271. .page_tab{
  272. position: absolute;
  273. background: rgba(255,255,255,.5);
  274. padding: 3PX 10PX 15PX;
  275. color: #828282;
  276. right: 4vw;
  277. border-top-left-radius: 10PX;
  278. border-top-right-radius: 10PX;
  279. margin-top: 1.5vh;
  280. span{
  281. color: #f78200;
  282. }
  283. }
  284. </style>