addstart.vue 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715
  1. <template>
  2. <view :style="'padding-bottom:' + bottom ">
  3. <view class='zhanline'></view>
  4. <uni-forms class='inform' :class="disabled?'disabledbox':''" ref="form" :rules="rules" :value="datainfo" >
  5. <view class="info_tit">开工信息</view>
  6. <uni-forms-item name="xmmc" style='margin-bottom: 0;'>
  7. <view class="flexc infolist">
  8. <view class="f16 fw c34 flex0 pr pl12">项目名称</view>
  9. <input :disabled='disabled' placeholder="请输入项目名称" v-model="datainfo.xmmc" class="f16 c34 flex1 txr"/>
  10. </view>
  11. </uni-forms-item>
  12. <uni-forms-item name="kgrq" style='margin-bottom: 0;'>
  13. <view class="flexc infolist">
  14. <view class="f16 fw c34 flex0 pr pl12"><text class="cir">*</text>开工日期</view>
  15. <picker :disabled='disabled' mode="date" :value="datainfo.kgrq" class="infolist_a" @change='bindDateChangea'>
  16. <view :class="datainfo.kgrq?'':'f16 co80'">{{datainfo.kgrq||"请选择开工日期"}}</view>
  17. </picker>
  18. </view>
  19. </uni-forms-item>
  20. <uni-forms-item name="njgrq" style='margin-bottom: 0;'>
  21. <view class="flexc infolist">
  22. <view class="f16 fw c34 flex0 pr pl12"><text class="cir">*</text>拟竣工日期</view>
  23. <picker :disabled='disabled' mode="date" :value="datainfo.njgrq" class="infolist_a" @change='bindDateChangeb'>
  24. <view :class="datainfo.njgrq?'':'f16 co80'">{{datainfo.njgrq||"请选择拟竣工日期"}}</view>
  25. </picker>
  26. </view>
  27. </uni-forms-item>
  28. <uni-forms-item name="sscrq" style='margin-bottom: 0;'>
  29. <view class="flexc infolist">
  30. <view class="f16 fw c34 flex0 pr pl12"><text class="cir">*</text>试生产日期</view>
  31. <picker :disabled='disabled' mode="date" :value="datainfo.sscrq" class="infolist_a" @change='bindDateChangec'>
  32. <view :class="datainfo.sscrq?'':'f16 co80'">{{datainfo.sscrq||"请选择试生产日期"}}</view>
  33. </picker>
  34. </view>
  35. </uni-forms-item>
  36. <uni-forms-item name="ntcsj" style='margin-bottom: 0;'>
  37. <view class="flexc infolist">
  38. <view class="f16 fw c34 flex0 pr pl12"><text class="cir">*</text>拟投产日期</view>
  39. <picker :disabled='disabled' mode="date" :value="datainfo.ntcsj" class="infolist_a" @change='bindDateChanged'>
  40. <view :class="datainfo.ntcsj?'':'f16 co80'">{{datainfo.ntcsj||"请选择拟投产日期"}}</view>
  41. </picker>
  42. </view>
  43. </uni-forms-item>
  44. <uni-forms-item name="rtsj" style='margin-bottom: 0;'>
  45. <view class="flexc infolist" style="background-color: #ffffff;">
  46. <view class="f16 fw c34 flex0 pr pl12">入统日期</view>
  47. <picker mode="date" :value="datainfo.rtsj" class="infolist_a" @change='bindDateChangee'>
  48. <view :class="datainfo.rtsj?'':'f16 co80'">{{datainfo.rtsj||"请选择入统日期"}}</view>
  49. </picker>
  50. <view class="delpicker" v-if="datainfo.rtsj">
  51. <image :src="closedimg" class="closed" @click="datainfo.rtsj=''"></image>
  52. </view>
  53. </view>
  54. </uni-forms-item>
  55. <uni-forms-item name="nrtsj" style='margin-bottom: 0;'>
  56. <view class="flexc infolist" style="background-color: #ffffff;">
  57. <view class="f16 fw c34 flex0 pr pl12">拟入统日期</view>
  58. <picker mode="date" :value="datainfo.nrtsj" class="infolist_a" @change='bindDateChangef'>
  59. <view :class="datainfo.nrtsj?'':'f16 co80'">{{datainfo.nrtsj||"请选择拟入统日期"}}</view>
  60. </picker>
  61. <view class="delpicker" v-if="datainfo.nrtsj">
  62. <image :src="closedimg" class="closed" @click="datainfo.nrtsj=''"></image>
  63. </view>
  64. </view>
  65. </uni-forms-item>
  66. <view class="border"></view>
  67. <view class="info_tit">进度照片</view>
  68. <uni-forms-item name="ziranren" style='margin-bottom: 0;'>
  69. <view class="flexc infolist" style="background-color: #ffffff;">
  70. <view class="flexc infolist_add" @click="getAddPhoto" v-if="checkPermi(['projectV2:rate:add'])">
  71. <image :src="addimg"></image>
  72. <view>新增进度照片</view>
  73. </view>
  74. <view class="f16 fw c34 flex0 pr pl12">添加进度照片</view>
  75. <view class="flex1 txr flexc over ml8">
  76. <text class="flex1 f15 c34 over" v-if="datainfo.sbdw">{{datainfo.sbdw}}</text>
  77. <text class="f16 flex1 co80" v-else>请先选择添加进度照片</text>
  78. <!-- <view class="delimg flex0" >
  79. <image :src="delimg"></image>
  80. </view> -->
  81. <!-- <image :src="delimg" class="delimg"></image> -->
  82. </view>
  83. </view>
  84. </uni-forms-item>
  85. <!-- 进度照片展示 -->
  86. <view class="qibox" >
  87. <view class="flexc infolist qi" v-for="(ite,idx) in ratelist" :key="'info-'+idx" @click="getDetailPhoto(ite)">
  88. <view class="f15 fw c34 flex0 pr pl12 ">{{ite.rateType}}</view>
  89. <view class="flex1 txr flexc over ml8">
  90. <text class="flex1 f15 c34 over">{{ite.jdDescribe}}/</text>
  91. <view class="flexc" style="justify-content: flex-end;">
  92. <view v-for="(pit,pid) in ite.photo" :key="'info1-'+pid" class="pholist">
  93. <image :src="baseUrl+pit"></image>
  94. </view>
  95. </view>
  96. <view class="delimg flex0" @click.stop="getDelRate(ite.id,idx)" v-if="checkPermi(['projectV2:rate:remove'])">
  97. <image :src="delimg"></image>
  98. </view>
  99. </view>
  100. </view>
  101. </view>
  102. <view class="border"></view>
  103. <uni-forms-item name="czwt" style='margin-bottom: 0;'>
  104. <view class="flexc infolist" style="align-items: flex-start;">
  105. <view class="f16 fw c34 flex0 pr pl12">存在问题</view>
  106. <uni-easyinput :inputBorder='false' type="textarea" v-model="datainfo.czwt" placeholder="请输入存在问题" placeholderStyle='text-align: right;font-size:32rpx;color:#808080'></uni-easyinput>
  107. </view>
  108. </uni-forms-item>
  109. <uni-forms-item name="zsyzFjList" style='margin-bottom: 0;'>
  110. <view class="flexc infolist">
  111. <view class="f16 fw c34 flex0 pr pl12"><text class="cir">*</text>附件</view>
  112. <view class="infolist_a co28" v-if="disabled">选择附件</view>
  113. <view class="infolist_a co28" v-else><lsj-upload
  114. ref="lsjUpload"
  115. childId="upload1"
  116. :width="width"
  117. :height="height"
  118. :option="option"
  119. :size="size"
  120. :formats="formats"
  121. :debug="debug"
  122. :instantly="instantly"
  123. @progress=""
  124. @uploadEnd="onuploadEnd" >
  125. <view class="btn" :style="{width: width,height: height}">选择附件</view>
  126. </lsj-upload></view>
  127. </view>
  128. </uni-forms-item>
  129. <view class=" cldelistbf" v-for="(ite,idx) in filelist" :key='idx'>
  130. <view class="flext f15 c6" @click="getDown(ite.path)">
  131. <view class="imgl"><image :src="wimg" ></image></view>
  132. <view>{{ite.fjName}}</view>
  133. </view>
  134. <!-- 删除 -->
  135. <view class="delimg flex0" @click.stop="getDelFj(idx)">
  136. <image :src="delimg"></image>
  137. </view>
  138. </view>
  139. <view class="infolist_b"><text>*</text>请上传大小不超过<text>100MB</text>格式为<text>doc/xls/ppt/txt/pdf/zip/rar/word</text>的文件</view>
  140. <view class="infolist_b" style="margin-top: 20rpx;"><text>*</text>土地证复印件/房屋租赁合同复印件、开工照片、项目开工申报表</view>
  141. <!-- 修改 -->
  142. <view v-if="checkPermi(['projectV2:kgxx:edit','projectV2:kgxx:add'])&&((progress==3&&xmStatus==2)||(progress==4&&xmStatus!=2))" class="infobtn flexcc cf f16 f500" @click="getSubmit">提交</view>
  143. <!-- 返回修改 -->
  144. <view v-if="checkPermi(['projectV2:kgxx:editKg'])&&(progress==4&&xmStatus==2||(progress==5&&xmStatus!=2))" class="infobtn flexcc cf f16 f500" @click="getSubmit">提交</view>
  145. </uni-forms>
  146. <!-- 弹框 -->
  147. <view class="bgbox" @click="getClose" v-if="addflag"></view>
  148. <view class="fixedbox" v-if="addflag">
  149. <image :src="closeimg" class="choseimg" @click="getClose"></image>
  150. <view class="top">添加进度照片</view>
  151. <view class="boxs" style="padding: 60rpx 0;">
  152. <!-- 进度照片 -->
  153. <uni-forms ref="phoform" :rules="phorules" :value="phoinfo">
  154. <!-- <uni-forms-item name="companyName" style='margin-bottom: 0;'>
  155. <view class="flexc infolist">
  156. <view class="f16 fw c34 flex0 pr pl12">时间</view>
  157. <picker mode="date" :value="phoinfo.nrtsj" class="infolist_a" @change='bindDateChangeg'>
  158. <view :class="phoinfo.nrtsj?'':'f16 co80'">{{phoinfo.nrtsj||"请选择拟入统日期"}}</view>
  159. </picker>
  160. </view>
  161. </uni-forms-item> -->
  162. <uni-forms-item name="rateType" style='margin-bottom: 0;'>
  163. <view class="flexc infolist">
  164. <view class="f16 fw c34 flex0 pr pl12"><text class="cir">*</text>进度</view>
  165. <input placeholder="请输入进度" v-model="phoinfo.rateType" class="f16 c34 flex1 txr"/>
  166. </view>
  167. </uni-forms-item>
  168. <uni-forms-item name="jdDescribe" style='margin-bottom: 0;'>
  169. <view class="flexc infolist">
  170. <view class="f16 fw c34 flex0 pr pl12">描述</view>
  171. <input placeholder="请输入描述详情" v-model="phoinfo.jdDescribe" class="f16 c34 flex1 txr"/>
  172. </view>
  173. </uni-forms-item>
  174. <uni-forms-item name="photo" style='margin-bottom: 0;'>
  175. <view class="flexc infolist">
  176. <view class="f16 fw c34 flex0 pr pl12"><text class="cir">*</text>照片</view>
  177. </view>
  178. </uni-forms-item>
  179. <view class="photoimg">
  180. <view class="photos" v-for="(item,index) in file" :key='index'>
  181. <view class="photolist" @click="getPreview(file,index)">
  182. <image :src="baseUrl+item" class="listimg"></image>
  183. <image :src="delimgs" class="del" @click.stop="delimgFn(index)" v-if="checkPermi(['projectV2:rate:add','projectV2:rate:edit'])"></image>
  184. </view>
  185. </view>
  186. <view class="photos" v-if="file.length<9&&checkPermi(['projectV2:rate:add','projectV2:rate:edit'])">
  187. <view class="photolist" @click.stop="getphotoFn">
  188. <image :src="addimgs" class="addimg"></image>
  189. </view>
  190. </view>
  191. </view>
  192. <!-- <view class=" cldelistbf" >
  193. <view class="flext f15 c6">
  194. <view class="imgl"><image :src="wimg" ></image></view>
  195. <view>照片名称fjName</view>
  196. </view>
  197. <view class="flexc f15 co28 flex0">
  198. <image :src="downimg" class="imgr"></image>预览
  199. </view>
  200. </view> -->
  201. </uni-forms>
  202. </view>
  203. <view class="fixedbtn mt20" @click="getyjSubmit" v-if="checkPermi(['projectV2:rate:add','projectV2:rate:edit'])">确认</view>
  204. </view>
  205. </view>
  206. </template>
  207. <script>
  208. import {uploadmore} from '@/utils/common.js'
  209. import {uploadPhoto} from '@/api/system/user.js'
  210. import {getkgxxAddFn,getkgxxPutFn,getrateAddFn,getratePutFn,getrateDelFn,getrateListFn,gekgxxputKg} from "@/api/work/addclue.js"
  211. import {getkgxxdetail} from "@/api/work/clue.js"
  212. import config from '@/config'
  213. const baseUrl = config.baseUrl
  214. import { getToken } from '@/utils/auth'
  215. import { checkPermi, checkRole } from "@/utils/permission"; // 权限判断函数
  216. export default {
  217. data() {
  218. return {
  219. //附件
  220. option: {
  221. // 上传服务器地址,需要替换为你的接口地址
  222. url: baseUrl+'/common/upload', // 该地址非真实路径,需替换为你项目自己的接口地址
  223. // 上传附件的key
  224. name: 'file',
  225. // 根据你接口需求自定义请求头,默认不要写content-type,让浏览器自适配
  226. header: {
  227. // 示例参数可删除
  228. 'Authorization': 'Bearer ' + getToken(),
  229. },
  230. // 根据你接口需求自定义body参数
  231. formData: {
  232. }
  233. },
  234. // 选择文件后是否立即自动上传,true=选择后立即上传
  235. instantly: true,
  236. // 必传宽高且宽高应与slot宽高保持一致
  237. width: '',
  238. height: '48rpx',
  239. // 限制允许上传的格式,空串=不限制,默认为空
  240. formats: 'doc,docx,xls,ppt,txt,pdf,zip,rar,word',
  241. // 文件上传大小限制
  242. size: 100,
  243. // 文件数量限制 默认10
  244. count: 5,
  245. // 文件回显列表
  246. files: new Map(),
  247. // 微信小程序Map对象for循环不显示,所以转成普通数组,不要问为什么,我也不知道
  248. wxFiles: [],
  249. // 是否打印日志
  250. debug: false,
  251. filelist:[],
  252. selectDate: '',
  253. defaultPhoneHeight: '', //屏幕默认高度
  254. nowPhoneHeight: '', //屏幕现在的高度
  255. bottom:0,
  256. type:1,
  257. baseUrl:'',
  258. datainfo:{
  259. "xmId":"",//项目ID
  260. "xmbh":"",//项目编号
  261. "xmmc":"",//项目名称
  262. "kgrq":"",//开工日期
  263. "njgrq":"",//拟竣工日期
  264. "sscrq":"",//试生产日期
  265. "ntcsj":"",//拟投产时间
  266. "rtsj":"",//入统时间
  267. "nrtsj":"",//拟入统时间
  268. "kggjrsjh":"",//开工跟进人手机号
  269. 'czwt':'',//存在问题
  270. zsyzFjList:[],//附件地址
  271. },
  272. phoinfo:{
  273. photo:'',
  274. jdDescribe:'',
  275. rateType:'',
  276. },
  277. tanfalg:false,
  278. addflag:false,
  279. imageValue:[],
  280. closedimg:require("@/static/images/del.png"),
  281. addimg:require("@/static/images/mine/add.png"),
  282. addimgs:require('@/static/images/index/add.png'),
  283. delimg:require("@/static/images/mine/del.png"),
  284. delimgs:require("@/static/images/index/del.png"),
  285. checknimg:require("@/static/images/mine/jnicon.png"),
  286. bgimg:require("@/static/images/banner.png"),
  287. gcheckimg:require("@/static/images/mine/jicon.png"),
  288. closeimg:require('@/static/images/close.png'),
  289. wimg:require('@/static/images/index/wicon.png'),
  290. downimg:require('@/static/images/index/down.png'),
  291. rules: {
  292. kgrq: {rules: [{required: true,errorMessage: '请选择开工日期'}]},
  293. njgrq: {rules: [{required: true,errorMessage: '请选择拟竣工日期',}]},
  294. sscrq: {rules: [{required: true,errorMessage: '请选择试生产日期' } ]},
  295. ntcsj: {rules: [{required: true,errorMessage: '请选择拟投产日期'} ]},
  296. zsyzFjList: {rules: [{required: true,errorMessage: '请上传附件'} ]},
  297. },
  298. phorules:{
  299. rateType: {rules: [{required: true,errorMessage: '请输入进度'}]},
  300. photo: {rules: [{required: true,errorMessage: '请上传图片'}]},
  301. },
  302. map:{text:'label',value:'id'},
  303. file:[],
  304. images:[],
  305. pagetype:'add',
  306. ratelist:[],
  307. disabled:false,
  308. xmmc:'',
  309. progress:'',
  310. xmStatus:'',
  311. }
  312. },
  313. onLoad(e) {
  314. this.baseUrl=baseUrl;
  315. var newObj=JSON.parse(decodeURIComponent(e.data))
  316. this.pagetype=newObj.pagetype||'add';
  317. this.datainfo.xmId=newObj.xmId;
  318. this.datainfo.xmbh=newObj.xmbh;
  319. this.progress=newObj.progress||'';
  320. this.xmStatus=newObj.xmStatus||'';
  321. this.xmmc=newObj.xmmc;
  322. if(this.pagetype=='update'){
  323. // 获取详情 修改
  324. if(newObj.dis){
  325. this.disabled=true;
  326. }else{
  327. this.disabled=false;
  328. }
  329. this.init();
  330. this.getDataFn()
  331. }else{
  332. this.datainfo.xmmc=newObj.xmmc;
  333. }
  334. // #ifdef APP
  335. uni.onKeyboardHeightChange(res=> { //监听键盘高度变化
  336. const res_keyboard = uni.getSystemInfoSync();
  337. let key_height = res.height - (res_keyboard.screenHeight - res_keyboard.windowHeight)
  338. // let key_height = res.height - (res_keyboard.screenHeight - res_keyboard.windowHeight + res_keyboard.safeAreaInsets.bottom)
  339. this.bottom = `${ key_height>0 ? key_height : 0}px`;
  340. })
  341. // #endif
  342. },
  343. onHide() {
  344. // #ifdef APP-PLUS
  345. uni.offKeyboardHeightChange(); // 取消监听键盘高度变化事件,避免内存消耗
  346. // #endif
  347. },
  348. onReady() {
  349. // this.$refs.form.setRules(this.rules)
  350. },
  351. methods: {
  352. checkPermi, checkRole,
  353. // 开工详情
  354. getDataFn(){
  355. getkgxxdetail(this.datainfo.xmId).then(res=>{
  356. if(res.code==200){
  357. this.datainfo=res.data;
  358. this.datainfo.xmmc=this.xmmc;
  359. if(res.data.zsyzFjList&&res.data.zsyzFjList.length){
  360. this.filelist=JSON.parse(JSON.stringify(res.data.zsyzFjList))
  361. }
  362. }else{
  363. this.$toast(res.msg)
  364. }
  365. })
  366. },
  367. // 查看照片
  368. getPreview(iurl,idx) {
  369. var newArr=[];
  370. iurl.forEach(ite=>{
  371. var ds=this.baseUrl+ite
  372. newArr.push(ds)
  373. })
  374. uni.previewImage({
  375. urls: newArr,
  376. current:idx,
  377. success: function(data) {
  378. },
  379. fail: function(err) {
  380. console.log(err.errMsg);
  381. }
  382. });
  383. },
  384. init(){
  385. this.getRateList()//项目进度
  386. },
  387. bindDateChangea(e){//开工日期
  388. this.datainfo.kgrq=e.detail.value
  389. },
  390. bindDateChangeb(e){//拟竣工日期
  391. this.datainfo.njgrq=e.detail.value
  392. },
  393. bindDateChangec(e){//试生产日期
  394. this.datainfo.sscrq=e.detail.value
  395. },
  396. bindDateChanged(e){//拟投产日期
  397. this.datainfo.ntcsj=e.detail.value
  398. },
  399. bindDateChangee(e){//入统日期
  400. this.datainfo.rtsj=e.detail.value
  401. },
  402. bindDateChangef(e){//拟入统日期
  403. this.datainfo.nrtsj=e.detail.value
  404. },
  405. getAddPhoto(){
  406. this.phoinfo={
  407. photo:'',
  408. jdDescribe:'',
  409. rateType:'',
  410. };
  411. this.file=[];
  412. this.addflag=true;
  413. },
  414. getDetailPhoto(ite){
  415. var newStr=JSON.parse(JSON.stringify(ite))
  416. this.phoinfo=newStr;
  417. this.file=newStr.photo;
  418. var newStr=newStr.photo.join(',');
  419. this.phoinfo.photo=newStr;
  420. this.addflag=true;
  421. },
  422. getDelRate(id,idx){ //删除进度
  423. var that=this;
  424. uni.showModal({
  425. title: '确认删除',
  426. content: "是否确认删除",
  427. cancelText: '取消',
  428. confirmText: '确认',
  429. success: function(res) {
  430. if (res.confirm) {
  431. // var params={
  432. // id:id
  433. // }
  434. getrateDelFn(id).then(res=>{
  435. if(res.code==200){
  436. that.$toast('删除成功')
  437. that.ratelist.splice(idx,1)
  438. }else{
  439. that.$toast(res.msg)
  440. }
  441. })
  442. } else if (res.cancel) {
  443. }
  444. }
  445. });
  446. },
  447. // 项目列表
  448. getRateList(){
  449. var params={
  450. xmbh:this.datainfo.xmbh,
  451. xmId:this.datainfo.xmId
  452. }
  453. getrateListFn(params).then(res=>{
  454. if(res.code==200){
  455. //
  456. var newArr=res.rows||[];
  457. if(newArr.length){
  458. newArr.forEach(ite=>{
  459. ite.photo=ite.photo.split(',')
  460. })
  461. }
  462. this.ratelist=newArr
  463. // if(res.rows.length){
  464. // this.qiziflag=true
  465. // }
  466. }else{
  467. this.$toast(res.msg)
  468. }
  469. })
  470. },
  471. getyjSubmit(){
  472. // 项目进度
  473. var that=this;
  474. this.$refs.phoform.validate().then(res => {
  475. var params=this.phoinfo;
  476. params.xmbh=this.datainfo.xmbh;
  477. params.xmId=this.datainfo.xmId;
  478. if(params.id){
  479. // 修改
  480. getratePutFn(params).then(res=>{
  481. if(res.code==200){
  482. this.$toast('修改成功');
  483. setTimeout(function(){
  484. that.addflag=false;
  485. // 获取列表
  486. that.getRateList()
  487. },1500)
  488. }else{
  489. this.$toast(res.msg)
  490. }
  491. })
  492. }else{
  493. // 新增
  494. getrateAddFn(params).then(res=>{
  495. if(res.code==200){
  496. this.$toast('添加成功');
  497. setTimeout(function(){
  498. that.addflag=false;
  499. // 获取列表
  500. that.getRateList()
  501. },1500)
  502. }else{
  503. this.$toast(res.msg)
  504. }
  505. })
  506. }
  507. })
  508. },
  509. delimgFn(e){
  510. var that = this;
  511. that.file.splice(e,1);
  512. this.phoinfo.photo=that.file.join(',')
  513. },
  514. getphotoFn(){
  515. let that = this;
  516. let file = that.file;
  517. if(file.length < 9){
  518. uni.chooseImage({
  519. count: 9 - parseInt(file.length),
  520. success:function(res){
  521. let img= res.tempFilePaths;
  522. if(img.length + file.length > 9){
  523. uni.showToast({
  524. title: '最多上传9张图片',
  525. icon: 'none',
  526. duration: 2000
  527. })
  528. }else{
  529. let imglen = res.tempFilePaths.length;
  530. var fuwufile = [];
  531. uploadmore('/common/upload',img,0,0,0,imglen,fuwufile,function(rs){
  532. that.file = that.file.concat(rs);
  533. that.phoinfo.photo=that.file.join(',')
  534. // console.log(that.phoinfo.photo,85)
  535. })
  536. }
  537. }
  538. });
  539. }
  540. },
  541. getClose(){
  542. this.addflag=false;
  543. },
  544. getAddFn(){
  545. this.addflag=true;
  546. },
  547. getSubmit() {
  548. var that=this;
  549. this.datainfo.zsyzFjList=JSON.parse(JSON.stringify(this.filelist));
  550. this.$refs.form.validate().then(res => {
  551. var params=this.datainfo;
  552. // params.zsyzFjList=this.filelist
  553. if(!params.rtsj&&!params.nrtsj){
  554. this.$toast('请选择入统时间或者拟入统时间');
  555. return
  556. }
  557. if(this.pagetype=='add'){
  558. getkgxxAddFn(params).then(res=>{
  559. if(res.code==200){
  560. this.$toast('上报开工信息成功')
  561. setTimeout(function() {
  562. uni.$emit('refreshdata');
  563. uni.navigateBack({delta: 1});
  564. },1500);
  565. }else{
  566. this.$toast(res.msg)
  567. }
  568. })
  569. }else{
  570. if(this.disabled){
  571. var obj={
  572. id:params.id,
  573. rtsj:params.rtsj,
  574. nrtsj:params.nrtsj,
  575. xmId:params.xmId
  576. }
  577. gekgxxputKg(obj).then(res=>{
  578. if(res.code==200){
  579. this.$toast('修改开工信息成功')
  580. setTimeout(function() {
  581. uni.$emit('refreshdata');
  582. uni.navigateBack({delta: 1});
  583. },1500);
  584. }else{
  585. this.$toast(res.msg)
  586. }
  587. })
  588. }else{
  589. getkgxxPutFn(params).then(res=>{
  590. if(res.code==200){
  591. this.$toast('修改开工信息成功')
  592. setTimeout(function() {
  593. uni.$emit('refreshdata');
  594. uni.navigateBack({delta: 1});
  595. },1500);
  596. }else{
  597. this.$toast(res.msg)
  598. }
  599. })
  600. }
  601. }
  602. })
  603. },
  604. onuploadEnd(item) {
  605. var newobj={}
  606. var responseText=JSON.parse(item.responseText)
  607. newobj.fjName=responseText.originalFilename;
  608. newobj.path=responseText.fileName;
  609. this.filelist.push(newobj)
  610. this.datainfo.zsyzFjList=JSON.parse(JSON.stringify(this.filelist))
  611. },
  612. getDelFj(idx){
  613. var that=this;
  614. if(!this.disabled){
  615. uni.showModal({
  616. title: '确认删除',
  617. content: "是否确认删除",
  618. cancelText: '取消',
  619. confirmText: '确认',
  620. success: function(res) {
  621. if (res.confirm) {
  622. that.filelist.splice(idx,1)
  623. that.datainfo.zsyzFjList=JSON.parse(JSON.stringify(that.filelist))
  624. } else if (res.cancel) {
  625. }
  626. }
  627. });
  628. }
  629. },
  630. getDown(e){
  631. uni.showLoading({
  632. title: '加载中'
  633. });
  634. var url=baseUrl+e;
  635. uni.downloadFile({
  636. url: url,//文件的下载路径
  637. success(result) {
  638. uni.hideLoading()
  639. var filePath = result.tempFilePath;
  640. uni.openDocument({
  641. filePath: filePath,
  642. showMenu: true,
  643. success: function (res) {
  644. // console.log('打开文档成功');
  645. }
  646. });
  647. },
  648. fail(res) {uni.hideLoading()}
  649. })
  650. },
  651. }
  652. }
  653. </script>
  654. <style lang="scss" scoped>
  655. .inform{padding-top: 30rpx; padding-bottom: 160rpx;}
  656. .infolist{padding: 30rpx 32rpx 30rpx 24rpx;position: relative;
  657. .cir{position: absolute;font-size: 36rpx;font-weight: bold;color: #FE5706;left: 0rpx;}
  658. // .delimg{width: 30rpx;height:30rpx;margin-left: 8rpx;}
  659. }
  660. .delimg{width: 40rpx;height:40rpx;margin-left: 16rpx;display: flex;align-items: center;justify-content: center;
  661. image{width: 30rpx;height: 30rpx;}
  662. }
  663. .infobtn{width: 100%;height: 88rpx;background: #FA5F03;line-height: 88rpx;position: fixed;left: 0;right: 0;bottom: 0;z-index: 3;}
  664. .input_ye image{width: 34rpx;height: 18rpx;}
  665. .info_tit{font-size: 32rpx;color: #FE5706;padding: 30rpx 26rpx;font-weight: bold;}
  666. .infolist_a{height: 44rpx;flex: 1;text-align: right;font-size: 32rpx;color: #343434;}
  667. .infolist_add{position: absolute;right: 0;top: -40rpx;font-size: 28rpx;color: #41C942;padding-right: 30rpx;
  668. image{width: 30rpx;height: 30rpx;margin-right: 20rpx;}
  669. }
  670. .fixedbtn{width:100%;height: 80rpx;background: #FF6400;
  671. border-radius: 10rpx;display: flex;align-items: center;justify-content: center;font-size: 32rpx;font-weight: bold;color: #FFFFFF;
  672. &.btn1{background-color: #20ACCF;margin-bottom: 36rpx;}
  673. }
  674. .fixedbox .infolist{padding: 30rpx 0;}
  675. .inform /deep/ .uni-forms-item__error{margin-top: -30rpx;margin-left: 24rpx;}
  676. .fixedbox /deep/ .uni-forms-item__error{margin-top: -30rpx;margin-left: 24rpx;}
  677. .inform .pl12{margin-right: 10rpx;}
  678. .fixedbox .pl12{margin-right: 10rpx;}
  679. .pholist{
  680. display: flex;align-items: center;max-width: 220rpx;overflow: hidden;
  681. image{
  682. width: 44rpx;height: 44rpx;margin-left: 10rpx;flex: 0 0 auto;
  683. }
  684. }
  685. .disabledbox{
  686. .infolist{background-color: #F5f5f5;}
  687. }
  688. </style>