addstart.vue 24 KB

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