companyHouse.vue 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278
  1. <template>
  2. <div class="companyhouse">
  3. <div class="searchbox">
  4. <div style="display: flex;align-items: center;justify-content: space-around;">
  5. <uni-search-bar style="width: 40%" placeholder="请输入公司名称" @confirm="confirm" clearButton="none"
  6. cancelButton="none" v-model="search.qymc">
  7. </uni-search-bar>
  8. <div style="width: 40%" @click="openParkSelect">
  9. <uni-search-bar style="width: 100%" class="parkIconHidden" placeholder="请所属园区" clearButton="none"
  10. cancelButton="none" v-model="search.parkInfoName" readonly searchIcon="none">
  11. </uni-search-bar>
  12. </div>
  13. <img @click="jumpAddCompanyPage()" src="../../../static/add_company.png" style="height: 50rpx; width: 50rpx;"
  14. alt="" />
  15. </div>
  16. </div>
  17. <van-tabs :active="active" @change="onChange">
  18. <van-tab title="全部" :name="null"></van-tab>
  19. <van-tab title="在园" :name="1"></van-tab>
  20. <van-tab title="挂靠" :name="2"></van-tab>
  21. <van-tab title="异地生产" :name="3"></van-tab>
  22. <van-tab title="飞地" :name="4"></van-tab>
  23. </van-tabs>
  24. <div style="display: flex; background: white; padding: 0rpx 16rpx">
  25. <uni-data-checkbox v-model="entryArray" mode="tag" :multiple="true" :localdata="dic_SelectList.SETTLE_IN_STATUS"
  26. selectedTextColor="#1D18BC" selectedColor="rgba(29,24,188,0.05);" @change="getCompanyList">
  27. </uni-data-checkbox>
  28. </div>
  29. <div class="list">
  30. <div v-if="companyList.length != 0">
  31. <div class="list-row" v-for="(item, index) in companyList" :key="index">
  32. <div class="cell_1 width90">
  33. <div class="width70 height44rpx mb8rpx float_left">
  34. <div class="first_title chaochuyincang">{{ item.qymc }}</div>
  35. </div>
  36. <div class="width30 height44rpx mb8rpx float_left" @click="jumpPage(item.id)">
  37. <div class="roomstatus1 txt_center" style="font-size: 24rpx">
  38. {{ getDicType(item.settleInType) }}
  39. </div>
  40. </div>
  41. <div class="width100 height40rpx mb8rpx clear_both">
  42. <div class="second_title width50 height40rpx float_left" style="
  43. overflow: hidden;
  44. text-overflow: ellipsis;
  45. white-space: nowrap;
  46. ">
  47. 所属楼盘:{{
  48. item.area == null || !item.area ? "未知" : item.area
  49. }}
  50. </div>
  51. <div class="second_title_1 width50 height40rpx float_left" @click="jumpPage(item.id)">
  52. 注册资金:{{ !item.zczj ? "暂无" : item.zczj + "万" }}
  53. </div>
  54. </div>
  55. <div @click="jumpPage(item.id)" class="width100 height28rpx font24rpx fontcolor251FCA chaochuyincang">
  56. {{ item.qybq == null || !item.qybq ? "暂无标签" : item.qybq }}
  57. </div>
  58. </div>
  59. <div class="cell_3 width10" @click="jumpPage(item.id)">
  60. <img src="../../../static/mine/youjiantou.png" alt="" />
  61. </div>
  62. </div>
  63. </div>
  64. <div v-else>
  65. <van-empty class="disblock marginauto" style="background: white" description="暂无数据" />
  66. </div>
  67. </div>
  68. <van-popup :show="show" @close="onClose" position="bottom" round>
  69. <van-cascader :value="treeData3List" :title="null" :field-names="{ text: 'label', value: 'value' }"
  70. :options="treeData3List" @close="onClose" @finish="onFinish" />
  71. </van-popup>
  72. </div>
  73. </template>
  74. <script>
  75. import { listVo, getByCodes, getUserLocalStorageInfo, getTreeData3 } from "@/js_sdk/http";
  76. import vanEmpty from "../../../wxcomponents/weapp/dist/empty/index";
  77. import vanCascader from '../../../wxcomponents/weapp/dist/cascader/index';
  78. export default {
  79. components: {
  80. vanEmpty,
  81. vanCascader,
  82. },
  83. data() {
  84. return {
  85. cascaderValue: '',
  86. treeData3List: [],
  87. show: false,
  88. entryArray: [],
  89. dic_key: ["MNP_BUILDING_TYPE", "SETTLE_IN_STATUS"],
  90. dic_SelectList: {},
  91. active: 0,
  92. form: {
  93. entryStatus: [],
  94. },
  95. statusList: [
  96. { label: "全部", value: null },
  97. { label: "在园", value: "1" },
  98. { label: "挂靠", value: "2" },
  99. { label: "异地生产", value: "3" },
  100. { label: "飞地", value: "4" },
  101. ],
  102. companyList: [],
  103. search: {
  104. pageSize: 10,
  105. userId: "",
  106. pageNum: 1,
  107. },
  108. };
  109. },
  110. onShow() {
  111. this.search.userId = getUserLocalStorageInfo().user.id;
  112. this.getByCodes();
  113. this.getCompanyList();
  114. this.getTreeData3()
  115. },
  116. methods: {
  117. onFinish(e) {
  118. console.log(e)
  119. console.log(e.detail.selectedOptions[e.detail.selectedOptions.length - 1].id)
  120. console.log(e.detail.selectedOptions[e.detail.selectedOptions.length - 1].label)
  121. this.search.parkInfoId = e.detail.selectedOptions[e.detail.selectedOptions.length - 1].id
  122. this.search.parkInfoName = e.detail.selectedOptions[e.detail.selectedOptions.length - 1].label
  123. this.show = false
  124. this.getCompanyList();
  125. // search
  126. // this.form.parkInfoId = e.detail.selectedOptions[e.detail.selectedOptions.length - 1].id
  127. // this.form.parkInfoName = e.detail.selectedOptions[e.detail.selectedOptions.length - 1].label
  128. // this.treeData3DialogVisible = false
  129. },
  130. openParkSelect() {
  131. console.log(123123123)
  132. this.show = true
  133. },
  134. onClose() {
  135. this.show = false
  136. },
  137. async getMoreListData() {
  138. let that = this;
  139. that.search.pageNum = that.search.pageNum + 1;
  140. let list = await listVo(that.search);
  141. if (list.rows == 0) {
  142. that.$showToast("没有更多数据了");
  143. } else {
  144. list.rows.forEach((e) => {
  145. that.companyList.push(e);
  146. });
  147. }
  148. },
  149. async getTreeData3() {
  150. let that = this
  151. let datdepartmentList = await getTreeData3()
  152. console.log(datdepartmentList)
  153. that.treeData3List = datdepartmentList.data
  154. },
  155. onReachBottom() {
  156. this.getMoreListData();
  157. }, //下拉执行的时候触发 (下拉刷新)
  158. onChange(e) {
  159. this.search.settleInType = e.detail.name == null ? "" : e.detail.name;
  160. this.getCompanyList();
  161. },
  162. getDicType(value) {
  163. if (this.dic_SelectList.MNP_BUILDING_TYPE) {
  164. let MNP_BUILDING_TYPE = this.dic_SelectList.MNP_BUILDING_TYPE;
  165. let index = MNP_BUILDING_TYPE.findIndex((e) => e.value == value);
  166. if (index != -1) return MNP_BUILDING_TYPE[index].label;
  167. else return "暂无";
  168. }
  169. },
  170. async getByCodes() {
  171. this.search.pageNum = 1;
  172. let data = await getByCodes(JSON.stringify(this.dic_key));
  173. this.dic_SelectList = this.$common.handleDicList(data);
  174. this.dic_SelectList.SETTLE_IN_STATUS =
  175. this.dic_SelectList.SETTLE_IN_STATUS.map((e) => {
  176. return {
  177. text: e.label,
  178. value: e.value,
  179. };
  180. });
  181. },
  182. async getCompanyList() {
  183. this.search.entryStatus = this.entryArray.toString();
  184. this.search.pageSize = 10;
  185. this.search.pageNum = 1;
  186. let list = await listVo(this.search);
  187. this.companyList = list.rows;
  188. },
  189. jumpAddCompanyPage() {
  190. uni.navigateTo({
  191. url: "/pages/subPackages/addCompany/addCompany",
  192. });
  193. },
  194. blur(e) { },
  195. focus(e) {
  196. // pages / subPackages / merchants / merchants;
  197. },
  198. input(e) { },
  199. cancel(e) { },
  200. change(e) { },
  201. clear(e) { },
  202. confirm(e) {
  203. this.getCompanyList();
  204. },
  205. jumpPage(e) {
  206. uni.navigateTo({
  207. url: "/pages/subPackages/companyDetails/companyDetails?id=" + e,
  208. });
  209. },
  210. },
  211. };
  212. </script>
  213. <style lang="scss">
  214. .companyhouse {
  215. .uni-searchbar {
  216. padding: 0;
  217. }
  218. }
  219. .searchbox {
  220. display: block;
  221. background: white;
  222. }
  223. .parkIconHidden {
  224. .uni-searchbar__box-icon-search {
  225. display: none;
  226. }
  227. .uni-searchbar__box {
  228. justify-content: left;
  229. padding: 5px 8px 5px 15px;
  230. }
  231. }
  232. .chaochuyincang {
  233. white-space: nowrap;
  234. overflow: hidden;
  235. text-overflow: ellipsis;
  236. }
  237. .labelcolmt26 {
  238. input {
  239. font-size: 24rpx;
  240. border-radius: 8rpx 8rpx 8rpx 8rpx;
  241. border: 2rpx solid #cccccc;
  242. text-align: center;
  243. }
  244. .van-col {
  245. margin-top: 26rpx !important;
  246. }
  247. label {
  248. color: #333333;
  249. font-size: 30rpx;
  250. margin: 0;
  251. margin-top: 0 !important;
  252. }
  253. .uni-data-checklist {
  254. margin-top: -10rpx !important;
  255. }
  256. }
  257. </style>