dbZaiCi.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453
  1. <template>
  2. <view>
  3. <u--form labelPosition="left" labelAlign="center" :model="content" ref="uForm" :rules="rules"
  4. :labelStyle="{fontSize:'32rpx'}" labelWidth="130"> <u-form-item label="督办事项:" borderBottom prop="title">
  5. <u--input placeholder='请输入督办事项' v-model="content.title" border="none"></u--input>
  6. </u-form-item>
  7. <!-- <u-form-item label="处室及负责人:" borderBottom prop="departmentHead">
  8. <u--input v-model="content.departmentHead" border="none" readonly></u--input>
  9. </u-form-item> -->
  10. <!-- <u-form-item label="信息类别:" borderBottom prop="infoType">
  11. <u--textarea type="textarea" v-model="content.infoType" placeholder="请输入信息类别"
  12. border="none"></u--textarea>
  13. </u-form-item> -->
  14. <u-form-item label="督办来源:" borderBottom prop="infoSource">
  15. <uni-data-select @change="infoSourceChange" v-model="content.infoSource" :clear="false"
  16. placeholder="请选择督办来源" :localdata="InfoList"></uni-data-select>
  17. </u-form-item>
  18. <u-form-item label="督办内容:" borderBottom prop="infoSourceContent">
  19. <u--textarea type="textarea" v-model="content.infoSourceContent" :placeholder="infoSourceContent"
  20. border="none"></u--textarea>
  21. </u-form-item>
  22. <u-form-item label="完成时限:" @click="typeChange('shixian')" borderBottom prop="doneTime">
  23. <view>
  24. {{content.doneTime}}
  25. </view>
  26. <!-- <u--input v-model="content.doneTime" border="none" readonly></u--input> -->
  27. </u-form-item>
  28. <u-form-item label="责任处室:" borderBottom prop="prersonLiable">
  29. <u--textarea disabled style="width: 190rpx;" type="textarea" v-model="content.prersonLiable"
  30. placeholder="请选择责任处室" border="none"></u--textarea>
  31. <u-button size="small" type="primary" text="选择" @click="handelSelect"
  32. style="margin-top: 40rpx;width: 50rpx;margin-right: 10rpx;"></u-button>
  33. </u-form-item>
  34. <!-- <u-form-item label="各处室进度详情:" style="" borderBottom prop="ywSupervisionItemList"> -->
  35. <view style="text-align: center;font-size: 34rpx;margin-top: 50rpx;font-weight: 700;" class="">
  36. 各处室进度详情:
  37. </view>
  38. <view v-for="item in content.ywSupervisionItemList" :key="item.id"
  39. style="padding: 20rpx 40rpx;border-bottom: 1px solid #ceccca;background-color: #fff;">
  40. <uni-card style="width:600rpx">
  41. <view style='margin:20rpx 40rpx' class="">
  42. <text> 部门: {{item.deptName}}</text>
  43. <br />
  44. <text> 姓名: {{item.userName}}</text>
  45. <br />
  46. <text>
  47. 进展情况:<view v-if="
  48. userId == item.userId &&
  49. item.submitState != '1' " class="">
  50. <u--textarea type="textarea" v-model="item.progress"
  51. placeholder="请输入进展情况"></u--textarea><br />
  52. </view>
  53. <span v-else class="">
  54. {{item.progress}}
  55. <br />
  56. </span>
  57. </text>
  58. <text>
  59. 完成佐证材料:<view v-if="
  60. userId == item.userId &&
  61. item.submitState != '1' " class="example-body">
  62. <uni-file-picker file-mediatype="all" mode="grid" @select="select" @progress="progress"
  63. @success="success" @fail="fail">
  64. </uni-file-picker>
  65. </view>
  66. <view v-else
  67. style="border-radius: 8rpx;background-color: #f3f3f3;margin-top: 40rpx;padding: 20rpx 40rpx;">
  68. <!-- <view style="display: flex;align-items: center;margin-bottom: 20rpx;f">
  69. <u-icon name="file-text-fill" color="#000"></u-icon>
  70. 附件
  71. </view> -->
  72. <view style="margin-bottom: 30rpx;" v-for="v in item.ywFileList" :key="v.fileId">
  73. <u--text :lines="1" size="15" color="#2979FF" decoration="underline" :text="v.name"
  74. @click="downLoad(v.url)">{{v.name}}</u--text>
  75. </view>
  76. </view>
  77. </text>
  78. <br />
  79. <text>
  80. 领导意见:<u--textarea v-if="
  81. userId == item.leaderUserId &&
  82. item.submitState == '1'
  83. " type="textarea" v-model="item.leaderMsg" placeholder="请输入领导意见"></u--textarea></text>
  84. </view>
  85. <span style="display: flex;" v-if="item.leaderApprove == '0'">
  86. <u-button style="width: 100rpx;" v-if="
  87. userId == item.leaderUserId &&
  88. item.submitState == '1'
  89. " size="small" @click="sendBackInfo(item)" type="error">退回
  90. </u-button>
  91. <u-button style="width: 100rpx;margin-left:20rpx" v-if="
  92. userId == item.leaderUserId &&
  93. item.submitState == '1'
  94. " size="small" @click="pass(item)" type="primary">通过
  95. </u-button>
  96. </span>
  97. </uni-card>
  98. <!-- <view v-if="showTijiao" style="padding: 0 20rpx;"> -->
  99. <!-- <u-button v-if="title=='督办编辑'" type="primary" text="保存" @click="keep"
  100. style="margin-top: 40rpx;"></u-button> -->
  101. <u-button type="primary" text="提交" @click="sumbitSupervise" style="margin-top: 40rpx;"></u-button>
  102. <!-- <u-button v-else type="warning" text="提交" @click="submit" style="margin-top: 40rpx;"></u-button> -->
  103. <!-- </view> -->
  104. </view>
  105. <!-- </u-form-item> -->
  106. </u--form>
  107. <u-calendar placeholder="请选择日期" :show="show1" mode="single" allowSameDay @confirm="confirmOne"
  108. @close="show1 = false"></u-calendar>
  109. <u-modal :show="peoShow1" title="请选择接收领导" showCancelButton @cancel="cancel1" @confirm="queren1">
  110. <view style="width: 100%;height: 40vh;overflow: auto;" v-if="peoShow1 == true">
  111. <u-radio-group v-model="value1" @change="radioChange1" iconPlacement="right">
  112. <u-collapse accordion style="width: 100%;">
  113. <u-collapse-item :title="v.Name" :name="v.No" :key="v.No" v-for="v in deptList"
  114. style="width: 100%;">
  115. <view style="font-size: 32rpx; padding: 20rpx 0; border-bottom: 1px solid #eaeaea;"
  116. v-for=" i in userList" :key="i.NO" v-if="i.FK_Dept == v.No">
  117. <u-radio :label="i.Name" :name="i"></u-radio>
  118. </view>
  119. </u-collapse-item>
  120. </u-collapse>
  121. </u-radio-group>
  122. </view>
  123. </u-modal>
  124. </view>
  125. </template>
  126. <script>
  127. export default {
  128. data() {
  129. return {
  130. userId: '',
  131. uploadUrl: uni.getStorageSync('baseUrl') + "/system/file/fileupload",
  132. baseURL: null,
  133. dataSubmit: {
  134. ywFileList: [],
  135. leaderUserName: ""
  136. },
  137. rowThis: {},
  138. peoShow1: false,
  139. show1: false,
  140. typeDate: '',
  141. content: {
  142. ywSupervisionStartUserList: [],
  143. prersonLiable: ''
  144. },
  145. rules: {},
  146. InfoList: [],
  147. infoSourceContent: '',
  148. db_template: [],
  149. title: '',
  150. deptList: [],
  151. userList: [],
  152. dataInfo: {},
  153. Optionsid: null,
  154. showTijiao: false,
  155. tijiaoBtn: false
  156. }
  157. },
  158. onLoad(options) {
  159. // console.log('config.baseURL', this.arg)
  160. this.baseURL = uni.getStorageSync('baseUrl');
  161. this.Optionsid = options.id
  162. this.getDictsInfo()
  163. this.getPeoList('016')
  164. uni.setNavigationBarTitle({
  165. title: options.title
  166. })
  167. this.title = options.title
  168. uni.$u.http.get('/getInfo').then((res) => {
  169. console.log('res1', res)
  170. this.userId = res.user.userId
  171. setTimeout(() => {
  172. uni.$u.http.get('/offcial/supervision/' + options.id).then((res) => {
  173. console.log('res2222', res)
  174. console.log(this.userId)
  175. this.content = res.data
  176. this.dataInfo.supervisionId = res.data.id;
  177. this.content.prersonLiable = ''
  178. this.content.ywSupervisionStartUserList = []
  179. this.tijiaoBtn = res.data.submitState == "1" ? true : false;
  180. this.showTijiao = false;
  181. for (let i = 0; i < this.content.ywSupervisionItemList.length; i++) {
  182. if (
  183. this.content.ywSupervisionItemList[i].userId == this.userId &&
  184. this.content.ywSupervisionItemList[i].submitState == "0"
  185. ) {
  186. this.showTijiao = true;
  187. }
  188. }
  189. })
  190. }, 200)
  191. })
  192. },
  193. onShow() {
  194. uni.$once('query', (query) => {
  195. if (query.a == 'two') {
  196. if (this.content.prersonLiable != null) {
  197. // let arrPeo = this.content.prersonLiable.split(",");
  198. // let arr = getApp().globalData.zerenList.split(',')
  199. // arr = arr.concat(this.content.prersonLiable)
  200. this.content.prersonLiable = getApp().globalData.zerenList
  201. // this.content.prersonLiable = arr.join(" , ");
  202. this.content.ywSupervisionStartUserList = getApp().globalData.ywListZR
  203. } else {
  204. this.content.prersonLiable = getApp().globalData.zerenList
  205. }
  206. }
  207. })
  208. },
  209. methods: {
  210. sumbitSupervise() {
  211. this.content.submitState = '1'
  212. this.content.id = null
  213. this.content.ywSupervisionStartUserList.forEach((item) => {
  214. item.id = null
  215. })
  216. uni.$u.http.post('/offcial/supervision', this.content).then((res) => {
  217. uni.showToast({
  218. title: "提交成功",
  219. icon: "none",
  220. mask: true,
  221. duration: 3000
  222. })
  223. uni.navigateBack()
  224. uni.$emit('query', {
  225. a: 'back'
  226. })
  227. })
  228. },
  229. downLoad(path) {
  230. console.log('’', path)
  231. uni.downloadFile({
  232. url: path,
  233. success: (res) => {
  234. var filePath = res.tempFilePath;
  235. uni.openDocument({
  236. filePath: filePath,
  237. showMenu: true,
  238. success: function(res) {
  239. console.log('打开文档成功');
  240. }
  241. });
  242. }
  243. })
  244. },
  245. sendBackInfo(row) {
  246. if (
  247. row.leaderMsg == "" ||
  248. row.leaderMsg == null ||
  249. row.leaderMsg == undefined
  250. ) {
  251. uni.showToast({
  252. title: "请填写领导意见",
  253. icon: "none",
  254. mask: true,
  255. duration: 3000
  256. })
  257. return;
  258. } else {
  259. this.dataInfo.id = row.id;
  260. this.dataInfo.leaderMsg = row.leaderMsg;
  261. this.dataInfo.leaderApprove = "1";
  262. uni.$u.http.post('/offcial/supervision/leaderApprove', this.dataInfo).then(res => {
  263. uni.showToast({
  264. title: "退回成功",
  265. icon: "none",
  266. mask: true,
  267. duration: 3000
  268. })
  269. uni.$u.http.get('/offcial/supervision/' + Optionsid).then((res) => {
  270. console.log('res', res)
  271. this.content = res.data
  272. this.dataInfo.supervisionId = res.data.id;
  273. this.tijiaoBtn = res.data.submitState == "1" ? true : false;
  274. this.showTijiao = false;
  275. for (let i = 0; i < this.content.ywSupervisionItemList.length; i++) {
  276. if (
  277. this.content.ywSupervisionItemList[i].userId == this.userId &&
  278. this.content.ywSupervisionItemList[i].submitState == "0"
  279. ) {
  280. this.showTijiao = true;
  281. }
  282. }
  283. })
  284. })
  285. }
  286. },
  287. pass(row) {
  288. if (
  289. row.leaderMsg == "" ||
  290. row.leaderMsg == null ||
  291. row.leaderMsg == undefined
  292. ) {
  293. uni.showToast({
  294. title: "请填写领导意见",
  295. icon: "none",
  296. mask: true,
  297. duration: 3000
  298. })
  299. return;
  300. } else {
  301. this.dataInfo.id = row.id;
  302. // this.dataInfo.supervisionId = row.id;
  303. this.dataInfo.leaderMsg = row.leaderMsg;
  304. this.dataInfo.leaderApprove = "2";
  305. uni.$u.http.post('/offcial/supervision/leaderApprove', this.dataInfo).then(res => {
  306. uni.showToast({
  307. title: "通过成功",
  308. icon: "none",
  309. mask: true,
  310. duration: 3000
  311. })
  312. uni.$u.http.get('/offcial/supervision/' + Optionsid).then((res) => {
  313. console.log('res', res)
  314. this.content = res.data
  315. this.dataInfo.supervisionId = res.data.id;
  316. this.tijiaoBtn = res.data.submitState == "1" ? true : false;
  317. this.showTijiao = false;
  318. for (let i = 0; i < this.content.ywSupervisionItemList.length; i++) {
  319. if (
  320. this.content.ywSupervisionItemList[i].userId == this.userId &&
  321. this.content.ywSupervisionItemList[i].submitState == "0"
  322. ) {
  323. this.showTijiao = true;
  324. }
  325. }
  326. })
  327. })
  328. }
  329. },
  330. select(e) {
  331. console.log('e', e)
  332. },
  333. process(e) {
  334. console.log('process', e)
  335. },
  336. queren1() {
  337. this.peoShow1 = false
  338. },
  339. radioChange1(e) {
  340. console.log('65846', e)
  341. this.content.params.toEmps = e.NO
  342. this.content.toEmpsName = e.Name
  343. },
  344. cancel1() {
  345. this.peoShow1 = false
  346. this.content.params.toEmps = null
  347. this.content.toEmpsName = null
  348. this.value1 = null
  349. },
  350. submit() {
  351. this.peoShow1 = true
  352. },
  353. //获取接收人信息
  354. getPeoList(v) {
  355. uni.$u.http.get(`/jflow/restful/GenerNextStepNodeEmpsNoWorkId?flowNo=${v}&toNodeID=602`).then(
  356. res => {
  357. this.deptList = res.Depts
  358. this.userList = res.Emps
  359. console.log(this.deptList)
  360. console.log(this.userList)
  361. })
  362. },
  363. keep() {
  364. uni.showLoading({
  365. title: "保存中...",
  366. mask: true
  367. })
  368. uni.$u.http.put("/offcial/supervision", this.content).then(res => {
  369. uni.showToast({
  370. title: "保存成功",
  371. icon: "none",
  372. mask: true,
  373. duration: 3000
  374. })
  375. uni.hideLoading()
  376. uni.$emit('query', {
  377. a: 'back'
  378. })
  379. setTimeout(() => {
  380. uni.navigateBack()
  381. }, 2000)
  382. }).catch((err) => {
  383. uni.showToast({
  384. title: err.msg,
  385. icon: "none",
  386. mask: true,
  387. duration: 3000
  388. })
  389. uni.hideLoading()
  390. })
  391. },
  392. handelSelect() {
  393. uni.navigateTo({
  394. url: `/pages/zerenchushi/zerenchushi?zaici=` + '1'
  395. })
  396. },
  397. confirmOne(e) {
  398. if (this.typeDate == 'shixian') {
  399. console.log('11')
  400. this.content.doneTime = e[0]
  401. }
  402. this.show1 = false
  403. },
  404. typeChange(e) {
  405. this.show1 = true
  406. this.typeDate = e
  407. },
  408. infoSourceChange(val) {
  409. console.log("db_template", this.db_template);
  410. console.log('val', val);
  411. this.infoSourceContent = this.db_template[val - 1].text;
  412. },
  413. getDictsInfo() {
  414. uni.$u.http.get('/system/dict/data/type/info_source').then(res => {
  415. this.InfoList = res.data.map((item, index) => {
  416. let obj = {
  417. value: item.dictValue,
  418. id: item.dictValue,
  419. text: item.dictLabel
  420. }
  421. return obj
  422. })
  423. })
  424. uni.$u.http.get('/system/dict/data/type/db_template').then(res => {
  425. this.db_template = res.data.map((item, index) => {
  426. let obj = {
  427. value: item.dictValue,
  428. id: item.dictValue,
  429. text: item.dictLabel
  430. }
  431. return obj
  432. })
  433. })
  434. }
  435. }
  436. }
  437. </script>
  438. <style>
  439. </style>