addInspection.vue 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688
  1. <template>
  2. <view class="bg-white">
  3. <!-- 顶部 -->
  4. <cu-custom bgColor="bg-blue" :isBack="true">
  5. <block slot="backText"></block>
  6. <block slot="content"></block>
  7. <block slot="right">
  8. </block>
  9. </cu-custom>
  10. <view style="padding: 15px;">
  11. <uni-forms ref="form" label-width="110px" :modelValue="addform">
  12. <uni-forms-item label="合同段">
  13. <uni-easyinput v-model="addform.contractName" disabled placeholder="请输入合同段" />
  14. </uni-forms-item>
  15. <uni-forms-item label="检查日期" required name="startDate">
  16. <uni-datetime-picker type="date" return-type="string" :disabled="addInfoType != 1" v-model="addform.startDate"/>
  17. </uni-forms-item>
  18. <uni-forms-item label="检查单位" required name="supervisionUnitName">
  19. <uni-easyinput v-model="addform.supervisionUnitName" :disabled="addInfoType != 1" placeholder="请输入检查单位" />
  20. </uni-forms-item>
  21. <uni-forms-item label="被检单位" required>
  22. <uni-easyinput v-model="addform.contractorUnitName" disabled placeholder="请输入被检单位" />
  23. </uni-forms-item>
  24. <uni-forms-item label="是否限期整改" required>
  25. <uni-data-checkbox v-model="addform.deadline" :disabled="addInfoType != 1" :localdata="[{text: '是',value: 1}, {text: '否',value: 0}]" />
  26. </uni-forms-item>
  27. <uni-forms-item label="整改期限日期" name="endDate">
  28. <uni-datetime-picker type="date" return-type="string" :disabled="addInfoType != 1" v-model="addform.endDate"/>
  29. </uni-forms-item>
  30. <uni-forms-item label="检查人员" required name="checkName">
  31. <uni-easyinput v-model="addform.checkName" :disabled="addInfoType != 1" placeholder="请输入检查人员" />
  32. </uni-forms-item>
  33. <uni-forms-item label="整改人" required name="taskflowUser">
  34. <view class="flex">
  35. <uni-easyinput :value="taskflowUserStr" disabled />
  36. <view class="name-btn" @click="userChange(1)" v-if="addInfoType == 1">
  37. 选择+
  38. </view>
  39. <view class="name-btn name-btn-dis" v-else>
  40. 选择+
  41. </view>
  42. </view>
  43. </uni-forms-item>
  44. <uni-forms-item label="通知人" >
  45. <view class="flex">
  46. <uni-easyinput :value="noticeUserStr" disabled />
  47. <view class="name-btn" @click="userChange(2)" v-if="addInfoType == 1">
  48. 选择+
  49. </view>
  50. <view class="name-btn name-btn-dis" v-else>
  51. 选择+
  52. </view>
  53. </view>
  54. </uni-forms-item>
  55. <uni-forms-item label="隐患部位及描述">
  56. <uni-easyinput v-model="addform.hiddenDanger" :disabled="addInfoType != 1" type="textarea" placeholder="请输入隐患部位及描述" />
  57. </uni-forms-item>
  58. <uni-forms-item label="整改要求">
  59. <uni-easyinput v-model="addform.modifyRequirements" :disabled="addInfoType != 1" type="textarea" placeholder="请输入整改要求" />
  60. </uni-forms-item>
  61. </uni-forms>
  62. <view>
  63. <view class="margin-bottom-sm">
  64. <view class="flex justify-between">
  65. <view>
  66. <text>下发附件</text>
  67. <button @click="fileList.push({remark:'',files:[]})" v-if="addInfoType == 1" class="cu-btn sm margin-left-sm">新增附件</button>
  68. </view>
  69. <view>
  70. <uni-icons @click="fileUp(1)" type="upload" size="20" color="#1e91ff" class="margin-left-sm" v-if="addInfoType == 1"></uni-icons>
  71. <uni-icons type="upload" size="20" class="margin-left-sm" v-else></uni-icons>
  72. <uni-icons @click="fileListDel(1)" type="trash" size="20" color="#bd3124" class="margin-left-sm" v-if="addInfoType == 1"></uni-icons>
  73. <uni-icons type="trash" size="20" class="margin-left-sm" v-else></uni-icons>
  74. <uni-icons @click="seeImg(fileList,fileSelect)" type="eye" size="20" color="#1e91ff" class="margin-left-sm"></uni-icons>
  75. </view>
  76. </view>
  77. <uni-table ref="table" border stripe type="selection" emptyText="暂无数据" @selection-change="selectionChange">
  78. <uni-tr>
  79. <uni-th width="30" align="center">序号</uni-th>
  80. <uni-th align="center">隐患位置</uni-th>
  81. <uni-th align="center">照片/附件</uni-th>
  82. </uni-tr>
  83. <uni-tr v-for="(item, index) in fileList" :key="index">
  84. <uni-td>{{index+1}}</uni-td>
  85. <uni-td align="center">
  86. <uni-easyinput v-model="item.remark" :disabled="addInfoType != 1" placeholder="隐患位置" />
  87. </uni-td>
  88. <uni-td align="center">
  89. <view>
  90. <template v-for="(file,fileindex) in item.files">
  91. <template v-if="file.name">
  92. <text>{{file.name}}</text>
  93. <uni-icons type="closeempty" size="20" color="#e99d42" @click="fileListFliesDel(index,fileindex,fileList)" v-if="addInfoType == 1"></uni-icons>
  94. <text v-if="fileindex < item.files.length-1">、</text>
  95. </template>
  96. </template>
  97. </view>
  98. </uni-td>
  99. </uni-tr>
  100. </uni-table>
  101. </view>
  102. <view class="margin-bottom-sm">
  103. <view class="flex justify-between">
  104. <view>
  105. <text>整改附件</text>
  106. <button @click="fileList2.push({remark:'',files:[]})" v-if="addInfoType != 3" class="cu-btn sm margin-left-sm">新增附件</button>
  107. </view>
  108. <view>
  109. <uni-icons @click="fileUp(2)" type="upload" size="20" color="#1e91ff" class="margin-left-sm" v-if="addInfoType != 3"></uni-icons>
  110. <uni-icons type="upload" size="20" class="margin-left-sm" v-else></uni-icons>
  111. <uni-icons @click="fileListDel(2)" type="trash" size="20" color="#bd3124" class="margin-left-sm" v-if="addInfoType != 3"></uni-icons>
  112. <uni-icons type="trash" size="20" class="margin-left-sm" v-else></uni-icons>
  113. <uni-icons @click="seeImg(fileList2,fileSelect2)" type="eye" size="20" color="#1e91ff" class="margin-left-sm"></uni-icons>
  114. </view>
  115. </view>
  116. <uni-table ref="table2" border stripe type="selection" emptyText="暂无数据" @selection-change="selectionChange2">
  117. <uni-tr>
  118. <uni-th width="30" align="center">序号</uni-th>
  119. <uni-th align="center">隐患位置</uni-th>
  120. <uni-th align="center">照片/附件</uni-th>
  121. </uni-tr>
  122. <uni-tr v-for="(item, index) in fileList2" :key="index">
  123. <uni-td>{{index+1}}</uni-td>
  124. <uni-td align="center">
  125. <uni-easyinput v-model="item.remark" :disabled="addInfoType == 3" placeholder="隐患位置" />
  126. </uni-td>
  127. <uni-td align="center">
  128. <view>
  129. <template v-for="(file,fileindex) in item.files">
  130. <template v-if="file.name">
  131. <text>{{file.name}}</text>
  132. <uni-icons type="closeempty" size="20" color="#e99d42" @click="fileListFliesDel(index,fileindex,fileList2)" v-if="addInfoType != 3"></uni-icons>
  133. <text v-if="fileindex < item.files.length-1">、</text>
  134. </template>
  135. </template>
  136. </view>
  137. </uni-td>
  138. </uni-tr>
  139. </uni-table>
  140. </view>
  141. </view>
  142. </view>
  143. <view style="height: 120rpx;"></view>
  144. <view class="fixed-bottom">
  145. <view v-if="addInfoType == 1 || addInfoType == 2">
  146. <button class="cu-btn" @click="submitForm">确定</button>
  147. <button class="cu-btn line-grey margin-left-lg" @click="backPage">取消</button>
  148. </view>
  149. <view v-if="addInfoType == 3">
  150. <template v-if="type2 =='review'">
  151. <button class="cu-btn bg-green" @click="finish">更新为已办结</button>
  152. <button class="cu-btn line-grey margin-left-lg" @click="backPage">取消</button>
  153. </template>
  154. <template v-else>
  155. <button class="cu-btn line-grey margin-left-lg" @click="backPage">取消查看</button>
  156. </template>
  157. </view>
  158. </view>
  159. </view>
  160. </template>
  161. <script>
  162. import config from "../../core/api.js"
  163. export default {
  164. data() {
  165. return {
  166. addInfoType:1,//1.正常填写,2.只有整改附件可以修改,3.都不能修改
  167. type2:'',
  168. addform:{
  169. startDate:'',
  170. endDate:'',
  171. contractName:'',
  172. contractorUnitName:'',
  173. hiddenDanger:'',
  174. modifyRequirements:'',
  175. deadline:1
  176. },
  177. userid:null,
  178. project:null,
  179. personType:1,
  180. fileList:[],
  181. fileSelect:[],
  182. fileList2:[],
  183. fileSelect2:[],
  184. // 校验规则
  185. rules: {
  186. supervisionUnitName: {
  187. rules: [{
  188. required: true,
  189. errorMessage: '请输入检查单位'
  190. }]
  191. },
  192. startDate: {
  193. rules: [{
  194. required: true,
  195. errorMessage: '请输入检查单位'
  196. }]
  197. },
  198. checkName: {
  199. rules: [{
  200. required: true,
  201. errorMessage: '请输入检查人员'
  202. }]
  203. },
  204. }
  205. }
  206. },
  207. computed:{
  208. taskflowUserStr: function () {
  209. if(this.addform.taskflowUser && this.addform.taskflowUser.length){
  210. let str = '';
  211. for(let i=0;i<this.addform.taskflowUser.length;i++){
  212. str += this.addform.taskflowUser[i].user_name;
  213. if(i < this.addform.taskflowUser.length-1){
  214. str += ','
  215. }
  216. }
  217. return str;
  218. }else{
  219. return '请选择施工单位接收人员';
  220. }
  221. },
  222. noticeUserStr:function () {
  223. if(this.addform.noticeUser && this.addform.noticeUser.length){
  224. let str = '';
  225. for(let i=0;i<this.addform.noticeUser.length;i++){
  226. str += this.addform.noticeUser[i].user_name;
  227. if(i < this.addform.noticeUser.length-1){
  228. str += ','
  229. }
  230. }
  231. return str;
  232. }else{
  233. return '请选择通知人';
  234. }
  235. }
  236. },
  237. onLoad(e) {
  238. this.userid = uni.getStorageSync("userInfo").id;
  239. this.project = uni.getStorageSync("porject"+"_"+uni.getStorageSync("userInfo").id);
  240. this.addform.contractName = this.project.contractName;
  241. this.addform.startDate = this.$dayjs().format('YYYY-MM-DD');
  242. if(e.type){
  243. this.addInfoType = e.type;
  244. }
  245. if(e.id){
  246. this.getDetail(e.id);
  247. }
  248. if(e.type2){
  249. this.type2 = e.type2;
  250. }
  251. },
  252. onShow() {
  253. this.getEditData();
  254. uni.$on("principal", res => {
  255. if(this.personType == 1){
  256. this.$set(this.addform,'taskflowUser',res);
  257. }else if(this.personType == 2){
  258. this.$set(this.addform,'noticeUser',res);
  259. }
  260. })
  261. },
  262. onReady() {
  263. // 设置自定义表单校验规则,必须在节点渲染完毕后执行
  264. this.$refs.form.setRules(this.rules)
  265. },
  266. methods: {
  267. getEditData(){
  268. this.http.request("/app/qualityModifyInfo/getEditData",{
  269. id:this.project.contractId,
  270. }).then((json)=>{
  271. if(json.result == 1){
  272. this.addform.contractorUnitName = json.data.contractorUnitName;
  273. }
  274. })
  275. },
  276. userChange(type){
  277. var list = [];
  278. this.personType = type;
  279. if(type == 1 && this.addform.taskflowUser){
  280. list = this.addform.taskflowUser;
  281. }
  282. if(type == 2 && this.addform.noticeUser){
  283. list = this.addform.noticeUser;
  284. }
  285. //把已选值储存到全局变量
  286. getApp().globalData.principal = list;
  287. uni.navigateTo({
  288. url: "/pages/constructionLog/personnel/personnel?name=" + '选择人员'
  289. })
  290. },
  291. fileUp(type){
  292. let list = [];
  293. let selects = [];
  294. if(type == 1){
  295. if(this.fileSelect.length == 0){
  296. this.$prompt.none("请先勾选数据,再上传文件");
  297. return;
  298. }
  299. selects = this.fileSelect;
  300. list = this.fileList;
  301. }else if(type == 2){
  302. if(this.fileSelect2.length == 0){
  303. this.$prompt.none("请先勾选数据,再上传文件");
  304. return;
  305. }
  306. selects = this.fileSelect2;
  307. list = this.fileList2;
  308. }
  309. uni.chooseFile({
  310. count: 99, //默认100
  311. extension:['.jpg','.png','.pdf'],
  312. success: (res)=>{
  313. //console.log(res);
  314. selects.forEach((i)=>{
  315. res.tempFiles.forEach((file)=>{
  316. list[i].files.push(file)
  317. })
  318. })
  319. }
  320. });
  321. },
  322. // 多选
  323. selectionChange(e) {
  324. //console.log(e.detail.index)
  325. this.fileSelect = e.detail.index;
  326. },
  327. selectionChange2(e) {
  328. //console.log(e.detail.index)
  329. this.fileSelect2 = e.detail.index;
  330. },
  331. fileListFliesDel(index1,index2,list){
  332. list[index1].files.splice(index2,1);
  333. if(this.addInfoType == 2){
  334. this.$forceUpdate();
  335. }
  336. },
  337. fileListDel(type){
  338. var list = [];
  339. var selects = [];
  340. var table = null;
  341. if(type == 1){
  342. list = this.fileList;
  343. selects = this.fileSelect;
  344. table = this.$refs.table;
  345. }else if(type == 2){
  346. list = this.fileList2;
  347. selects = this.fileSelect2;
  348. table = this.$refs.table2;
  349. }
  350. selects.sort(function(a,b){
  351. return b-a;
  352. })
  353. selects.forEach((i)=>{
  354. list.splice(i,1);
  355. })
  356. table.clearSelection();
  357. },
  358. seeImg(filelist,selects){
  359. if(selects.length != 1){
  360. this.$prompt.none("只能预览一条数据");
  361. return;
  362. }
  363. if(!this.addform.id){
  364. this.$prompt.none("保存后才能预览");
  365. return;
  366. }
  367. let row = filelist[selects[0]];
  368. this.http.request("/app/qualityModifyInfo/seeImgUrl",{
  369. id:this.addform.id,
  370. type:row.type,
  371. groupType:row.groupType
  372. }).then((json)=>{
  373. if(json.result == 1){
  374. var encode=encodeURIComponent(json.data);
  375. uni.navigateTo({
  376. url:"/pages/view/preview/preview?preview="+ encode
  377. })
  378. }else{
  379. this.$prompt.none(json.msg);
  380. }
  381. })
  382. },
  383. submitForm(){
  384. this.$refs.form.validate().then(res => {
  385. if (this.addform.deadline == '1' && !this.addform.endDate) {
  386. this.$prompt.none("请选择整改期限日期");
  387. return;
  388. }
  389. if (!(this.addform.taskflowUser && this.addform.taskflowUser.length)) {
  390. this.$prompt.none("请选择整改人员");
  391. return;
  392. }
  393. this.addInfoHandle();
  394. })
  395. },
  396. addInfoHandle(){
  397. //console.log('addInfoHandle')
  398. let taskflowUserIds = [];
  399. if(this.addform.taskflowUser){
  400. this.addform.taskflowUser.forEach(element => {
  401. taskflowUserIds.push(element.id)
  402. });
  403. }
  404. let noticeUserIds = [];
  405. if(this.addform.noticeUser){
  406. this.addform.noticeUser.forEach(element => {
  407. noticeUserIds.push(element.id)
  408. });
  409. }
  410. //var formData = new FormData();
  411. //console.log(formData)
  412. // if(this.addInfoType == 2){
  413. // formData.append('id', this.addform.id)
  414. // formData.append('status', 2)//复核中
  415. // }
  416. // formData.append('cs', 1)//监理指令1 施工整改0
  417. // formData.append('contractName', this.addform.contractName)
  418. // formData.append('supervisionUnitName', this.addform.supervisionUnitName)
  419. // formData.append('contractorUnitName', this.addform.contractorUnitName)
  420. // formData.append('deadline', this.addform.deadline)
  421. // formData.append('startDate', this.$dayjs(this.addform.startDate).format('YYYY 年 MM 月 DD 日'))
  422. // formData.append('endDate', this.$dayjs(this.addform.endDate).format('YYYY 年 MM 月 DD 日'))
  423. // formData.append('checkName', this.addform.checkName)
  424. // formData.append('taskflowUserIds', taskflowUserIds.join(','))
  425. // formData.append('noticeUserIds', noticeUserIds.join(','))
  426. // formData.append('hiddenDanger', this.addform.hiddenDanger)
  427. // formData.append('modifyRequirements', this.addform.modifyRequirements)
  428. let formData = {};
  429. if(this.addInfoType == 2){
  430. formData.id = this.addform.id;
  431. formData.status = 2;//复核中
  432. }
  433. formData.cs = 1;//监理指令1 施工整改0
  434. formData.contractName = this.addform.contractName;
  435. formData.supervisionUnitName = this.addform.supervisionUnitName;
  436. formData.contractorUnitName = this.addform.contractorUnitName;
  437. formData.deadline = this.addform.deadline;
  438. formData.startDate = this.$dayjs(this.addform.startDate).format('YYYY 年 MM 月 DD 日');
  439. formData.endDate = this.$dayjs(this.addform.endDate).format('YYYY 年 MM 月 DD 日');
  440. formData.checkName = this.addform.checkName;
  441. formData.taskflowUserIds = taskflowUserIds.join(',');
  442. formData.noticeUserIds = noticeUserIds.join(',');
  443. formData.hiddenDanger = this.addform.hiddenDanger;
  444. formData.modifyRequirements = this.addform.modifyRequirements;
  445. let fileLists = [];
  446. for(var i=0;i<this.fileList.length;i++){
  447. if(this.fileList[i].files&&this.fileList[i].files.length){
  448. this.fileList[i].files.forEach((file)=>{
  449. fileLists.push({
  450. id:file.id,
  451. file:file,
  452. remark:this.fileList[i].remark,
  453. type:1,
  454. groupType:i+1,
  455. })
  456. })
  457. }else{
  458. fileLists.push({
  459. remark:this.fileList[i].remark,
  460. type:1,
  461. groupType:i+1,
  462. })
  463. }
  464. }
  465. for(var i=0;i<this.fileList2.length;i++){
  466. if(this.fileList2[i].files&&this.fileList2[i].files.length){
  467. this.fileList2[i].files.forEach((file)=>{
  468. fileLists.push({
  469. id:file.id,
  470. file:file,
  471. remark:this.fileList2[i].remark,
  472. type:0,
  473. groupType:i+1,
  474. });
  475. })
  476. }else{
  477. fileLists.push({
  478. remark:this.fileList2[i].remark,
  479. type:0,
  480. groupType:i+1,
  481. })
  482. }
  483. }
  484. //console.log(fileLists)
  485. // fileLists.forEach((file,i)=>{
  486. // if(file.file){
  487. // formData.append('images['+i+'].file',file.file);
  488. // }
  489. // formData.append('images['+i+'].remark',file.remark);
  490. // formData.append('images['+i+'].type',file.type);
  491. // formData.append('images['+i+'].groupType',file.groupType);
  492. // })
  493. // let jsonData = {};
  494. // //console.log(formData)
  495. // formData.forEach((value, key) => jsonData[key] = value);
  496. // jsonData.userId = this.userid;
  497. // jsonData.projectId = this.project.id;
  498. // jsonData.contractId = this.project.contractId;
  499. // console.log(jsonData)
  500. ////return;
  501. fileLists.forEach((file,i)=>{
  502. //console.log(file)
  503. if(file.file && file.file.size){
  504. formData['images['+i+'].file'] = file.file;
  505. }
  506. if(file.id){
  507. formData['images['+i+'].id'] = file.id;
  508. }
  509. formData['images['+i+'].remark'] = file.remark;
  510. formData['images['+i+'].type'] = file.type;
  511. formData['images['+i+'].groupType'] = file.groupType;
  512. })
  513. formData.userId = this.userid;
  514. formData.projectId = this.project.id;
  515. formData.contractId = this.project.contractId;
  516. console.log(formData)
  517. //return;
  518. const url = config.api;
  519. const token = uni.getStorageSync("token");
  520. uni.showLoading({
  521. title: '加载中'
  522. });
  523. uni.uploadFile({
  524. url: url+"/app/qualityModifyInfo/save",
  525. filePath: '123', // 随便填,不为空即可
  526. name: '123', // 随便填,不为空即可
  527. header: {
  528. "Authorization": token,
  529. }, // 可以加access_token等
  530. formData: formData, // 接口参数,json格式,底层自动转为FormData的格式数据
  531. success: (res) => {
  532. //console.log(res);
  533. this.$prompt.none("保存成功");
  534. setTimeout(function(){
  535. uni.navigateBack({
  536. delta:1
  537. })
  538. },500)
  539. },complete() {
  540. uni.hideLoading();
  541. }
  542. })
  543. },
  544. getDetail(id){
  545. this.http.request("/app/qualityModifyInfo/edit",{
  546. id:id,
  547. }).then((json)=>{
  548. if(json.result == 1){
  549. //this.$set(this,'addform',json.data)
  550. this.addform = json.data;
  551. this.addform.startDate = this.$dayjs(this.addform.startDate,'YYYY 年 MM 月 DD 日','zh-cn').format('YYYY-MM-DD')
  552. this.addform.endDate = this.$dayjs(this.addform.endDate,'YYYY 年 MM 月 DD 日','zh-cn').format('YYYY-MM-DD')
  553. //回显用户
  554. var users = [];
  555. var idList = this.addform.taskflowUserIds.split(',');
  556. var nameList = this.addform.userName.split(',');
  557. //console.log(idList)
  558. idList.forEach((userid,index)=>{
  559. users.push({
  560. user_name:nameList[index],
  561. id:userid
  562. })
  563. })
  564. this.$set(this.addform,'taskflowUser',users)
  565. var notices = [];
  566. var nidList = [];
  567. if(this.addform.noticeUserName && this.addform.noticeUserIds){
  568. var nnameList = this.addform.noticeUserName.split(',');
  569. nidList = this.addform.noticeUserIds.split(',')
  570. nidList.forEach((userid,index)=>{
  571. notices.push({
  572. user_name:nnameList[index],
  573. id:userid
  574. })
  575. })
  576. this.$set(this.addform,'noticeUser',notices)
  577. }
  578. //回显附件
  579. this.fileList = [];
  580. this.fileList2 = [];
  581. var imgs = [];
  582. if(json.otherParam){
  583. imgs = json.otherParam;
  584. imgs.forEach((img)=>{
  585. var tmp;
  586. if(img.type == 1){
  587. tmp = this.fileList;
  588. }else{
  589. tmp = this.fileList2;
  590. }
  591. if(tmp[img.groupType-1]){
  592. tmp[img.groupType-1].files.push(img)
  593. }else{
  594. tmp[img.groupType-1] = img;
  595. tmp[img.groupType-1].files = [Object.assign({},img)]
  596. }
  597. })
  598. }
  599. }
  600. })
  601. },
  602. finish(){
  603. this.changeStatus(3);
  604. },
  605. changeStatus(code){
  606. this.http.request("/app/qualityModifyInfo/updateStatus",{
  607. userId:this.userid,
  608. id:this.addform.id,
  609. opCode:code
  610. }).then((json)=>{
  611. if(json.result == 1){
  612. this.$prompt.none("操作成功");
  613. setTimeout(function(){
  614. uni.navigateBack({
  615. delta:1
  616. })
  617. },500)
  618. }
  619. })
  620. },
  621. backPage(){
  622. uni.navigateBack({
  623. delta: 1
  624. });
  625. }
  626. }
  627. }
  628. </script>
  629. <style lang="scss">
  630. .name-btn{
  631. background-color: #e99d42;
  632. border-radius: 4px;
  633. font-size: 14px;
  634. color: #FFFFFF;
  635. border: 1px solid #bbbbbb;
  636. padding: 15rpx 20rpx;
  637. margin-left: 20px;
  638. }
  639. .name-btn-dis{
  640. background-color: #bbbbbb;
  641. }
  642. .fixed-bottom{
  643. position: fixed;
  644. bottom: 0;
  645. width: 100%;
  646. height: 120rpx;
  647. background-color: #fff;
  648. text-align: center;
  649. padding-top: 30rpx;
  650. }
  651. </style>