addpoint.vue 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606
  1. <template>
  2. <view class="fgw" :style="'padding-bottom:' + bottom ">
  3. <view class='zhanline'></view>
  4. <uni-forms class='inform ' ref="form" :rules="rules" :value="datainfo">
  5. <uni-collapse ref="collapse" v-model="value" >
  6. <!-- 12个月 -->
  7. <block v-for="(ite,idx) in pointlist" :key="idx">
  8. <view v-show="idx<6&&type==1">
  9. <uni-collapse-item title="" class='cldelista pointlist' :border="false" title-border="none" >
  10. <template v-slot:title>
  11. <view class="flexc contentt">
  12. <!-- {{year}}年 -->
  13. <view class="flex0 f16 fw cofe">{{ite.month}}月</view>
  14. </view>
  15. </template>
  16. <view class="content">
  17. <uni-forms-item name="jdsj" style='margin-bottom: 0;'>
  18. <view class="flexc infolist" @click="getTimeFn(idx)">
  19. <view class="f16 fw c34 flex0 pr pl12"><text class="cir">*</text>要求完成日期</view>
  20. <!--:start="year+'-'+ite.month+'-01'" :end="year+'-'+ite.month+'-31'" -->
  21. <picker mode="date" :value="ite.jdsj" class="infolist_a" @change='bindDateChangetimea'>
  22. <view :class="ite.jdsj?'':'f16 co80'">{{ite.jdsj||"请选择要求完成日期"}}</view>
  23. </picker>
  24. </view>
  25. </uni-forms-item>
  26. <uni-forms-item name="deptName" style='margin-bottom: 0;'>
  27. <view class="flexc infolist" @click="showPicker('zrdw',idx)">
  28. <view class="f16 fw c34 flex0 pr pl12"><text class="cir">*</text>责任单位</view>
  29. <view class="f16 c34 txr flex1">
  30. <view :class="ite.fgwJdapZrDwList.length?'':'f16 co80'">{{checkstring(ite.fgwJdapZrDwList)||"请选择责任单位"}}</view>
  31. </view>
  32. </view>
  33. </uni-forms-item>
  34. <uni-forms-item name="deptName" style='margin-bottom: 0;'>
  35. <view class="flexc infolist" @click="showPicker('xtdw',idx)">
  36. <view class="f16 fw c34 flex0 pr pl12"><text class="cir">*</text>协同单位</view>
  37. <view class="f16 c34 txr flex1">
  38. <view :class="ite.fgwJdapXtDwList.length?'':'f16 co80'">{{checkstring(ite.fgwJdapXtDwList)||"请选择协同单位"}}</view>
  39. </view>
  40. </view>
  41. </uni-forms-item>
  42. <uni-forms-item name="jdannr" style='margin-bottom: 0;'>
  43. <view class="flexc infolist">
  44. <view class="f16 fw c34 flex0 pr pl12"><text class="cir">*</text>具体内容</view>
  45. <input placeholder="请输入具体内容" v-model="ite.jdannr" class="f16 c34 flex1 txr"/>
  46. </view>
  47. </uni-forms-item>
  48. <uni-forms-item name="zsyzFjList" style='margin-bottom: 0;'>
  49. <view class="flexc infolist">
  50. <view class="f16 fw c34 flex0 pr pl12">附件</view>
  51. <view class="infolist_a co28">
  52. <lsj-upload ref="lsjUpload" :xmtype='idx' @getFile="getFile" childId="upload1" :width="width" :height="height" :option="option" :size="size" :formats="formats" :debug="debug" :instantly="instantly" @progress="" @uploadEnd="onuploadEnd" >
  53. <view class="btn" :style="{width: width,height: height}">上传文件</view>
  54. </lsj-upload>
  55. </view>
  56. </view>
  57. </uni-forms-item>
  58. <view class=" cldelistbf" v-for="(fite,fidx) in ite.fgwJdapFjList" :key="'fj_'+fidx">
  59. <view class="flext f15 c6" @click.stop="getDown(fite.path)">
  60. <view class="imgl"><image :src="wimg" ></image></view>
  61. <view>{{fite.fjName}}</view>
  62. </view>
  63. <!-- 删除 -->
  64. <view class="delimg flex0" @click.stop="getDelFj(idx,fidx)">
  65. <image :src="delimg"></image>
  66. </view>
  67. </view>
  68. <view class="infolist_b"><text>*</text>请上传大小不超过<text>100MB</text>格式为<text>doc/xls/ppt/txt/pdf/zip/rar/word</text>的文件</view>
  69. </view>
  70. </uni-collapse-item>
  71. <view class="infobtn flexcc cf f16 f500" @click="getNext(2)">下一步</view>
  72. </view>
  73. <view v-show="(idx==6||idx>6)&&type==2">
  74. <uni-collapse-item title="" class='cldelista pointlist' :border="false" title-border="none" >
  75. <template v-slot:title>
  76. <view class="flexc contentt">
  77. <view class="flex0 f16 fw cofe">{{ite.month}}月</view>
  78. </view>
  79. </template>
  80. <view class="content">
  81. <uni-forms-item name="jdsj" style='margin-bottom: 0;'>
  82. <view class="flexc infolist" @click="getTimeFn(idx)">
  83. <view class="f16 fw c34 flex0 pr pl12"><text class="cir">*</text>要求完成日期</view>
  84. <picker mode="date" :value="ite.jdsj" class="infolist_a" @change='bindDateChangetimea'>
  85. <view :class="ite.jdsj?'':'f16 co80'">{{ite.jdsj||"请选择要求完成日期"}}</view>
  86. </picker>
  87. </view>
  88. </uni-forms-item>
  89. <uni-forms-item name="deptName" style='margin-bottom: 0;'>
  90. <view class="flexc infolist" @click="showPicker('zrdw',idx)">
  91. <view class="f16 fw c34 flex0 pr pl12"><text class="cir">*</text>责任单位</view>
  92. <view class="f16 c34 txr flex1">
  93. <view :class="ite.fgwJdapZrDwList.length?'':'f16 co80'">{{checkstring(ite.fgwJdapZrDwList)||"请选择责任单位"}}</view>
  94. </view>
  95. </view>
  96. </uni-forms-item>
  97. <uni-forms-item name="deptName" style='margin-bottom: 0;'>
  98. <view class="flexc infolist" @click="showPicker('xtdw',idx)">
  99. <view class="f16 fw c34 flex0 pr pl12"><text class="cir">*</text>协同单位</view>
  100. <view class="f16 c34 txr flex1">
  101. <view :class="ite.fgwJdapXtDwList.length?'':'f16 co80'">{{checkstring(ite.fgwJdapXtDwList)||"请选择协同单位"}}</view>
  102. </view>
  103. </view>
  104. </uni-forms-item>
  105. <uni-forms-item name="jdannr" style='margin-bottom: 0;'>
  106. <view class="flexc infolist">
  107. <view class="f16 fw c34 flex0 pr pl12"><text class="cir">*</text>具体内容</view>
  108. <input placeholder="请输入具体内容" v-model="ite.jdannr" class="f16 c34 flex1 txr"/>
  109. </view>
  110. </uni-forms-item>
  111. <uni-forms-item name="zsyzFjList" style='margin-bottom: 0;'>
  112. <view class="flexc infolist">
  113. <view class="f16 fw c34 flex0 pr pl12">附件</view>
  114. <view class="infolist_a co28">
  115. <lsj-upload ref="lsjUpload" :xmtype='idx' @getFile="getFile" childId="upload1" :width="width" :height="height" :option="option" :size="size" :formats="formats" :debug="debug" :instantly="instantly" @progress="" @uploadEnd="onuploadEnd" >
  116. <view class="btn" :style="{width: width,height: height}">上传文件</view>
  117. </lsj-upload>
  118. </view>
  119. </view>
  120. </uni-forms-item>
  121. <view class=" cldelistbf" v-for="(fite,fidx) in ite.fgwJdapFjList" :key="'fj_'+fidx">
  122. <view class="flext f15 c6" @click.stop="getDown(fite.path)">
  123. <view class="imgl"><image :src="wimg" ></image></view>
  124. <view>{{fite.fjName}}</view>
  125. </view>
  126. <!-- 删除 -->
  127. <view class="delimg flex0" @click.stop="getDelFj(idx,fidx)">
  128. <image :src="delimg"></image>
  129. </view>
  130. </view>
  131. <view class="infolist_b"><text>*</text>请上传大小不超过<text>100MB</text>格式为<text>doc/xls/ppt/txt/pdf/zip/rar/word</text>的文件</view>
  132. </view>
  133. </uni-collapse-item>
  134. <view class="pfixedb flexc">
  135. <view class="cluebtn btn1" @click="getNext(1)">上一步</view>
  136. <view class="cluebtn btn2" @click="getSubmit">提交</view>
  137. </view>
  138. </view>
  139. </block>
  140. <!-- :show-arrow='false' -->
  141. </uni-collapse>
  142. </uni-forms>
  143. <bartree-pickerfixed ref="treePickerzrdw" deptType='1' :multiple='true' @select-change="selectChangezrdw" title="选择责任单位"
  144. :localdata="localdata" valueKey="id" textKey="label" childrenKey="children"></bartree-pickerfixed>
  145. <bartree-pickerfixed deptType='2' ref="treePickerxtdw" :multiple='true' @select-change="selectChangextdw" title="选择协同单位"
  146. :localdata="localdata" valueKey="id" textKey="label" childrenKey="children"></bartree-pickerfixed>
  147. </view>
  148. </template>
  149. <script>
  150. import { getDictionaryFn} from '@/api/work/index.js'
  151. import {selectDictLabel} from "@/utils/common.js"
  152. import {getaddzdapdFn,getdetailzdapdFn,getputzdapdFn} from "@/api/zdwork/addclue.js"
  153. import { checkPermi, checkRole } from "@/utils/permission"; // 权限判断函数
  154. import config from '@/config'
  155. const baseUrl = config.baseUrl
  156. import { getToken } from '@/utils/auth'
  157. import {gettreeselect,getfgwtreeFn} from "@/api/system/user.js"
  158. import bartreePickerfixed from "@/components/ba-tree-picker/ba-tree-pickerfixed.vue"
  159. export default {
  160. components:{bartreePickerfixed},
  161. data() {
  162. return {
  163. //附件
  164. option: {
  165. // 上传服务器地址,需要替换为你的接口地址
  166. url: baseUrl+'/common/upload', // 该地址非真实路径,需替换为你项目自己的接口地址
  167. // 上传附件的key
  168. name: 'file',
  169. // 根据你接口需求自定义请求头,默认不要写content-type,让浏览器自适配
  170. header: {
  171. // 示例参数可删除
  172. 'Authorization': 'Bearer ' + getToken(),
  173. },
  174. // 根据你接口需求自定义body参数
  175. formData: {
  176. }
  177. },
  178. // 选择文件后是否立即自动上传,true=选择后立即上传
  179. instantly: true,
  180. // 必传宽高且宽高应与slot宽高保持一致
  181. width: '',
  182. height: '48rpx',
  183. // 限制允许上传的格式,空串=不限制,默认为空
  184. formats: 'doc,docx,xls,ppt,txt,pdf,zip,rar,word',
  185. // 文件上传大小限制
  186. size: 100,
  187. // 文件数量限制 默认10
  188. count: 5,
  189. // 文件回显列表
  190. files: new Map(),
  191. // 微信小程序Map对象for循环不显示,所以转成普通数组,不要问为什么,我也不知道
  192. wxFiles: [],
  193. // 是否打印日志
  194. debug: false,
  195. filelist:[],
  196. selectDate: '',
  197. defaultPhoneHeight: '', //屏幕默认高度
  198. nowPhoneHeight: '', //屏幕现在的高度
  199. bottom:0,
  200. type:1,
  201. datainfo:{
  202. // "xmId":"",//项目ID
  203. // "xmmc":"",//项目名称
  204. // "dbnrId":"",//督办内容编号
  205. // "dbnrName":"",//督办内容名称
  206. // "deptId":"",//督办部门id
  207. // "deptName":"",//督办部门名称
  208. // "dbdj":"",//督办等级
  209. // "yqwcsj":""//要求完成时间
  210. },
  211. tanfalg:false,
  212. addimg:require("@/static/images/mine/add.png"),
  213. delimg:require("@/static/images/mine/del.png"),
  214. checknimg:require("@/static/images/mine/jnicon.png"),
  215. gcheckimg:require("@/static/images/mine/jicon.png"),
  216. closeimg:require('@/static/images/close.png'),
  217. wimg:require('@/static/images/index/wicon.png'),
  218. downimg:require('@/static/images/index/down.png'),
  219. addpimg:require('@/static/images/new/index/addp.png'),
  220. rules: {
  221. // xmmc: {rules: [{required: true,errorMessage: '请输入项目名称'}]},
  222. // dbnrName: {rules: [{required: true,errorMessage: '请选择督办内容',}]},
  223. // deptName: {rules: [{required: true,errorMessage: '请选择责任单位',}]},
  224. // dbdj: {rules: [{required: true,errorMessage: '请选择督办等级' } ]},
  225. // yqwcsj: {rules: [{required: true,errorMessage: '请选择签要求完成时间'} ]},
  226. },
  227. currentdate:'',//当天日期
  228. superviselist:[],//督办内容bindDateChangedana
  229. dbnrindex:0,//督办内容
  230. location:[],//责任单位bindDateChangedanb
  231. zrdwindex:0,
  232. pagetype:'add',
  233. sfys:'',//是否宜商
  234. pointidx:0,
  235. pointlist:[],
  236. pointlists:[
  237. {"xmId":'',//项目ID
  238. "month":'01',//月份
  239. "xmmc":'',//项目名称
  240. "jdsj":"",//节点完成时间
  241. "jdannr":"",//节点安排内容
  242. "fgwJdapZrDwList":[],//责任单位
  243. "fgwJdapXtDwList":[],//协同单位
  244. "fgwJdapFjList":[],//附件
  245. },
  246. {"xmId":'',"month":'02',"xmmc":'',"jdsj":"","jdannr":"","fgwJdapZrDwList":[],"fgwJdapXtDwList":[],"fgwJdapFjList":[]},
  247. {"xmId":'',"month":'03',"xmmc":'',"jdsj":"","jdannr":"","fgwJdapZrDwList":[],"fgwJdapXtDwList":[],"fgwJdapFjList":[]},
  248. {"xmId":'',"month":'04',"xmmc":'',"jdsj":"","jdannr":"","fgwJdapZrDwList":[],"fgwJdapXtDwList":[],"fgwJdapFjList":[]},
  249. {"xmId":'',"month":'05',"xmmc":'',"jdsj":"","jdannr":"","fgwJdapZrDwList":[],"fgwJdapXtDwList":[],"fgwJdapFjList":[]},
  250. {"xmId":'',"month":'06',"xmmc":'',"jdsj":"","jdannr":"","fgwJdapZrDwList":[],"fgwJdapXtDwList":[],"fgwJdapFjList":[]},
  251. {"xmId":'',"month":'07',"xmmc":'',"jdsj":"","jdannr":"","fgwJdapZrDwList":[],"fgwJdapXtDwList":[],"fgwJdapFjList":[]},
  252. {"xmId":'',"month":'08',"xmmc":'',"jdsj":"","jdannr":"","fgwJdapZrDwList":[],"fgwJdapXtDwList":[],"fgwJdapFjList":[]},
  253. {"xmId":'',"month":'09',"xmmc":'',"jdsj":"","jdannr":"","fgwJdapZrDwList":[],"fgwJdapXtDwList":[],"fgwJdapFjList":[]},
  254. {"xmId":'',"month":'10',"xmmc":'',"jdsj":"","jdannr":"","fgwJdapZrDwList":[],"fgwJdapXtDwList":[],"fgwJdapFjList":[]},
  255. {"xmId":'',"month":'11',"xmmc":'',"jdsj":"","jdannr":"","fgwJdapZrDwList":[],"fgwJdapXtDwList":[],"fgwJdapFjList":[]},
  256. {"xmId":'',"month":'12',"xmmc":'',"jdsj":"","jdannr":"","fgwJdapZrDwList":[],"fgwJdapXtDwList":[],"fgwJdapFjList":[]},
  257. ],
  258. localdata:[],//市值单位
  259. selectValue:[],//选中的市值单位
  260. checktype:'',//选择的是哪个,
  261. year:'',//当前年
  262. value:[],//折叠
  263. }
  264. },
  265. onLoad(e) {
  266. this.year = this.getNowFormatDate();
  267. var newObj=JSON.parse(decodeURIComponent(e.data))
  268. // this.pagetype=newObj.pagetype||'add';
  269. // this.getinvestmentarea();
  270. this.gettreeselect()
  271. this.datainfo.xmId=newObj.id;
  272. this.datainfo.xmmc=newObj.xmmc;
  273. // 循环
  274. this.pointlist=[];
  275. var newmonth=['01','02','03','04','05','06','07','08','09','10','11','12'];
  276. //
  277. newmonth.forEach((ite,idx)=>{
  278. var pointobj ={
  279. "xmId":newObj.id,//项目ID
  280. "xmmc":newObj.xmmc,//项目名称
  281. "month":ite,//月份
  282. "jdsj":"",//节点完成时间
  283. "jdannr":"",//节点安排内容
  284. "fgwJdapZrDwList":[],//责任单位
  285. "fgwJdapXtDwList":[],//协同单位
  286. "fgwJdapFjList":[],//附件
  287. }
  288. this.pointlist.push(pointobj)
  289. })
  290. // if(this.pagetype=='update'){
  291. // this.datainfo.id=newObj.dbid;
  292. // this.getDataFn()
  293. // }else{
  294. // }
  295. // #ifdef APP
  296. uni.onKeyboardHeightChange(res=> { //监听键盘高度变化
  297. const res_keyboard = uni.getSystemInfoSync();
  298. let key_height = res.height - (res_keyboard.screenHeight - res_keyboard.windowHeight)
  299. this.bottom = `${ key_height>0 ? key_height : 0}px`;
  300. })
  301. // #endif
  302. },
  303. onHide() {
  304. // #ifdef APP-PLUS
  305. uni.offKeyboardHeightChange(); // 取消监听键盘高度变化事件,避免内存消耗
  306. // #endif
  307. },
  308. onReady() {
  309. // this.$refs.form.setRules(this.rules)
  310. },
  311. methods: {
  312. checkPermi, checkRole,
  313. getNext(e){
  314. this.type=e;
  315. },
  316. checkstring(e){
  317. var newArr=[];
  318. e.forEach((ite,idx)=>{
  319. newArr[idx]=ite.deptName
  320. })
  321. return newArr.join(',')
  322. },
  323. showPicker(e,idx) {
  324. this.checktype=e;
  325. this.pointidx=idx;
  326. if(e=='xtdw'){
  327. this.$refs.treePickerxtdw._show();
  328. }else if(e=='zrdw'){
  329. this.$refs.treePickerzrdw._show();
  330. }
  331. },
  332. selectChangezrdw(e){
  333. var val=e;
  334. var idx=this.pointidx;
  335. this.pointlist[idx].fgwJdapZrDwList=JSON.parse(JSON.stringify(val));
  336. },
  337. selectChangextdw(e){
  338. var val=e;
  339. var idx=this.pointidx;
  340. this.pointlist[idx].fgwJdapXtDwList=JSON.parse(JSON.stringify(val))
  341. },
  342. gettreeselect(){
  343. // 市值部门102 承接地103
  344. var url=baseUrl;
  345. var parentId=''
  346. if(url.indexOf('https://qszs.qs163.cn')!=-1){
  347. parentId=212
  348. }else{
  349. parentId=210
  350. }
  351. var params={
  352. parentId:parentId
  353. }
  354. getfgwtreeFn(params).then(res=>{
  355. if(res.code==200){
  356. if(res.data&&res.data.length){
  357. this.localdata=res.data;
  358. // var neArr=res.data
  359. // for(var i=0;i<neArr.length;i++){
  360. // if(neArr[i].id=='201'){
  361. // this.cityrange=neArr[i].children
  362. // }
  363. // if(neArr[i].id=='103'){
  364. // this.adrrange=neArr[i].children
  365. // }
  366. // }
  367. }
  368. // this.list=res.rows
  369. }else{
  370. this.$toast(res.msg)
  371. }
  372. })
  373. },
  374. getAddPoint(){
  375. var obj ={
  376. "xmId":this.datainfo.xmId,//项目ID
  377. "xmmc":this.datainfo.xmmc,//项目名称
  378. "jdsj":"",//节点完成时间
  379. "jdannr":"",//节点安排内容
  380. "fgwJdapZrDwList":[],//责任单位
  381. "fgwJdapXtDwList":[],//协同单位
  382. "fgwJdapFjList":[],//附件
  383. }
  384. this.pointlist.push(obj)
  385. },
  386. getDelpoint(idx){
  387. var that = this;
  388. uni.showModal({
  389. title: '提示',
  390. content: "是否确认删除",
  391. success: function(res) {
  392. if (res.confirm) {
  393. that.pointlist.splice(idx, 1)
  394. } else if (res.cancel) {
  395. }
  396. }
  397. });
  398. },
  399. // 项目详情
  400. getDataFn(){
  401. var that=this;
  402. getdetailzdapdFn(this.datainfo.id).then(res=>{
  403. if(res.code==200){
  404. that.pointlist=[];
  405. that.pointlist.push(res.data)
  406. }else{
  407. this.$toast(res.msg)
  408. }
  409. })
  410. },
  411. // 字典值
  412. getinvestmentarea(){
  413. // 督办内容
  414. // getDictionaryFn('supervise_handle').then(res=>{
  415. // if(res.code==200){
  416. // this.superviselist=res.data
  417. // }
  418. // })
  419. // 获取责任单位
  420. getDictionaryFn('proposed_location').then(res=>{
  421. if(res.code==200){
  422. this.location = res.data.map(v => {
  423. return {
  424. dictLabel: v.dictLabel,
  425. dictValue: Number(v.dictValue)
  426. }
  427. })
  428. }
  429. })
  430. },
  431. getNowFormatDate(){
  432. let date = new Date();
  433. let y = date.getFullYear();
  434. let m = date.getMonth() + 1;
  435. m = m < 10 ? "0" + m : m;
  436. let d = date.getDate();
  437. d = d < 10 ? "0" + d : d;
  438. const timeday = y + "-" + m + "-" + d;
  439. return y;
  440. },
  441. getTimeFn(idx){
  442. this.pointidx=idx;
  443. },
  444. bindDateChangetimea(e){//完成时间
  445. var val=e.detail.value;
  446. var idx=this.pointidx;
  447. this.pointlist[idx].jdsj = e.detail.value
  448. // this.datainfo.jdsj=
  449. },
  450. bindDateChangedana(e){
  451. var val=e.detail.value;
  452. this.datainfo.dbnrName=this.superviselist[val].dictLabel
  453. this.datainfo.dbnrId=this.superviselist[val].dictValue
  454. },
  455. bindDateChangedanb(e){
  456. var val=e.detail.value;
  457. this.datainfo.deptName=this.location[val].dictLabel
  458. this.datainfo.deptId=this.location[val].dictValue
  459. },
  460. getSubmit() {
  461. var that=this;
  462. //
  463. var pointlist=that.pointlist;
  464. for(var i =0;i<pointlist.length;i++){
  465. var str=pointlist[i].month+'月'
  466. var nstr=''
  467. if(!pointlist[i].jdsj){
  468. nstr="请选择"+str+":要求完成时间"
  469. that.$toast(nstr)
  470. return
  471. }
  472. if(!pointlist[i].fgwJdapZrDwList||pointlist[i].fgwJdapZrDwList.length<1){
  473. nstr="请选择"+str+":责任单位"
  474. that.$toast(nstr)
  475. return
  476. }
  477. if(!pointlist[i].fgwJdapXtDwList||pointlist[i].fgwJdapXtDwList.length<1){
  478. nstr="请选择"+str+":协同单位"
  479. that.$toast(nstr)
  480. return
  481. }
  482. if(!pointlist[i].jdannr){
  483. nstr="请输入"+str+":具体内容"
  484. that.$toast(nstr)
  485. return
  486. }
  487. }
  488. if(this.pagetype=='add'){
  489. var params={
  490. fgwJdapList:pointlist
  491. }
  492. getaddzdapdFn(params).then(res=>{
  493. if(res.code==200){
  494. this.$toast('新增节点安排成功')
  495. setTimeout(function() {
  496. uni.$emit('refreshdatazd');
  497. uni.navigateBack({delta: 1});
  498. },1500);
  499. }else{
  500. this.$toast(res.msg)
  501. }
  502. })
  503. }else{
  504. // var params=that.pointlist[0];
  505. // getputzdapdFn(params).then(res=>{
  506. // if(res.code==200){
  507. // this.$toast('修改节点安排成功')
  508. // setTimeout(function() {
  509. // uni.$emit('refreshdatazd');
  510. // uni.navigateBack({delta: 1});
  511. // },1500);
  512. // }else{
  513. // this.$toast(res.msg)
  514. // }
  515. // })
  516. }
  517. this.$refs.form.validate().then(res => {
  518. })
  519. },
  520. getFile(idx){
  521. this.filetype=idx
  522. },
  523. onuploadEnd(item) {
  524. var newobj={}
  525. var responseText=JSON.parse(item.responseText)
  526. newobj.fjName=responseText.originalFilename;
  527. newobj.path=responseText.fileName;
  528. var pidx=this.filetype;
  529. var filelist=JSON.parse(JSON.stringify(this.pointlist[pidx].fgwJdapFjList))
  530. filelist.push(newobj)
  531. this.pointlist[pidx].fgwJdapFjList=JSON.parse(JSON.stringify(filelist))
  532. },
  533. getDelFj(idx,fidx){
  534. var filelist=JSON.parse(JSON.stringify(this.pointlist[idx].fgwJdapFjList))
  535. filelist.splice(fidx,1)
  536. this.pointlist[idx].fgwJdapFjList=JSON.parse(JSON.stringify(filelist))
  537. },
  538. getDown(e){
  539. uni.showLoading({
  540. title: '加载中'
  541. });
  542. var url=baseUrl+e;
  543. uni.downloadFile({
  544. url: url,//文件的下载路径
  545. success(result) {
  546. uni.hideLoading()
  547. var filePath = result.tempFilePath;
  548. uni.openDocument({
  549. filePath: filePath,
  550. showMenu: true,
  551. success: function (res) {
  552. }
  553. });
  554. },
  555. fail(res) {uni.hideLoading()}
  556. })
  557. },
  558. }
  559. }
  560. </script>
  561. <style lang="scss" scoped>
  562. .inform{padding-bottom: 160rpx;}
  563. .infolist{padding: 30rpx 32rpx 30rpx 24rpx;position: relative;
  564. .cir{position: absolute;font-size: 36rpx;font-weight: bold;color: #FE5706;left: 0rpx;}
  565. }
  566. .delimg{width: 40rpx;height:40rpx;margin-left: 16rpx;display: flex;align-items: center;justify-content: center;
  567. image{width: 30rpx;height: 30rpx;}
  568. }
  569. .infobtn{width: 100%;height: 88rpx;background: #FA5F03;line-height: 88rpx;position: fixed;left: 0;right: 0;bottom: 0;z-index: 3;}
  570. .input_ye image{width: 34rpx;height: 18rpx;}
  571. .info_tit{font-size: 32rpx;color: #FE5706;padding: 30rpx 26rpx;font-weight: bold;}
  572. .infolist_a{height: 44rpx;flex: 1;text-align: right;font-size: 32rpx;color: #343434;}
  573. .cldelista{
  574. border-bottom: 2rpx solid #E5E5E5;
  575. &:last-of-type{border-bottom: none;}
  576. .contentt{padding:48rpx 28rpx;}
  577. }
  578. .pointlist{padding: 30rpx 0;}
  579. .inform /deep/ .uni-forms-item__error{margin-top: -30rpx;margin-left: 24rpx;}
  580. .inform .pl12{margin-right: 10rpx;}
  581. .fixedbox .pl12{margin-right: 10rpx;}
  582. </style>