informationProgress.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360
  1. <template>
  2. <view>
  3. <!-- 头部 -->
  4. <cu-custom bgColor="bg-blue" :isBack="true">
  5. <block slot="backText">资料进度</block>
  6. <block slot="content"></block>
  7. <block slot="right">
  8. <view class=" flex justify-center">
  9. <button @click="search()" class="cu-btn round line-blue text-white" style="width: 160rpx;height: 66rpx;padding: 0;">
  10. <image src="/static/index/search-white.png" style="width: 32rpx;height: 32rpx;margin-right: 16rpx;"></image>搜索
  11. </button>
  12. </view>
  13. </block>
  14. </cu-custom>
  15. <scroll-view scroll-y="true" class="margin-bottom" style="padding-bottom: 300rpx;">
  16. <view class="cu-list menu card-menu margin-top-sm">
  17. <view class="cu-item" @click="allData()">
  18. <view class="content">
  19. <text style="font-size: 34rpx;font-weight: bold;" :class="allSelect?'indexColor':''">全部工程</text>
  20. </view>
  21. </view>
  22. </view>
  23. <view v-for="(item,index) in treeData" :key="item.id" class="treeData_b">
  24. <view class="treeData_1" @click="treeTap(index+1,item)">
  25. <view style="font-weight: bold;font-size: 34rpx;" :class="item.selected&&!allSelect?'indexColor':''">{{item.name}}</view>
  26. <view v-if="item.children.length>0">
  27. <image src="/static/information/shang.png" style="width: 40rpx;height: 40rpx;vertical-align: middle;" v-if="show == index + 1"></image>
  28. <image src="/static/information/xia.png" style="width: 40rpx;height: 40rpx;vertical-align: middle;" v-if="show != index + 1 || show == 0"></image>
  29. </view>
  30. </view>
  31. <view v-for="(second,seconds) in item.children" :key="second.id" v-if="show == index + 1">
  32. <view class="treeData_1s treeData_2" @click="secondTap(seconds + 1,second)">
  33. <view :class="second.selected&&!allSelect?'indexColor':''">{{second.name}}</view>
  34. <view v-if="second.children.length>0">
  35. <image src="/static/information/shang.png" style="width: 40rpx;height: 40rpx;vertical-align: middle;" v-if="showsecond == seconds + 1"></image>
  36. <image src="/static/information/xia.png" style="width: 40rpx;height: 40rpx;vertical-align: middle;" v-if="showsecond != seconds + 1 || showsecond == 0"></image>
  37. </view>
  38. </view>
  39. <view v-if="showsecond == seconds + 1" :style="{'padding-bottom': second.children.length>0 ? '22rpx':''}">
  40. <view v-for="(three,threes) in second.children" :key="three.id" class="treeData_three">
  41. <view class="treeData_1s treeData_3" @click="threeTap(threes + 1,three)">
  42. <view :class="three.selected&&!allSelect?'indexColor':''">{{three.name}}</view>
  43. <view v-if="three.children.length>0">
  44. <image src="/static/information/shang.png" style="width: 40rpx;height: 40rpx;vertical-align: middle;" v-if="showthree == threes + 1"></image>
  45. <image src="/static/information/xia.png" style="width: 40rpx;height: 40rpx;vertical-align: middle;" v-if="showthree != threes + 1 || showthree == 0"></image>
  46. </view>
  47. </view>
  48. <view v-if="showthree == threes + 1" v-for="(four,fours) in three.children" :key="four.id">
  49. <view class="treeData_1s treeData_3" @click="fourTap(fours + 1,four)">
  50. <view style="padding-left: 22rpx;" :class="four.selected&&!allSelect?'indexColor':''"><text style="margin-right: 10rpx;">◈</text>{{four.name}}</view>
  51. <view v-if="four.children.length>0">
  52. <image src="/static/information/shang.png" style="width: 40rpx;height: 40rpx;vertical-align: middle;" v-if="showfour == fours + 1"></image>
  53. <image src="/static/information/xia.png" style="width: 40rpx;height: 40rpx;vertical-align: middle;" v-if="showfour != fours + 1 || showfour == 0"></image>
  54. </view>
  55. </view>
  56. <view v-if="showfour == fours + 1" v-for="(five,fives) in four.children" :key="five.id">
  57. <view class="treeData_1s treeData_3" @click="fiveTap(fives + 1,five)">
  58. <view style="padding-left: 44rpx;" :class="five.selected&&!allSelect?'indexColor':''"><text style="margin-right: 10rpx;">➣</text>{{five.name}}</view>
  59. <view v-if="five.children.length>0">
  60. <image src="/static/information/shang.png" style="width: 40rpx;height: 40rpx;vertical-align: middle;" v-if="showfive == fives + 1"></image>
  61. <image src="/static/information/xia.png" style="width: 40rpx;height: 40rpx;vertical-align: middle;" v-if="showfive != fives + 1 || showfive == 0"></image>
  62. </view>
  63. </view>
  64. <view v-if="showfive == fives + 1" v-for="(six,sixs) in five.children" :key="six.id">
  65. <view class="treeData_1s treeData_3" @click="sixTap(sixs + 1,six)">
  66. <view style="padding-left: 66rpx;" :class="six.selected&&!allSelect?'indexColor':''"><text style="margin-right: 10rpx;">•</text>{{six.name}}</view>
  67. <view v-if="six.children.length>0">
  68. <image src="/static/information/shang.png" style="width: 40rpx;height: 40rpx;vertical-align: middle;" v-if="showsix == sixs + 1"></image>
  69. <image src="/static/information/xia.png" style="width: 40rpx;height: 40rpx;vertical-align: middle;" v-if="showsix != sixs + 1 || showsix == 0"></image>
  70. </view>
  71. </view>
  72. <view v-if="showsix == sixs + 1" v-for="(seven,sevens) in six.children" :key="seven.id">
  73. <view class="treeData_1s treeData_3" @click="sevenTap(sevens + 1,seven)">
  74. <view style="padding-left: 88rpx;" :class="seven.selected&&!allSelect?'indexColor':''">{{seven.name}}</view>
  75. </view>
  76. </view>
  77. </view>
  78. </view>
  79. </view>
  80. </view>
  81. </view>
  82. </view>
  83. </view>
  84. </scroll-view>
  85. <!-- 底部-->
  86. <view v-if="modalShow" class="shadow foot" style="background-color: #0A8CD5;color: #fff;position: fixed; z-index: 999; bottom: 0;width: 100%;padding-bottom: calc(var(--window-bottom) + 20px);">
  87. <view class="padding-sm solid-bottom-type" style="display: flex;align-items: center;position: absolute;left: 0;right: 0;top: -80rpx;height: 80rpx;opacity: 0.9;background-image: linear-gradient(#91C9E8, #0A8CD5);box-shadow: 0px -1px 2px #D0D0D0;">
  88. <image class="login-img" src="/static/index/label.png"></image>
  89. <view style="overflow-x: scroll;width: 680rpx;margin-left: 16rpx;">
  90. <view class="text-white" style="white-space : nowrap;font-weight: bold;">{{path}}</view>
  91. </view>
  92. </view>
  93. <view class="padding-sm">
  94. <view class="flex">
  95. <view class="cu-progress round" style="border: 4rpx solid #fff;background-color: #fff;margin-top: 16rpx;">
  96. <view class="bg-yellow" :style="width" style="border-radius: 0 30rpx 30rpx 0;"></view>
  97. </view>
  98. </view>
  99. <view class="flex margin-top-sm justify-between">
  100. <view class="round">
  101. 总工序 {{processNum}}
  102. </view>
  103. <text class="margin-left">已完成{{percentage}}%</text>
  104. </view>
  105. </view>
  106. </view>
  107. <view class="toTop">
  108. </view>
  109. </view>
  110. </template>
  111. <script>
  112. export default {
  113. data() {
  114. return {
  115. treeData: [],
  116. show: 0, //一级状态
  117. showsecond: 0, //二级状态
  118. showthree: 0, //三级状态
  119. showfour: 0, //四级状态
  120. showfive: 0, //五级状态
  121. showsix: 0, //六级状态
  122. showseven: 0, //七级状态
  123. modalShow: false,
  124. path: "",
  125. percentage:"",
  126. width:"",
  127. processNum:"",
  128. allSelect:false,//是否选中全部
  129. }
  130. },
  131. onLoad() {
  132. this.findDataProgress();
  133. },
  134. methods: {
  135. findDataProgress() {
  136. var that = this;
  137. var contractId = uni.getStorageSync("porject"+"_"+uni.getStorageSync("userInfo").id).contractId;
  138. that.http.request('/app/divideClient/findDataProgress', {
  139. contractId: contractId
  140. }).then((result) => {
  141. if (result.datas != null) {
  142. that.treeData = result.datas[0].children;
  143. that.text(that.treeData);
  144. }
  145. })
  146. },
  147. search() {
  148. uni.setStorageSync("pageType", 1); //区分搜索页面跳转
  149. uni.navigateTo({
  150. url: "/pages/search/search"
  151. })
  152. },
  153. filterNode(value, data) {
  154. if (!value) return true;
  155. return data.label.indexOf(value) !== -1;
  156. },
  157. /* 获取节点的资料进度 */
  158. handleNodeClick(data) {
  159. var that =this;
  160. that.http.request("/app/divideClient/countInstance",{ids:data.id,contractId:""}).then((res)=>{
  161. var num = res.data*100
  162. that.percentage = Math.round(num);
  163. that.width ="width:"+Math.round(num)+"%;";
  164. that.processNum = res.size;
  165. that.findPath(data.id);
  166. });
  167. },
  168. /* 全程工程的施工进度 */
  169. allData(){
  170. this.allSelect = true;
  171. var that =this;
  172. var project = uni.getStorageSync("porject"+"_"+uni.getStorageSync("userInfo").id);
  173. that.http.request("/app/divideClient/countInstance",{ids:project.contractId,contractId:project.contractId}).then((res)=>{
  174. var num = res.data*100
  175. that.percentage = Math.round(num);
  176. that.width ="width:"+Math.round(num)+"%;";
  177. that.processNum = res.size;
  178. that.path=" / 全部工程"
  179. that.modalShow = true
  180. });
  181. },
  182. findPath(id){
  183. /* 获取父节点信息 */
  184. var that=this;
  185. that.http.request("/app/divideClient/selectNodeTreeById",{id:id}).then((res)=>{
  186. that.path="";
  187. res.datas.forEach((item)=>{
  188. if(item.parentId!=0){
  189. that.path += " / "+item.name;
  190. }
  191. });
  192. that.modalShow = true
  193. });
  194. },
  195. treeTap(e,r) {
  196. this.text(this.treeData)
  197. r.selected = true;
  198. this.allSelect = false;
  199. if (this.show == e) {
  200. this.show = 0
  201. } else {
  202. this.show = e
  203. }
  204. this.handleNodeClick(r);
  205. },
  206. secondTap(e,r) {
  207. this.text(this.treeData)
  208. r.selected = true;
  209. this.allSelect = false;
  210. if (this.showsecond == e) {
  211. this.showsecond = 0
  212. } else {
  213. this.showsecond = e
  214. }
  215. this.handleNodeClick(r);
  216. },
  217. threeTap(e,r) {
  218. this.text(this.treeData)
  219. r.selected = true;
  220. this.allSelect = false;
  221. if (this.showthree == e) {
  222. this.showthree = 0
  223. } else {
  224. this.showthree = e
  225. }
  226. this.handleNodeClick(r);
  227. },
  228. fourTap(e,r) {
  229. this.text(this.treeData);
  230. this.$set(r,"selected",true);
  231. this.allSelect = false;
  232. if (this.showfour == e) {
  233. this.showfour = 0
  234. } else {
  235. this.showfour = e
  236. }
  237. this.handleNodeClick(r);
  238. },
  239. fiveTap(e,r) {
  240. this.text(this.treeData);
  241. this.$set(r,"selected",true);
  242. this.allSelect = false;
  243. if (this.showfive == e) {
  244. this.showfive = 0
  245. } else {
  246. this.showfive = e
  247. }
  248. this.handleNodeClick(r);
  249. },
  250. sixTap(e,r) {
  251. this.text(this.treeData)
  252. r.selected = true;
  253. this.allSelect = false;
  254. if (this.showsix == e) {
  255. this.showsix = 0
  256. } else {
  257. this.showsix = e
  258. }
  259. this.handleNodeClick(r);
  260. },
  261. sevenTap(e,r) {
  262. this.text(this.treeData)
  263. r.selected = true;
  264. this.allSelect = false;
  265. if (this.showseven == e) {
  266. this.showseven = 0
  267. } else {
  268. this.showseven = e
  269. }
  270. this.handleNodeClick(r);
  271. },
  272. text(data) {
  273. var that = this;
  274. data.forEach((item) => {
  275. item.selected = false;
  276. if (item.children.length > 0) {
  277. that.text(item.children);
  278. }
  279. })
  280. that.treeData = data;
  281. }
  282. }
  283. }
  284. </script>
  285. <style>
  286. page{background-color: #F7F7F7;}
  287. .toTop {
  288. position: fixed;
  289. bottom: 0;
  290. width: 100%;
  291. background-color: #F7F7F7;
  292. height: calc(var(--window-bottom) + 15px)
  293. }
  294. .solid-bottom-type {
  295. border-bottom: 1upx solid white;
  296. }
  297. .treeData_b {
  298. margin: 12rpx 22rpx 0;
  299. background-color: #fff;
  300. border-radius: 10rpx;
  301. padding: 0 22rpx;
  302. }
  303. .treeData_1 {
  304. font-size: 30rpx;
  305. color: #101010;
  306. height: 88rpx;
  307. display: flex;
  308. justify-content: space-between;
  309. align-items: center;
  310. }
  311. .treeData_1s {
  312. font-size: 30rpx;
  313. color: #101010;
  314. display: flex;
  315. justify-content: space-between;
  316. align-items: center;
  317. padding: 22upx 0;
  318. min-height: 88rpx;
  319. }
  320. .treeData_2 {
  321. border-top: 1upx dashed #E3E1E1;
  322. }
  323. .treeData_3 {
  324. border-top: 1upx dashed #E3E1E1;
  325. }
  326. .treeData_three {
  327. background-color: #F7F7F7;
  328. padding: 0 22rpx;
  329. border-radius: 10rpx;
  330. margin-bottom: 22;
  331. }
  332. .treeData_three:first-child {
  333. border-radius: 10rpx 10rpx 0 0;
  334. }
  335. .treeData_three:last-child {
  336. border-radius: 0 0 10rpx 10rpx;
  337. }
  338. .indexColor {
  339. color: #0A8CD5;
  340. font-weight: bold;
  341. }
  342. .padding-sm{padding:20rpx 22rpx;}
  343. </style>