data.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466
  1. <template>
  2. <view>
  3. <!-- 资料管理弹窗 -->
  4. <view style="height: 100%;">
  5. <view class="status_bar"></view>
  6. <view class="top_b">
  7. <!-- 切换卡 -->
  8. <view class="top_b_1">
  9. <view style="width: 100%;text-align: center;font-size: 34rpx;font-weight: bold;position: relative;" :class="TabCur == 0?'text-blue':'text-blues'"
  10. @tap="tabSelect(0)">
  11. {{modelList[0].name}}
  12. <view :class="TabCur==0?'text-blue_one':''"></view>
  13. </view>
  14. <view style="width: 100%;text-align: center;font-size: 34rpx;font-weight: bold;position: relative;" :class="TabCur == 1?'text-blue1':'text-blues'" @tap="tabSelect(1)">
  15. {{modelList[1].name}}
  16. <view :class="TabCur == 1?'text-blue_ones':''"></view>
  17. </view>
  18. </view>
  19. <!-- 按钮-->
  20. <view class="tot_button">
  21. <view class="tot_button_1">
  22. <view>
  23. <button class="button_divisionName">{{divisionName}}</button>
  24. </view>
  25. <view>
  26. <button class="button_stake">{{stake}}</button>
  27. </view>
  28. </view>
  29. </view>
  30. <view style="position: fixed;right: 0;top: calc(var(--status-bar-height) + 20rpx);" v-if="childrenContracts.length >1">
  31. <view class="bg-blue text-center" style="border-radius:50rpx 0 0 50rpx ;width: 120rpx;height: 70rpx;line-height: 70rpx;" @click="showNoList">
  32. <text>{{curContractNumber}} ></text>
  33. </view>
  34. </view>
  35. <view class="bg-white" style="position: fixed;right: 6rpx;top: calc(var(--status-bar-height) + 96rpx);;width: 180rpx;border-radius: 20rpx;box-shadow: 0 2px 12px 0 rgba(0,0,0,.2);" v-show="noShow">
  36. <view v-for="(contract,index) in childrenContracts" :key="contract.id" @click="changNo(index)" class="text-blue padding-tb-sm padding-left-sm solid-bottom">{{contract.contractNumber}}</view>
  37. </view>
  38. </view>
  39. <!-- 内容 -->
  40. <view style="height: var(--status-bar-height)"></view>
  41. <view style="padding:125px 22rpx 200rpx;">
  42. <scroll-view scroll-y="" style="height: 100%;">
  43. <!-- 分类 -->
  44. <view v-if="TabCur==0">
  45. <view v-for="(item,index) in divideClientList" :key="item.id">
  46. <view style="font-size: 30rpx;color: #101010;padding-top: 28rpx;font-weight: bold;">{{item.name}}</view>
  47. <view style="display: flex;flex-wrap: wrap;">
  48. <view v-for="(children,indexs) in item.children " :key="indexs">
  49. <button @click="chooseDivision(children)" style="margin: 26rpx 20rpx 0 0;font-size: 26rpx;height: 72rpx;line-height: 72rpx;">
  50. {{children.divisionName==null ? children.name:children.divisionName}}
  51. </button>
  52. </view>
  53. </view>
  54. </view>
  55. </view>
  56. <!-- 桩号 -->
  57. <view v-if="TabCur==1">
  58. <view>
  59. <view style="display: flex;flex-wrap: wrap;">
  60. <view v-for="(item,index) in stakeList" :key="index">
  61. <button @click="chooseStake(item)" style="margin: 26rpx 20rpx 0 0;font-size: 26rpx;height: 72rpx;line-height: 72rpx;">
  62. {{item.stake}}
  63. </button>
  64. </view>
  65. </view>
  66. </view>
  67. </view>
  68. </scroll-view>
  69. </view>
  70. <!-- 底部-->
  71. <view class="cu-bar tabbar bg-white shadow foot solid-type-top" style="height: 120rpx;margin-top: 20rpx;">
  72. <!-- <view class="btn-group text-xxl " style="padding: 0 60rpx;">
  73. <button class="cu-btn lg bg-yellow text-white round " @click="back" style="width: 270rpx;height: 88rpx;font-size: 30rpx;">取消</button>
  74. <button class="cu-btn lg bg-blue round " @click="certain()" style="width: 270rpx;height: 88rpx;font-size: 30rpx">确定</button>
  75. </view> -->
  76. <button class="cu-btn lg round margin-lr-xl" @click="back" style="width: 100%;font-size: 30rpx;">取消</button>
  77. </view>
  78. </view>
  79. <view class="cu-modal" :class="modalShow ? 'show':''">
  80. <view class="cu-dialog" style="width: 60%;">
  81. <view class="cu-bar bg-white justify-end">
  82. <view class="content">提示</view>
  83. <view class="action" @tap="modalShow=false">
  84. <text class="cuIcon-close text-red"></text>
  85. </view>
  86. </view>
  87. <view class="padding-xl">
  88. 请选择分类和桩号
  89. </view>
  90. </view>
  91. </view>
  92. </view>
  93. </template>
  94. <script>
  95. export default {
  96. data() {
  97. return {
  98. loadModal: false,
  99. TabCur: 0,
  100. modalName: "",
  101. modalShow: false,
  102. modelList: [{
  103. name: '选择分类'
  104. }, {
  105. name: '选择桩号'
  106. }],
  107. menuList: [{
  108. url: "",
  109. imageurl: "/static/index/fill-Information.png",
  110. name: '资料填报',
  111. type: 1
  112. },
  113. {
  114. url: "/pages/informationProgress/informationProgress",
  115. imageurl: "/static/index/dataAccuracy.png",
  116. name: '资料进度',
  117. type: ""
  118. },
  119. {
  120. url: "/pages/conSchedule/conSchedule",
  121. imageurl: "/static/index/shigong.png",
  122. name: '施工进度',
  123. type: ""
  124. },
  125. {
  126. url: "/pages/constructionLog/constructionLog",
  127. imageurl: "/static/index/sglog.png",
  128. name: '施工日志',
  129. type: ""
  130. },
  131. {
  132. url: "/pages/conLedger/conLedger",
  133. imageurl: "/static/index/constructionLedger.png",
  134. name: '施工台账',
  135. type: ""
  136. },
  137. {
  138. url: "/pages/task/task",
  139. imageurl: "/static/index/myTask.png",
  140. name: '我的任务',
  141. type: ""
  142. },
  143. {
  144. url: "/pages/smartSearch/smartSearch",
  145. imageurl: "/static/index/smartQuery.png",
  146. name: '智能查阅',
  147. type: ""
  148. },
  149. {
  150. url: "",
  151. imageurl: "/static/index/graphic.png",
  152. name: '图文识别',
  153. type: ""
  154. },
  155. ],
  156. taskList: [],
  157. gridCol: 4,
  158. gridBorder: false,
  159. menuBorder: false,
  160. menuArrow: false,
  161. menuCard: false,
  162. projectId: 0,
  163. contractId: 0,
  164. userInfo: "",
  165. projectList: "",
  166. divideClientList: "",
  167. stakeList: [], //桩号
  168. divisionName: "请选择",
  169. stake: "请选择",
  170. chooseDate: null,
  171. noShow:false,
  172. childrenContracts:[],
  173. curContractNumber:'',
  174. engineeringType:'',//6为隐蔽工程
  175. }
  176. },
  177. onLoad(e) {
  178. this.engineeringType = e.type
  179. this.onLoadData();
  180. //console.log(this.projectList)
  181. if(this.projectList.contract_type == 1 || this.projectList.contract_type == 2 ){
  182. //监理抽检
  183. this.getChildrenContractName();
  184. }else{
  185. this.findDivideClient();
  186. }
  187. },
  188. onShow() {
  189. // this.onLoadData();
  190. // this.findDivideClient();
  191. },
  192. methods: {
  193. back(){
  194. uni.navigateBack({
  195. delta:1
  196. })
  197. },
  198. tabSelect(e) {
  199. if(this.divisionName=='请选择'){
  200. this.$prompt.none("请选择分类")
  201. return;
  202. }
  203. this.TabCur = e
  204. },
  205. /* 刷新方法 */
  206. onLoadData() {
  207. var userInfo = uni.getStorageSync("userInfo")
  208. if (userInfo) {
  209. this.userInfo = userInfo;
  210. }
  211. var project = uni.getStorageSync("porject"+"_"+uni.getStorageSync("userInfo").id);
  212. if (project) {
  213. this.projectList = project; //获取选中的当前项目
  214. //this.findTask(userInfo.id, this.projectList.contractId);
  215. } else {
  216. //this.findProject();
  217. }
  218. },
  219. navTo(value) {
  220. if (1 != value.type) {
  221. if (value.url) {
  222. uni.navigateTo({
  223. url: value.url
  224. })
  225. } else {
  226. this.$prompt.none("开发中")
  227. }
  228. } else { //显示弹窗
  229. this.$prompt.none("请选择分类和桩号")
  230. }
  231. },
  232. certain() {
  233. if (this.stake == '请选择' || this.divisionName == '请选择') {
  234. this.$prompt.none("请选择分类和桩号")
  235. return;
  236. }
  237. let text = "?id=" + this.chooseDate.id + "&name=" + this.chooseDate.name;
  238. if(this.engineeringType){
  239. text += "&type="+this.engineeringType;
  240. }
  241. uni.navigateTo({
  242. url: "/pages/personBase/personBase"+text
  243. })
  244. },
  245. navToTaskDetails(item) {
  246. var type;
  247. if (item.task_category == 2) {
  248. type = 2
  249. } else if (item.task_category == 3) {
  250. type = 3
  251. } else {
  252. type = 1
  253. }
  254. uni.navigateTo({
  255. url: "/pages/task/details/details?type=" + type + "&value=0" + "&contractid=" +item.contract_info_id
  256. })
  257. },
  258. search() {
  259. uni.setStorageSync("pageType", 0);
  260. uni.navigateTo({
  261. url: "/pages/search/search"
  262. })
  263. },
  264. /* 获取单位工程、分部工程*/
  265. findDivideClient() {
  266. var that = this;
  267. let obj = {
  268. contractId:this.projectList.contractId,
  269. }
  270. if(this.engineeringType){
  271. obj.type = this.engineeringType;
  272. }
  273. that.http.request('/app/divideClient/findDivideClientByType', obj).then((result)=>{
  274. if(result.datas!=null){
  275. that.divideClientList = result.datas;
  276. //console.log(that.divideClientList);
  277. }else{
  278. that.$prompt.none("暂无数据")
  279. }
  280. });
  281. },
  282. /* 选择分部工程*/
  283. chooseDivision(data) {
  284. var that =this;
  285. that.stakeList = [];
  286. that.divisionName = data.divisionName==null ? data.name:data.divisionName;
  287. let obj = {
  288. parentId:data.parentId,
  289. divisionName:data.divisionName,
  290. };
  291. if(this.engineeringType){
  292. obj.type = this.engineeringType
  293. }
  294. that.http.request("/app/divideClient/findBystake",obj).then(res=>{
  295. if(res.result!="-1"){
  296. that.stakeList=res.datas;
  297. this.stake = '请选择'
  298. //有桩号才跳转
  299. this.TabCur = 1; //跳转分类
  300. }else{
  301. //无桩号直接自动选择
  302. data.stake = "不限"
  303. this.stakeList.push(data);
  304. this.chooseStake(data);
  305. }
  306. })
  307. },
  308. /* 选择桩号*/
  309. chooseStake(data) {
  310. this.stake = data.stake;
  311. this.chooseDate = data;
  312. //选择桩号后直接跳转
  313. this.certain()
  314. },
  315. //显示切换合同段
  316. showNoList(){
  317. this.noShow = !this.noShow;
  318. },
  319. changNo(index){
  320. this.curContractNumber = this.childrenContracts[index].contractNumber;
  321. this.findDivideClientByTypenew(this.childrenContracts[index].id);
  322. //设置监理抽检资料合同段id的缓存
  323. uni.setStorageSync("curContractId", this.childrenContracts[index].id);
  324. this.noShow = false;
  325. this.TabCur = 0
  326. },
  327. //获取字合同段名称
  328. getChildrenContractName(){
  329. this.http.request("/app/divideClient/selectcontracttype",{id:this.projectList.children_contract_ids}).then(res=>{
  330. //console.log(res)
  331. if(res.datas!=null){
  332. this.childrenContracts = res.datas;
  333. this.curContractNumber = res.datas[0].contractNumber;
  334. this.findDivideClientByTypenew(this.childrenContracts[0].id)
  335. //设置监理抽检资料合同段id的缓存
  336. uni.setStorageSync("curContractId", this.childrenContracts[0].id);
  337. }else{
  338. this.$prompt.none("暂无数据")
  339. }
  340. })
  341. },
  342. //获取监理抽检树
  343. findDivideClientByTypenew(id){
  344. this.http.request('/app/divideClient/findDivideClientByTypenew', {
  345. contractId:id,
  346. report_type :'s',
  347. foldersType :'4',
  348. supervisor_type : '1'
  349. }).then((result)=>{
  350. if(result.datas!=null){
  351. this.divideClientList = result.datas;
  352. //console.log(that.divideClientList);
  353. }else{
  354. this.$prompt.none("暂无数据")
  355. }
  356. });
  357. }
  358. },
  359. }
  360. </script>
  361. <style lang="scss">
  362. page{background-color: #fff;}
  363. .status_bar{height: var(--status-bar-height);width:100%;background:#fff;z-index: 5;position: fixed;left: 0;right: 0;}
  364. .top_b{z-index: 5;background: #fff;position: fixed;left: 0;top:var(--status-bar-height);width: 750rpx;}
  365. .top_b_1{display: flex;justify-content: space-around;height: 90rpx;align-items: center;padding: 0 100rpx;}
  366. .text-blues{color: #AEAEAE;}
  367. .text-blue_one{position: absolute;bottom: -20rpx;left: 70rpx;width: 134rpx;height: 8rpx;border-radius: 30rpx;background-color: #0A8CD5;}
  368. .text-blue_ones{position: absolute;bottom: -20rpx;left: 70rpx;width: 134rpx;height: 8rpx;border-radius: 30rpx;background-color: #EF9D1E;}
  369. .text-blue1{color: #EF9D1E;}
  370. .tot_button{padding:0rpx 22rpx;}
  371. .tot_button_1{display: flex;justify-content: space-between;border-bottom: 2rpx solid #E3E1E1;padding: 28rpx 0rpx 20rpx;}
  372. .tot_button_1 button{width: 342rpx;height: 88rpx;font-size: 32rpx;border-radius: 10rpx;}
  373. .button_divisionName{color: #0A8CD5;background-color: #C6E6FF;}
  374. .button_stake{color: #EF9D1E;background-color: #FCF1E2;}
  375. uni-button:after {border: none;}
  376. .cu-list.grid {
  377. background-color: #F7F7F7;
  378. text-align: center;
  379. }
  380. .solid-type {
  381. border-bottom: 2upx solid black;
  382. }
  383. .solid-type-top {
  384. border-top: 2upx solid rgba(0, 0, 0, 0.1);
  385. }
  386. .dashed-type {
  387. border-bottom: 2upx dashed black;
  388. }
  389. .box {
  390. margin-top: -20rpx;
  391. }
  392. .box view.cu-bar {
  393. margin-top: 20upx;
  394. }
  395. .page {
  396. width: 100vw;
  397. }
  398. .page.show {
  399. overflow: hidden;
  400. }
  401. .menuImage {
  402. height: 110rpx;
  403. width: 110rpx;
  404. }
  405. .shadowType {
  406. -moz-box-shadow: 2px 2px 6px #D0D0D0;
  407. -webkit-box-shadow: 2px 2px 6px #D0D0D0;
  408. box-shadow: 2px 2px 6px #D0D0D0;
  409. }
  410. .cu-list.grid>.cu-item uni-text {
  411. display: block;
  412. margin-top: 4px;
  413. color: black;
  414. font-size: 14px;
  415. line-height: 17px;
  416. }
  417. .cu-dialog {
  418. position: relative;
  419. display: inline-block;
  420. vertical-align: middle;
  421. margin-left: auto;
  422. margin-right: auto;
  423. width: 100%;
  424. max-width: 100%;
  425. /* height: 100%; */
  426. background-color: #f8f8f8;
  427. border-radius: 4px;
  428. overflow: hidden;
  429. }
  430. .bg-diy-yellow {
  431. background-color: #FDF1DF;
  432. }
  433. .bg-diy-blue {
  434. background-color: #D7ECF8;
  435. }
  436. .menuImageNoTask{width:162rpx;height: 105rpx;margin-top: 60rpx;}
  437. </style>