questionInfo.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584
  1. <template>
  2. <view>
  3. <cu-custom bgColor="bg-blue" :isBack="true" v-if="title == '问题诉求情况'">
  4. <block slot="backText">返回</block>
  5. <block slot="content">问题诉求情况</block>
  6. </cu-custom>
  7. <form @submit="formSubmit" class="cu-list menu">
  8. <view class="titlebg2">
  9. <view class="titlet1" ></view>
  10. <view class="titlet2" >企业信息</view>
  11. </view>
  12. <view class="textbg">
  13. <view class="text12">
  14. 企业名称
  15. </view>
  16. <view class="text22">
  17. {{inputForm.name}}
  18. </view>
  19. </view>
  20. <view class="textbg">
  21. <view class="text12">
  22. 属地
  23. </view>
  24. <view class="text22">
  25. {{inputForm.des1}}
  26. </view>
  27. </view>
  28. <view class="textbg">
  29. <view class="text12">
  30. 企业负责人
  31. </view>
  32. <view class="text22">
  33. {{inputForm.lxr}}
  34. </view>
  35. </view>
  36. <view class="textbg">
  37. <view class="text12">
  38. 负责人号码
  39. </view>
  40. <view class="text22">
  41. {{inputForm.phone}}
  42. </view>
  43. </view>
  44. <view style="height: 30rpx;background-color: white;"></view>
  45. <view class="titlebg2" style="margin-top:10rpx ;">
  46. <view class="titlet1" ></view>
  47. <view class="titlet2" >挂钩干部</view>
  48. </view>
  49. <view class="textbg">
  50. <view class="text12">
  51. 姓名
  52. </view>
  53. <view class="text22">
  54. {{inputForm.bz5}}
  55. </view>
  56. </view>
  57. <view style="height: 30rpx;background-color: white;"></view>
  58. <view class="titlebg2" style="margin-top:10rpx ;">
  59. <view class="titlet1" ></view>
  60. <view class="titlet2" >主要问题诉求</view>
  61. </view>
  62. <view v-for="(item, index2) in questionList">
  63. <view style="display: flex;background-color: #ffffff;justify-content: space-between; align-items: center;">
  64. <view class="titlebb">
  65. 问题{{index2+1}}
  66. </view>
  67. <!-- <icon v-if="index2!=0" @click="del(index2)" type="cancel" style="padding-right: 15rpx;padding-top: 5rpx;padding-left: 100rpx;"></icon> -->
  68. </view>
  69. <view class="input1">
  70. <view class="title">
  71. 问题名称
  72. </view>
  73. <input v-model="item.qname" placeholder="请填写问题名称" disabled="true" ></input>
  74. </view>
  75. <view class="cu-form-group margin-top">
  76. <view class="title">
  77. 问题类型
  78. </view>
  79. <view class="input2">{{item.qtype||'请选择问题类型'}}</view>
  80. </view>
  81. <view class="cu-form-group margin-top" v-if="item.t1!=''">
  82. <view class="title">
  83. {{item.t1}}
  84. </view>
  85. <input style="width: 200rpx;" v-model="item.gaps" :placeholder="item.t1s" disabled="true"></input>{{item.t1d}}
  86. </view>
  87. <view class="cu-form-group margin-top" style="border-bottom: 3px solid #eee;">
  88. <view class="title">
  89. 问题描述
  90. </view>
  91. <textarea v-model="item.des" placeholder="请填写问题描述" disabled="true" ></textarea>
  92. </view>
  93. <!-- 挂钩干部 -->
  94. <view class="cu-form-group margin-top" v-if="roleIds=='1910141956174053377'" >
  95. <view class="title">
  96. 问题处理
  97. </view>
  98. <radio-group @change="(e) => radioChange(e, index2)" class="radiog">
  99. <label class="uni-list-cell uni-list-cell-pd" v-for="(item3, index3) in dels" :key="item3">
  100. <view>
  101. <radio :value="item3" :checked="index3 === item.current" />
  102. </view>
  103. <view style="padding-left: 15rpx;">{{item3}}</view>
  104. </label>
  105. </radio-group>
  106. </view>
  107. <!-- 大走访办公室 -->
  108. <view class="cu-form-group margin-top" v-if="roleIds=='1910175386924417025'" >
  109. <view class="title">
  110. 问题处理
  111. </view>
  112. <radio-group @change="(e) => radioChange(e, index2)" class="radiog">
  113. <label class="uni-list-cell uni-list-cell-pd" v-for="(item3, index3) in dels2" :key="item3">
  114. <view>
  115. <radio :value="item3" :checked="index3 === item.current" />
  116. </view>
  117. <view style="padding-left: 15rpx;">{{item3}}</view>
  118. </label>
  119. </radio-group>
  120. </view>
  121. <view class="cu-form-group margin-top">
  122. <view class="title">
  123. 预计办结时间
  124. </view>
  125. <picker mode="date" class="title2" @change="(e) => onDateChange(e, index2)" >
  126. <view class="input2">{{item.finishdate||'请选择'}}</view>
  127. </picker>
  128. </view>
  129. <view class="cu-form-group margin-top" >
  130. <view class="title">
  131. 处理意见
  132. </view>
  133. <textarea v-model="item.delyj" placeholder="请填写处理意见" ></textarea>
  134. </view>
  135. <!-- <view class="cu-form-group2 margin-top" style="border-bottom: 3px solid #eee;">
  136. <view class="title">
  137. 附件:
  138. </view>
  139. <button @click="addfj" style="height: 30px;width: 240rpx;margin-left: 55rpx;" class="cu-btn block bg-blue margin-tb-sm lg">+上传附件</button>
  140. </view>
  141. <view v-for="(item3, index3) in item.fj">
  142. <view style="display: flex;background-color: #ffffff;justify-content: space-between; align-items: center;">
  143. <view class="titlebb">
  144. {{item3.fjname}}
  145. </view>
  146. <icon @click="del(index3)" type="cancel" style="padding-right: 15rpx;padding-top: 5rpx;padding-left: 100rpx;"></icon>
  147. </view>
  148. </view> -->
  149. <view class="cu-form-group margin-top" style="border-bottom: 3px solid #eee;">
  150. <uni-file-picker style="margin-bottom: 10px;" limit="3" ref="picFile" v-model="item.fj"
  151. fileMediatype="all" mode="grid" title="附件上传" :auto-upload="autoUpload" @select="select"
  152. @progress="progress" @success="success" @fail="fail" @delete="deleteFile"
  153. :imageStyles="imageStyles" :disabled="ischeck">
  154. </uni-file-picker>
  155. </view>
  156. </view>
  157. <!-- <view style="width: 400rpx;margin-left: 20rpx;">
  158. <button @click="addp" style="height: 30px;" class="cu-btn block bg-blue margin-tb-sm lg">+增加问题</button>
  159. </view> -->
  160. <view style="height: 40rpx;"></view>
  161. <view class="flexC" >
  162. <button @click="save" class="bt1 block margin-tb-sm lg">暂存</button>
  163. <button form-type="submit" class="bt1 cu-btn block bg-blue margin-tb-sm lg">提交</button>
  164. </view>
  165. <view style="height: 40rpx;"></view>
  166. </form>
  167. </view>
  168. </template>
  169. <script>
  170. var graceChecker = require("@/common/graceChecker.js");
  171. import revenueListService from '@/api/revenue/revenueListService'
  172. import loginService from '@/api/auth/loginService.js'
  173. import * as $auth from "../../common/auth"
  174. export default {
  175. onShow() {
  176. this.$auth.checkLogin()
  177. },
  178. data() {
  179. return {
  180. title: '问题诉求情况',
  181. roleIds:'',
  182. inputForm: {
  183. id:'',
  184. name: '',
  185. industry: '',
  186. lxr: '',
  187. phone: '',
  188. bz1: '',
  189. bz2: '',
  190. bz3: '',
  191. bz4: '',
  192. bz5: '',
  193. bz6: '',
  194. des1: '',
  195. des2: '',
  196. des3: '',
  197. des4: '',
  198. des6: '',
  199. des10: '',
  200. },
  201. t1: '可供产品',
  202. t1s: '请填写可供产品',
  203. t2: '可供数量',
  204. t2s: '请填写可供数量',
  205. t3: '详细描述',
  206. t3s: '请填写详细描述',
  207. autoUpload: false,
  208. picLists: [],
  209. picUrl: [],
  210. imageStyles: {
  211. width: 90,
  212. height: 90
  213. },
  214. parkList: [ "用工人才", "资金需求", "土地厂房", "订单及配套", "政策兑现", "创新及品牌", "审批手续", "水电气供应", "安全环保消防", "其他(需详细说明)"],
  215. questionList:[{qname:"",qtype:"",qTypeindex:"",gaps:"",des:"",t1:"",t1s:""}],
  216. dels:["办结","反馈大走访活动办","正在办理","难以化解","持续跟踪","提请会办"],
  217. dels2:["办结","交办"],
  218. index:0,
  219. ischeck: false,
  220. }
  221. },
  222. created() {
  223. },
  224. mounted() {
  225. },
  226. async onLoad(query) {
  227. if(query.ischeck!=undefined&&query.ischeck=='1'){
  228. //查看
  229. this.ischeck=true;
  230. let data2 = await loginService.getdzfQuestionqueryById({id:query.id})
  231. this.inputForm.id = data2.data.id;
  232. this.inputForm.name = data2.data.qyName;
  233. this.inputForm.des1 = data2.data.des1;
  234. this.inputForm.lxr = data2.data.qyFzr;
  235. this.inputForm.phone = data2.data.phone;
  236. this.inputForm.bz5 = data2.data.officer;
  237. this.questionList=data2.data.dzfQuestionDetilDTOList;
  238. this.roleIds= $auth.getUserInfo().roleIds;
  239. console.log(this.roleIds);
  240. }else{
  241. //新增
  242. let data2 = await loginService.queryByUserName()
  243. this.inputForm = this.recover(this.inputForm, data2.data)
  244. this.inputForm.id="";
  245. }
  246. },
  247. methods: {
  248. onDateChange(e,index2) {
  249. this.$set(this.questionList[index2], 'finishdate', e.detail.value);
  250. },
  251. radioChange: function(evt,index2) {
  252. for (let i = 0; i < this.dels.length; i++) {
  253. if (this.dels[i] === evt.detail.value) {
  254. this.questionList[index2].current = i;
  255. break;
  256. }
  257. }
  258. },
  259. addfj(){
  260. },
  261. addp(){
  262. this.questionList.push({qname:"",qtype:"",qTypeindex:"",gaps:"",des:"",t1:"",t1s:""})
  263. },
  264. del(index2){
  265. this.questionList.splice(index2, 1);
  266. },
  267. bindPickerChange: function(e,index2) {
  268. if(e.detail.value==0){
  269. this.questionList[index2].t1='缺口数';
  270. this.questionList[index2].t1s= '请填写缺口数';
  271. this.questionList[index2].t1d= '人';
  272. }else if(e.detail.value==1){
  273. this.questionList[index2].t1='缺口数';
  274. this.questionList[index2].t1s= '请填写缺口数';
  275. this.questionList[index2].t1d= '万元';
  276. }else if(e.detail.value==2){
  277. this.questionList[index2].t1='缺口数';
  278. this.questionList[index2].t1s= '请填写缺口数';
  279. this.questionList[index2].t1d= '';
  280. }else{
  281. this.questionList[index2].t1='';
  282. this.questionList[index2].t1s= '';
  283. this.questionList[index2].t1d= '';
  284. }
  285. this.questionList[index2].qTypeindex = e.detail.value;
  286. this.questionList[index2].qtype=this.parkList[e.detail.value]
  287. },
  288. // 获取上传进度
  289. progress(e) {
  290. console.log('上传进度:', e)
  291. },
  292. // 上传成功
  293. success(e) {
  294. console.log('上传成功')
  295. },
  296. // 上传失败
  297. fail(e) {
  298. console.log('上传失败:', e)
  299. },
  300. deleteFile(e) {
  301. this.picUrl.splice(e.index, 1)
  302. },
  303. // 获取上传状态
  304. select(e) {
  305. console.log('选择文件:', e)
  306. var _this = this
  307. var i = 0
  308. upload()
  309. function upload() {
  310. if (i >= e.tempFiles.length) {
  311. return;
  312. }
  313. var item = e.tempFiles[i]
  314. uni.showLoading({
  315. title: "上传中",
  316. mask: true
  317. });
  318. uni.uploadFile({
  319. url: '/yd_qycpfb/file/upload?uploadPath=userdir', // 仅为示例,非真实的接口地址
  320. filePath: item.url,
  321. name: 'file',
  322. formData: {
  323. 'fileName': item.name
  324. },
  325. header: {
  326. 'token': _this.$auth.getUserToken()
  327. },
  328. success: (res) => {
  329. var data = res.data
  330. if (typeof data['error'] != "undefined") {
  331. uni.showToast({
  332. icon: 'none',
  333. title: '上传失败,请联系开发!'
  334. });
  335. _this.$refs.picFile.clearFiles(_this.picLists.length)
  336. } else {
  337. _this.picUrl.push({
  338. url: data,
  339. uuid: item.uuid
  340. })
  341. i++;
  342. upload()
  343. }
  344. },
  345. fail: () => {
  346. uni.hideLoading();
  347. uni.showToast({
  348. icon: 'none',
  349. title: '上传失败,请联系开发!'
  350. });
  351. _this.$refs.picFile.clearFiles(_this.picLists.length)
  352. },
  353. complete: function() {
  354. uni.hideLoading();
  355. }
  356. });
  357. }
  358. },
  359. save(){
  360. this.inputForm.des10="";
  361. this.inputForm.dzfQuestionDetilDTOList=this.questionList;
  362. this.checkinput();
  363. },
  364. formSubmit: function(e) {
  365. this.inputForm.des10="submit";
  366. this.inputForm.dzfQuestionDetilDTOList=this.questionList;
  367. this.checkinput();
  368. },
  369. checkinput(){
  370. if(this.hasDuplicateQName(this.questionList)){
  371. uni.showToast({
  372. icon: 'none',
  373. title: '问题名称不能重复!'
  374. });
  375. }else{
  376. uni.showLoading()
  377. loginService.saveQuestion(this.inputForm).then(({
  378. data
  379. }) => {
  380. uni.hideLoading();
  381. uni.showToast({
  382. title: "问题诉求提交成功!",
  383. icon: "success"
  384. });
  385. uni.navigateTo({
  386. url: '/pages/question/questionList'
  387. })
  388. }).catch((e) => {
  389. uni.hideLoading();
  390. })
  391. }
  392. },
  393. hasDuplicateQName(array) {
  394. const seen = new Set();
  395. for (const item of array) {
  396. if (seen.has(item.qname)) {
  397. return true; // 找到重复的 qName
  398. }
  399. seen.add(item.qname);
  400. }
  401. return false; // 没有重复的 qName
  402. }
  403. }
  404. }
  405. </script>
  406. <style>
  407. /* .file-title) {
  408. font-size: 17px !important;
  409. } */
  410. input,textarea{
  411. color: #8799a3;
  412. }
  413. .input1{
  414. background-color: #ffffff;
  415. padding: 1upx 40upx;
  416. display: flex;
  417. align-items: center;
  418. padding-top: 20upx;
  419. border-bottom: 1px solid #eee;
  420. }
  421. .input1 .title {
  422. text-align: justify;
  423. padding-right: 30upx;
  424. font-size: 30upx;
  425. position: relative;
  426. height: 60upx;
  427. line-height: 60upx;
  428. border: ;
  429. }
  430. .title2{
  431. width: 75%;
  432. text-align: left;
  433. }
  434. .input2 {
  435. flex: 1;
  436. font-size: 30upx;
  437. color: #555;
  438. padding-right: 20upx;
  439. width: 500rpx;
  440. }
  441. .uni-input{
  442. }
  443. .textbg{
  444. display: flex;
  445. background-color: white;
  446. padding-top: 29rpx;
  447. }
  448. .text12{
  449. width: 200rpx;
  450. margin-left: 30rpx;
  451. color: #000000;
  452. font-size: 29rpx;
  453. }
  454. .text2{
  455. flex: 1;
  456. color: #000000;
  457. font-size: 30rpx;
  458. padding-bottom: 2rpx;
  459. }
  460. .text22{
  461. flex: 1;
  462. color: #666666;
  463. font-size: 29rpx;
  464. padding-bottom: 2rpx;
  465. align-self: flex-end;
  466. }
  467. .titlebg2{
  468. display: flex;
  469. background-color: white;
  470. padding-left: 22rpx;
  471. padding-top: 35rpx;
  472. padding-bottom: 25rpx;
  473. margin-bottom: 2rpx;
  474. }
  475. .titlet1{
  476. width: 7rpx;
  477. margin-top: 7rpx;
  478. margin-bottom: 7rpx;
  479. background-color: #2752eb;
  480. margin-right: 8rpx;
  481. }
  482. .titlet2{
  483. font-weight: 800;
  484. color: #2752eb;
  485. }
  486. .titlebb{
  487. color: #000000;
  488. font-weight: 800;
  489. padding-left: 40rpx;
  490. background-color: #ffffff;
  491. padding-top: 20rpx;
  492. }
  493. .flexC{
  494. display: flex;
  495. }
  496. .bt1{
  497. flex:1;
  498. margin: 30rpx;
  499. }
  500. .bt2{
  501. flex:1;
  502. margin: 30rpx;
  503. }
  504. .radiog{
  505. flex:1;
  506. margin: 10rpx;
  507. }
  508. .uni-list-cell{
  509. display: flex;
  510. }
  511. .cu-form-group2{
  512. background-color: #ffffff;
  513. padding: 0.5px 22px;
  514. display: flex;
  515. align-items: center;
  516. min-height: 44px;
  517. }
  518. </style>