移动端
Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.
 
 

378 Zeilen
10 KiB

  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 v-if="surveyStatus === '2'" square type="warning" text="挂起原因" native-type="button" @click="handleViewRemark(item.id)" />
  50. <van-button square type="danger" text="删除" native-type="button" @click="deleteContractor(item.id, index)" /> -->
  51. <div class="operation">
  52. <!-- delete 删除 edit编辑 view查看 list榜单 -->
  53. <div class="opera_btn view" v-if="surveyStatus === '2'" @click="handleViewRemark(item.id)">
  54. <p>挂起原因</p>
  55. </div>
  56. <div class="opera_btn delete" @click="deleteContractor(item.id, index)">
  57. <p>删除</p>
  58. </div>
  59. </div>
  60. </template>
  61. </van-swipe-cell>
  62. </van-list>
  63. </div>
  64. <!-- 异常挂起备注信息弹出框 -->
  65. <van-dialog v-model="showRemark" title="异常挂起原因" :show-confirm-button="false" show-cancel-button cancelButtonText="关闭">
  66. <van-form ref="remarkForm" class="remarkForm">
  67. <van-field v-model="remark" label="挂起原因:" type="textarea" rows="4" placeholder="挂起原因" input-align="left"
  68. label-width="auto" />
  69. </van-form>
  70. </van-dialog>
  71. </div>
  72. </template>
  73. <script>
  74. import Cookies from "js-cookie";
  75. import { listCbf, getCbfById, deleteCbf } from "@/api/contracted/cbf";
  76. export default {
  77. name: "contractedVillageContractor",
  78. data() {
  79. return {
  80. loading:false,
  81. finished:false,
  82. value:'',
  83. // 确权调查状态字典
  84. surveyStatusOptions: [],
  85. // 调查状态
  86. surveyStatus: null,
  87. // 查询参数
  88. queryParams: {
  89. deptId: null,
  90. cbfmc: null,
  91. surveyStatus: null,
  92. pageNum:1,
  93. pageSize:20,
  94. // 查询排序
  95. orderByColumn: "id",
  96. isAsc: "desc",
  97. },
  98. // 承包方列表
  99. cbfList: [],
  100. // 当前选中的调查状态
  101. tagName: null,
  102. // 当前调查状态下的承包方总数
  103. totalNum: 0,
  104. // 控制异常信息备注提示框的显示和隐藏
  105. showRemark: false,
  106. // 异常备注信息
  107. remark: null,
  108. };
  109. },
  110. created() {
  111. this.queryParams.deptId = this.$route.query.deptId;
  112. this.getDicts("confirmed_survey_status").then(response => {
  113. this.surveyStatusOptions = response.data;
  114. if (this.surveyStatusOptions.length > 0) {
  115. this.surveyStatus = this.surveyStatusOptions[0].dictValue;
  116. this.queryParams.surveyStatus = this.surveyStatusOptions[0].dictValue;
  117. this.tagName = this.surveyStatusOptions[0].dictLabel;
  118. }
  119. this.getList();
  120. });
  121. },
  122. methods: {
  123. getList(){
  124. this.loading = true;
  125. listCbf(this.queryParams).then(response => {
  126. response.rows.forEach(item => {
  127. this.cbfList.push(item);
  128. });
  129. this.totalNum = response.total;
  130. if (this.cbfList.length >= response.total) {
  131. this.finished = true;
  132. return;
  133. } else {
  134. this.loading = false;
  135. this.queryParams.pageNum += 1;
  136. }
  137. });
  138. },
  139. onSearch(){
  140. this.queryParams.cbfmc = this.value;
  141. this.queryData();
  142. },
  143. surveyStatusChange(dictValue, dictLabel) {
  144. this.surveyStatus = dictValue;
  145. this.queryParams.surveyStatus = dictValue;
  146. this.tagName = dictLabel;
  147. this.totalNum = 0;
  148. this.queryData();
  149. },
  150. queryData() {
  151. this.queryParams.pageNum = 1;
  152. this.finished = false;
  153. this.cbfList = [];
  154. this.getList();
  155. },
  156. goDetail(item){
  157. this.$router.push({
  158. name: 'contractedVillageContractorDetail',
  159. params: {
  160. deptId: item.deptId,
  161. cbfbm: item.cbfbm,
  162. cbfmc: item.cbfmc,
  163. surveyStatus: item.surveyStatus
  164. }
  165. });
  166. },
  167. addContractor() {
  168. this.$router.push({
  169. name: 'contractedVillageContractorDetailAdd',
  170. params: {
  171. deptId: this.$route.query.deptId
  172. }
  173. });
  174. },
  175. deleteContractor(id, index) {
  176. this.$dialog.confirm({
  177. message: '是否确认删除此条承包方信息?',
  178. }).then(() => {
  179. // on confirm
  180. deleteCbf(id).then(res => {
  181. if(res.code == 200){
  182. this.$toast({
  183. icon: 'success',
  184. message: '删除成功',
  185. duration: "1000",
  186. onClose: () => {
  187. this.cbfList.splice(index, 1);
  188. this.totalNum = this.totalNum - 1;
  189. }
  190. });
  191. }
  192. });
  193. }).catch(() => {
  194. // on cancel
  195. });
  196. },
  197. handleViewRemark(id) {
  198. this.remark = null;
  199. getCbfById(id).then(response => {
  200. this.showRemark = true;
  201. this.remark = response.data.surveyRemark;
  202. });
  203. }
  204. },
  205. };
  206. </script>
  207. <style scoped lang="scss">
  208. .app-container{
  209. background: #fff url("../../../../../static/images/contracted/contracted_index_bg.png") no-repeat center;
  210. background-size: 100% 100%;
  211. height: 100vh;
  212. padding: 0 4vw;
  213. }
  214. /deep/ .van-nav-bar{
  215. background: transparent;
  216. }
  217. /deep/ .van-nav-bar .van-icon{
  218. color: #000000;
  219. }
  220. /deep/ .van-hairline--bottom::after{
  221. border: none;
  222. }
  223. /deep/ .van-search__content{
  224. background: rgba(255,255,255,.5);
  225. }
  226. /deep/ .van-search{
  227. padding: 0;
  228. flex: 1;
  229. }
  230. /deep/ .remarkForm .van-cell__value {
  231. border: 1px solid #b0b3ba;
  232. border-radius: 5px;
  233. padding: 0 15px;
  234. .van-field__control {
  235. color: #646566;
  236. }
  237. }
  238. .tap_block{
  239. width: 100%;
  240. display: flex;
  241. justify-content: space-between;
  242. background: #ebfaf2;
  243. padding: 2PX 4PX;
  244. border-radius: 10PX;
  245. margin-top: 1vh;
  246. .active{
  247. background-image: linear-gradient(to right,#c6fe8b,#48e5a2);
  248. box-shadow: 0 0 10PX #cccccc;
  249. color: #333333;
  250. }
  251. p{
  252. width: 25%;
  253. text-align: center;
  254. padding: 5PX 0;
  255. border-radius: 10PX;
  256. color: #666666;
  257. }
  258. }
  259. .search_main{
  260. display: flex;
  261. margin-top: 2vh;
  262. .search_btn{
  263. background: rgba(255,255,255,.5);
  264. width: 25%;
  265. border-radius: 50PX;
  266. margin-left: 10PX;
  267. padding: 2PX;
  268. .active{
  269. background-image: linear-gradient(to right,#c6fe8b,#48e5a2);
  270. color: #333333;
  271. border-radius: 50PX;
  272. display: flex;
  273. align-items: center;
  274. justify-content: center;
  275. height: 100%;
  276. }
  277. }
  278. }
  279. .second_tap{
  280. display: flex;
  281. align-items: center;
  282. margin-top: 1vh;
  283. p{
  284. background: #dbf1ea;
  285. border: 1px solid #cdcdcd;
  286. color: #5f5f5f;
  287. padding: 5PX 15PX;
  288. margin-right: 3vw;
  289. border-radius: 50PX;
  290. }
  291. .active{
  292. background: #99eecb;
  293. border-color: #48e5a2;
  294. color: #333333;
  295. }
  296. }
  297. .list_main{
  298. margin-top: 4vh;
  299. overflow-y: scroll;
  300. text-align: center;
  301. background: #ffffff;
  302. border-top-left-radius: 10PX;
  303. border-top-right-radius: 10PX;
  304. height: 77vh;
  305. overflow-y: scroll;
  306. .van-col{
  307. padding: 15PX 0;
  308. }
  309. }
  310. .page_tab{
  311. position: absolute;
  312. background: rgba(255,255,255,.5);
  313. padding: 3PX 10PX 15PX;
  314. color: #828282;
  315. right: 4vw;
  316. border-top-left-radius: 10PX;
  317. border-top-right-radius: 10PX;
  318. margin-top: 1.5vh;
  319. span{
  320. color: #f78200;
  321. }
  322. }
  323. .operation{
  324. display: flex;
  325. align-items: center;
  326. justify-content: right;
  327. text-align: center;
  328. background: #fff;
  329. box-shadow: 4px 6px 5px rgba(63, 68, 75, 0.1);
  330. height: 100%;
  331. border-radius: 30px;
  332. margin-left: 2vw;
  333. overflow: hidden;
  334. .opera_btn{
  335. height: 100%;
  336. display: flex;
  337. align-items: center;
  338. color: #ffffff;
  339. padding: 0 5vw;
  340. &.delete{
  341. background:#ff3737;
  342. }
  343. &.edit{
  344. background: #a5f790;
  345. }
  346. &.view{
  347. background: #48e5a2;
  348. }
  349. &.list{
  350. background: #fb9627;
  351. }
  352. }
  353. }
  354. </style>