update.vue 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664
  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. <template v-if="dateList[0].taskStatus == '0' || dateList[0].taskStatus == '1'">
  10. <button @click="repeal()" class="margin-top-ssm cu-btn line-blue round text-white" style="width: 130rpx;height: 66rpx;padding: 0;">废除</button>
  11. </template>
  12. <template v-else>
  13. <button @click="save(2)" class="margin-top-ssm cu-btn line-blue round text-white" style="width: 130rpx;height: 66rpx;padding: 0;">上报</button>
  14. </template>
  15. <!-- <button @click="save()" class="margin-top-ssm cu-btn line-blue round text-white" style="width: 160rpx;height: 66rpx;padding: 0;">保存</button> -->
  16. <button class="margin-top-ssm cu-btn round line-blue text-white">
  17. <button class="cu-btn line-blue" style="padding:0 20rpx 0 10rpx" @click="save(1)">
  18. <text class="text-white">预览</text>
  19. </button>
  20. <template v-if="!(dateList[0].taskStatus == '0' || dateList[0].taskStatus == '1')">
  21. <text class="bg-white" style="width: 1rpx;height: 30rpx;"></text>
  22. <button class=" cu-btn line-blue" style="padding:0 10rpx 0 20rpx" @click="save()">
  23. <text class="text-white">保存</text>
  24. </button>
  25. </template>
  26. </button>
  27. </view>
  28. </block>
  29. </cu-custom>
  30. <!-- 项目合同段信息 -->
  31. <!-- <view style="background-color: #fff;padding: 22rpx;margin-bottom: 20rpx;">
  32. <view style="font-size: 30rpx;color: #101010;font-weight: bold;">{{project.project_name}}</view>
  33. <view style="font-size: 28rpx;color: #101010;margin-top: 10rpx;">{{project.contractName}}</view>
  34. </view> -->
  35. <view v-for="(data,index) in dateList" :key="index">
  36. <form>
  37. <view class="cu-form-group_1 flex justify-between">
  38. <view>
  39. <text class="title">日志{{index+1}}</text>
  40. <button class="cu-btn round sm margin-left-sm" @click="addNow(index)" v-if="!(data.taskStatus==0 || data.taskStatus==1)">复制当前</button>
  41. </view>
  42. <button class="cu-btn round sm" @click="delOne(index)" v-if="!(data.taskStatus==0 || data.taskStatus==1)&&(index != 0)">删除</button>
  43. </view>
  44. <template v-if="project && project.contract_type == 1">
  45. <checkbox-group @change="checkboxChange($event,index,1)" class="block" style="padding: 0 10px;background-color: #FFFFFF;">
  46. <view>单位</view>
  47. <template v-for="(item,index2) in data.constructi2onList">
  48. <view style="padding-top: 10px;">
  49. <checkbox v-if="item.contractorUnitName" :value='item.id' class='round' :class="item.checked?'checked':''" :checked="item.checked" :disabled="(data.taskStatus==0)||(data.taskStatus==1)" style="transform:scale(0.82)"></checkbox>
  50. <text style="margin-left: 20rpx;">{{item.contractorUnitName}}</text>
  51. </view>
  52. </template>
  53. </checkbox-group>
  54. <checkbox-group @change="checkboxChange($event,index,2)" class="block" style="padding: 0 10px;background-color: #FFFFFF;">
  55. <view>合同段</view>
  56. <template v-for="(item,index2) in data.contractIdDataList">
  57. <span style="padding-top: 10px;margin-right: 30rpx;">
  58. <checkbox v-if="item.contractNumber" :value='item.id' class='round' :class="item.checked?'checked':''" :checked="item.checked" :disabled="(data.taskStatus==0)||(data.taskStatus==1)" style="transform:scale(0.82)"></checkbox>
  59. <text style="margin-left: 10rpx;">{{item.contractNumber}}</text>
  60. </span>
  61. </template>
  62. </checkbox-group>
  63. </template>
  64. <view class="cu-form-group_1">
  65. <view class="title">巡视时间</view>
  66. <input placeholder-style="color:#AEAEAE" placeholder="请输入" disabled="" v-model="data.date" name="input"></input>
  67. </view>
  68. <view class="cu-form-group_1">
  69. <view class="title">编号</view>
  70. <input placeholder-style="color:#AEAEAE" placeholder="请输入" v-model="data.serialNumber" :disabled="(data.taskStatus==0)||(data.taskStatus==1)" name="input"></input>
  71. </view>
  72. </form>
  73. <form>
  74. <view class="cu-form-group_2">
  75. <view class="title">巡视的范围</view>
  76. <view>
  77. <textarea placeholder-style="color:#AEAEAE" maxlength="-1" v-model="data.jobContent" :disabled="(data.taskStatus==0)||(data.taskStatus==1)" placeholder="请输入"></textarea>
  78. </view>
  79. </view>
  80. <!-- <view class="cu-form-group_2">
  81. <view class="title flex justify-between">
  82. <text>关联工序</text>
  83. <button class="cu-btn round line-blue sm" @click="toSelectProcess(index)" style="font-size: 26rpx;">
  84. <text class="cuIcon-add"></text>新增
  85. </button>
  86. </view>
  87. <view>
  88. <view class="text-gray" v-if="data.processList && data.processList.length < 1">可多选,添加关联工序后可在资料填报页面查看关联的旁站记录</view>
  89. <template v-else>
  90. <view v-for="(process,index2) in data.processList" :key="process.id" style="margin-bottom: 10rpx;">
  91. <text class="text-gray process-line" style="position: relative;">{{process.pathName || process.name}}
  92. <image src="/static/index/delete-blue.png" style="width: 32rpx;height: 32rpx;position: absolute;bottom: 0;" @click="deleProcess(index2,index)"></image>
  93. </text>
  94. </view>
  95. </template>
  96. </view>
  97. </view> -->
  98. <view class="cu-form-group_2">
  99. <view class="title">主要施工情况</view>
  100. <view>
  101. <textarea placeholder-style="color:#AEAEAE" maxlength="-1" v-model="data.patrolContent" :disabled="(data.taskStatus==0)||(data.taskStatus==1)" placeholder="请输入"></textarea>
  102. </view>
  103. </view>
  104. <view class="cu-form-group_2">
  105. <view class="title">质量、安全、环保等情况</view>
  106. <view>
  107. <textarea placeholder-style="color:#AEAEAE" maxlength="-1" v-model="data.acceptance" :disabled="(data.taskStatus==0)||(data.taskStatus==1)" placeholder="请输入"></textarea>
  108. </view>
  109. </view>
  110. <view class="cu-form-group_2">
  111. <view class="title">发现的问题及处理意见</view>
  112. <view>
  113. <textarea placeholder-style="color:#AEAEAE" maxlength="-1" v-model="data.problem" :disabled="(data.taskStatus==0)||(data.taskStatus==1)" placeholder="请输入"></textarea>
  114. </view>
  115. </view>
  116. </form>
  117. </view>
  118. <view class="cu-bar bg-white tabbar" style="border: none;"></view>
  119. <view class="cu-bar bg-white tabbar border shop" style="position: fixed;bottom: 0;left: 0;width: 100%;border-top: 1rpx solid #EAEAEA;">
  120. <view class="flex solid-bottom padding justify-between" style="width: 100%;">
  121. <text></text>
  122. <button class="cu-btn round" @click="addOne" v-if="!(dateList[0].taskStatus == '0' || dateList[0].taskStatus == '1')">新增</button>
  123. </view>
  124. </view>
  125. <!-- <form>
  126. <view class="cu-form-group_1" @click="navTo(2)" style="justify-content: space-between;">
  127. <view class="title">监理员</view>
  128. <input placeholder-style="color:#AEAEAE" placeholder="请选择" v-model="data.supervisionWorker" disabled="" style="width: 520rpx;"></input>
  129. <text class='cuIcon-right'></text>
  130. </view>
  131. <view class="cu-form-group_1" @click="navTo(1)" style="justify-content: space-between;">
  132. <view class="title">施工员</view>
  133. <input placeholder-style="color:#AEAEAE" placeholder="请选择" v-model="data.constructionWorker" disabled="" style="width: 520rpx;"></input>
  134. <text class='cuIcon-right'></text>
  135. </view>
  136. </form> -->
  137. <!-- 时间弹窗 -->
  138. <view class="cu-modal bottom-modal" :class="modalShow?'show':''">
  139. <view class="cu-dialog" style="background-color: white;border-radius: 20rpx 20rpx 0 0;">
  140. <view class="cu-bar bg-white">
  141. <view class="action text-gray"></view>
  142. <view class="action text-black text-bold" style="color: #101010;">选择时间</view>
  143. <view class="action text-gray" @tap="showdialog()">取消</view>
  144. </view>
  145. <view style="padding-bottom: 10rpx;">
  146. <calendar @selected-change="datechange" :showBack="false" :dotStyle="dotStyle"></calendar>
  147. </view>
  148. </view>
  149. </view>
  150. </view>
  151. </template>
  152. <script>
  153. export default {
  154. data() {
  155. return {
  156. dotStyle: {
  157. color: 'black'
  158. },
  159. project: "",
  160. time: "",
  161. constructionList: [],
  162. supervisionList: [],
  163. modalShow: false,
  164. // data: {
  165. // },
  166. dateList:[{
  167. pageNumber:1,
  168. recorderId:uni.getStorageSync("userInfo").id,
  169. contractId:uni.getStorageSync("porject"+"_"+uni.getStorageSync("userInfo").id).contractId,
  170. processList:[],
  171. constructi2onList:[],
  172. contractIdDataList:[],
  173. }],
  174. curIndex:0,
  175. updateOrInsert: 0, //0为新增 , 1为编辑
  176. upId: null,
  177. constructi2onList:[],
  178. contractIdDataList:[],
  179. contractId : uni.getStorageSync("porject"+"_"+uni.getStorageSync("userInfo").id).contractId,
  180. project:uni.getStorageSync("porject"+"_"+uni.getStorageSync("userInfo").id),
  181. recorderId:uni.getStorageSync("userInfo").id,
  182. }
  183. },
  184. async onLoad(e) {
  185. this.dateList[0].date = e.time;
  186. this.project = uni.getStorageSync("porject" + "_" + uni.getStorageSync("userInfo").id);
  187. this.updateOrInsert = e.type;
  188. this.upId = e.id;
  189. if(this.project.contract_type == 1){
  190. await this.getcontractInfoListByContract();
  191. }
  192. //console.log(this.constructi2onList)
  193. //debugger
  194. if (this.updateOrInsert == 1) { //获取日志信息进行绑定
  195. //this.findData(this.upId);
  196. this.getDataByDate(e.time);
  197. } else {
  198. //获取合同段的地址,根据地址获取温度和天气
  199. var that = this;
  200. var cityName = uni.getStorageSync("porject" + "_" + uni.getStorageSync("userInfo").id).project_place;
  201. that.http.request("/app/diary/getWeather", {
  202. projectId:that.project.id,
  203. contractId:that.contractId,
  204. date:e.time
  205. }).then((res) => {
  206. //that.$set(that.data,'averageTemperature',res.tempSection);
  207. that.$set(that.dateList[0], 'weather', res.weather);
  208. //that.data.averageTemperature =res.tempSection;
  209. //that.data.weather = res.weather
  210. })
  211. this.dateList[0].constructi2onList = this.getNewOption(this.constructi2onList)
  212. this.dateList[0].contractIdDataList = this.getNewOption(this.contractIdDataList);
  213. }
  214. //监听选择工序
  215. uni.$on('selectProcess',this.selectProcess)
  216. uni.$on('report',this.reportSuccess)
  217. },
  218. onUnload(){
  219. uni.$off('selectProcess',this.selectProcess)
  220. uni.$off('report',this.reportSuccess)
  221. },
  222. methods: {
  223. showdialog() {
  224. this.modalShow = !this.modalShow;
  225. },
  226. datechange(e) {
  227. this.data.startTime = e.fullDate
  228. this.showdialog();
  229. },
  230. navTo(value) {
  231. uni.navigateTo({
  232. url: "/pages/constructionLog/personnel/personnel?type=" + value
  233. })
  234. },
  235. //获取该日志的数据,编辑
  236. findData(id) {
  237. var that = this;
  238. that.http.request('/app/patrol/getDataById', {
  239. id: id
  240. }).then((result) => {
  241. that.data = result.data;
  242. that.$delete(that.data, 'prefix');
  243. })
  244. },
  245. // save(){
  246. // var that =this;
  247. // /* let result= that.$formValidate.validate(this.data,this.rules)//表单验证
  248. // if(result.isOk){ */
  249. // let param =that.data;
  250. // param.contractId= this.project.contractId;
  251. // param.creator= uni.getStorageSync("userInfo").id;
  252. // param.state= that.data.state==null ? 0 : that.data.state;
  253. // param.deleted= that.data.deleted==null ? 0 : that.data.deleted;
  254. // param.createTime=new Date();
  255. // that.http.request('/app/diary/addOrUpdate', param).then((result)=>{
  256. // if(result.result=="1"){
  257. // that.$prompt.none(result.msg);
  258. // setTimeout(function(){
  259. // uni.navigateBack({
  260. // delta:1
  261. // })
  262. // },500)
  263. // }else{
  264. // that.$prompt.Error("保存失败");
  265. // }
  266. // })
  267. // /* }else{
  268. // that.$prompt.none(result.errmsg)
  269. // } */
  270. // }
  271. save(type) {
  272. if(!this.verification()){
  273. uni.showToast({
  274. title: '每份日志至少要填写一项内容',
  275. icon:'none',
  276. duration: 2000
  277. });
  278. return;
  279. }
  280. // this.data.contractId = this.project.contractId;
  281. // this.data.recorderId = uni.getStorageSync("userInfo").id;
  282. for (let j=0; j < this.dateList.length; j++){
  283. let arr = [];
  284. if(this.dateList[j].processList){
  285. for (let i = 0; i < this.dateList[j].processList.length; i++) {
  286. arr.push(this.dateList[j].processList[i].id);
  287. }
  288. }
  289. this.dateList[j].processId = arr.join(',');
  290. if (this.constructi2onList && this.constructi2onList.length > 0) {
  291. var arr2 = [];
  292. for (var i = 0; i < this.dateList[j].constructi2onList.length; i++) {
  293. if(this.dateList[j].constructi2onList[i].checked){
  294. arr2.push(this.dateList[j].constructi2onList[i].id)
  295. }
  296. }
  297. this.dateList[j].constructionUnits = arr2.join(',');
  298. } else {
  299. this.dateList[j].constructionUnits = null;
  300. }
  301. if (this.contractIdDataList && this.contractIdDataList.length > 0) {
  302. var arr2 = [];
  303. for (var i = 0; i < this.dateList[j].contractIdDataList.length; i++) {
  304. if(this.dateList[j].contractIdDataList[i].checked){
  305. arr2.push(this.dateList[j].contractIdDataList[i].id)
  306. }
  307. }
  308. this.dateList[j].contractIds = arr2.join(',');
  309. } else {
  310. this.dateList[j].contractIds = null;
  311. }
  312. }
  313. //this.http.request('/app/patrol/addEntity.json', JSON.stringify(this.dateList), 1).then((res) => {
  314. this.http.request('/app/patrol/addEntity.json', {voStr:JSON.stringify(this.dateList),storeName:uni.getStorageSync("storeName")}).then((res) => {
  315. if (res.result == "1") {
  316. let urlArr = [];
  317. for (let i = 0; i < res.datas.length; i++) {
  318. this.dateList[i].id = res.datas[i].id;
  319. this.dateList[i].outUrl = res.datas[i].outUrl;
  320. urlArr.push(res.datas[i].outUrl);
  321. }
  322. this.$prompt.none(res.msg);
  323. setTimeout(()=> {
  324. if (type == 1) {
  325. //跳去预览
  326. uni.navigateTo({
  327. url: "/pages/view/preview/preview?previews=" + urlArr.join(',')
  328. })
  329. }else if(type == 2){
  330. getApp().globalData.diary = res.datas[0];
  331. uni.navigateTo({
  332. url:"/pages/dataReport/dailyReport?urlName="+"patrol"+"&isZJ="+"0"
  333. })
  334. } else {
  335. uni.navigateBack({
  336. delta: 1
  337. })
  338. }
  339. }, 500)
  340. } else {
  341. this.$prompt.Error("保存失败,"+res.msg);
  342. }
  343. })
  344. },
  345. radioChange(event,type){
  346. //console.log(event.target.value,type);
  347. this.data[type] = event.target.value;
  348. },
  349. //跳转选择工序
  350. toSelectProcess(index){
  351. this.curIndex = index;
  352. uni.navigateTo({
  353. url:"/pages/constructionLog2/selectProcess/selectProcess"
  354. })
  355. },
  356. //选择工序
  357. selectProcess(process){
  358. //console.log(process);
  359. //console.log(this.dateList[this.curIndex]);
  360. this.dateList[this.curIndex].processList.push(process);
  361. },
  362. //移除工序
  363. deleProcess(index,curIndex){
  364. this.dateList[curIndex].processList.splice(index,1);
  365. },
  366. verification(){
  367. let verify = true;
  368. for (let i = 0; i < this.dateList.length; i++) {
  369. if(!this.dateList[i].serialNumber && !this.dateList[i].jobContent &&
  370. !(this.dateList[i].processList && this.dateList[i].processList.length > 0) &&
  371. !this.dateList[i].patrolContent && !this.dateList[i].acceptance &&
  372. !this.dateList[i].problem
  373. ){
  374. verify = false;
  375. }else{
  376. verify = true;
  377. }
  378. }
  379. return verify;
  380. },
  381. addOne(){
  382. this.dateList.push({
  383. date:this.dateList[0].date,//日期
  384. weather:this.dateList[0].weather,//天气
  385. pageNumber:this.dateList[this.dateList.length-1].pageNumber+1,
  386. processList:[],
  387. recorderId:this.dateList[0].recorderId,
  388. contractId:this.dateList[0].contractId,
  389. constructi2onList : this.getNewOption(this.constructi2onList),
  390. contractIdDataList : this.getNewOption(this.contractIdDataList)
  391. })
  392. },
  393. addNow(index){
  394. let addObj = Object.assign({},this.dateList[index]);
  395. addObj.pageNumber = addObj.pageNumber+1;
  396. addObj.processList = [].concat(addObj.processList);
  397. addObj.constructi2onList = this.getNewOption(addObj.constructi2onList);
  398. addObj.contractIdDataList = this.getNewOption(addObj.contractIdDataList);
  399. addObj.id = '';
  400. for (let i = index+1; i < this.dateList.length; i++) {
  401. this.dateList[i].pageNumber += 1;
  402. }
  403. this.dateList.splice(index+1,0,addObj);
  404. //console.log(this.dateList)
  405. },
  406. delOne(index){
  407. uni.showModal({
  408. title: '删除',
  409. content: '是否删除 日志'+(index+1)+' ?'+'删除后无法还原',
  410. success:(res) => {
  411. if (res.confirm) {
  412. //console.log('用户点击确定');
  413. //没保存过直接删
  414. if(!this.dateList[index].id){
  415. this.dateList.splice(index,1);
  416. return;
  417. }
  418. //保存过的需要请求
  419. this.http.request('/app/patrol/del', {
  420. id: this.dateList[index].id,
  421. }).then((result) => {
  422. if(result.result ==1){
  423. this.dateList.splice(index,1);
  424. }else{
  425. this.$prompt.Error("删除失败");
  426. }
  427. })
  428. } else if (res.cancel) {
  429. //console.log('用户点击取消');
  430. }
  431. }
  432. });
  433. },
  434. getDataByDate(date){
  435. this.http.request('/app/patrol/getDataByDate', {
  436. date: date,
  437. recorderId:this.recorderId,
  438. contractId:this.contractId,
  439. }).then((result) => {
  440. if(result.result ==1){
  441. if(result.datas){
  442. for (let i = 0; i < result.datas.length; i++) {
  443. result.datas[i].contractId = this.contractId;
  444. result.datas[i].processList = result.datas[i].proList;
  445. result.datas[i].constructi2onList = this.getNewOption(this.constructi2onList);
  446. result.datas[i].contractIdDataList = this.getNewOption(this.contractIdDataList);
  447. var items,values;
  448. if(result.datas[i].constructionUnits){
  449. items= result.datas[i].constructi2onList;
  450. values = result.datas[i].constructionUnits.split(",");
  451. this.setChecked(items,values)
  452. }
  453. if(result.datas[i].contractIds){
  454. values = result.datas[i].contractIds.split(",");
  455. items= result.datas[i].contractIdDataList;
  456. this.setChecked(items,values)
  457. }
  458. }
  459. this.dateList =result.datas;
  460. // var items,values;
  461. // if(this.dateList[0].constructionUnits){
  462. // items= this.constructi2onList;
  463. // values = this.dateList[0].constructionUnits.split(",");
  464. // this.setChecked(items,values)
  465. // }
  466. // if(this.dateList[0].contractIds){
  467. // values = this.dateList[0].contractIds.split(",");
  468. // items= this.contractIdDataList;
  469. // this.setChecked(items,values)
  470. // }
  471. }else{
  472. this.$prompt.Error(result.msg);
  473. }
  474. }else{
  475. this.$prompt.Error(result.msg);
  476. }
  477. })
  478. },
  479. getPageNumber(){
  480. let max = 1;
  481. for (let i = 0; i < this.dateList.length; i++) {
  482. if(this.dateList[i].pageNumber > max){
  483. max = this.dateList[i].pageNumber;
  484. }
  485. }
  486. return max+1;
  487. },
  488. async getcontractInfoListByContract(){
  489. let result = await this.http.request('/app/parameterLog/getcontractInfoListByContract',{
  490. contractId:this.contractId,
  491. })
  492. if(result.result == '1'){
  493. this.constructi2onList = [];
  494. this.contractIdDataList = [];
  495. for (var i = 0; i < result.datas.length; i++) {
  496. this.constructi2onList.push({
  497. id:result.datas[i].id,
  498. contractorUnitName:result.datas[i].contractorUnitName,
  499. checked:false,
  500. })
  501. this.contractIdDataList.push({
  502. id:result.datas[i].id,
  503. contractNumber:result.datas[i].contractNumber,
  504. checked:false,
  505. })
  506. }
  507. }else{
  508. }
  509. },
  510. checkboxChange(e,index,type){
  511. //console.log(e.detail.value)
  512. let items = []
  513. if(type == 1){
  514. items = this.dateList[index].constructi2onList
  515. }else if(type == 2){
  516. items = this.dateList[index].contractIdDataList
  517. }
  518. let values = e.detail.value
  519. this.setChecked(items,values)
  520. },
  521. setChecked(items,values){
  522. for (let i = 0, lenI = items.length; i < lenI; ++i) {
  523. items[i].checked = false
  524. for (let j = 0, lenJ = values.length; j < lenJ; ++j) {
  525. if (items[i].id === values[j]) {
  526. //console.log(values[j])
  527. items[i].checked = true
  528. break
  529. }
  530. }
  531. }
  532. },
  533. getNewOption(list){
  534. var newList = [];
  535. for (var i = 0; i < list.length; i++) {
  536. newList.push(Object.assign({},list[i]));
  537. }
  538. return newList;
  539. },
  540. repeal(){
  541. let { account } = uni.getStorageSync('userInfo')
  542. uni.showModal({
  543. title: '废除',
  544. content: '是否废除任务?',
  545. success:(res) => {
  546. if (res.confirm) {
  547. this.http.request('/app/task/repeal', {
  548. taskId: this.dateList[0].taskId,
  549. opUserName: account ? account : '',
  550. }).then((result) => {
  551. if(result.result ==1){
  552. this.$prompt.none("废除成功");
  553. this.getDataByDate(this.dateList[0].date);
  554. }else{
  555. this.$prompt.Error("废除失败");
  556. }
  557. })
  558. } else if (res.cancel) {
  559. //console.log('用户点击取消');
  560. }
  561. }
  562. });
  563. },
  564. reportSuccess(){
  565. //上报成功,刷新
  566. this.getDataByDate(this.dateList[0].date);
  567. }
  568. },
  569. onShow() {
  570. /* 监听选择施工人员页面的handleFun方法 */
  571. // uni.$on("handleFun", res => {
  572. // this.data.constructionWorker="";
  573. // this.constructionList=res;
  574. // res.forEach((item)=>{
  575. // this.data.constructionWorker+=item.user_name
  576. // })
  577. // })
  578. /* 监听选择监理人员页面的handleFun方法 */
  579. // uni.$on("handleFunBy", res => {
  580. // this.data.supervisionWorker="";
  581. // this.supervisionList=res;
  582. // res.forEach((item)=>{
  583. // this.data.supervisionWorker+=item.user_name
  584. // })
  585. // })
  586. },
  587. }
  588. </script>
  589. <style>
  590. .solid-top-type {
  591. border-top: 0px solid #eee;
  592. }
  593. .cu-form-group_1 {
  594. display: flex;
  595. align-items: center;
  596. padding: 0 22rpx;
  597. background-color: #fff;
  598. border-bottom: 2rpx solid #EAEAEA;
  599. height: 88rpx;
  600. }
  601. .cu-form-group_1 .title {
  602. font-size: 30rpx;
  603. color: #101010;
  604. width: 154rpx;
  605. }
  606. .cu-form-group_1 input {
  607. font-size: 30rpx;
  608. color: #8a8a8a;
  609. }
  610. .cu-form-group_2 {
  611. padding: 22rpx;
  612. background-color: #fff;
  613. border-bottom: 2rpx solid #EAEAEA;
  614. }
  615. .cu-form-group_2 .title {
  616. font-size: 30rpx;
  617. color: #101010;
  618. padding-bottom: 18rpx;
  619. }
  620. .cu-form-group_2 textarea {
  621. font-size: 30rpx;
  622. color: #8a8a8a;
  623. width: 100%;
  624. }
  625. .cu-modal.show {
  626. overflow-y: auto;
  627. pointer-events: auto;
  628. }
  629. </style>