1
0

information.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490
  1. <template>
  2. <view class="topBtn">
  3. <u-subsection bg-color="rgb(215,224,233)" button-color="rgb(0,99,208)" active-color="white" :list="list"
  4. v-model="current" @change="subChange"></u-subsection>
  5. <view class="btn">
  6. <u-button size="medium" @click="onClose">关闭</u-button>
  7. </view>
  8. </view>
  9. <view class="handleFile" v-show="current === 0">
  10. <!-- 左侧视图 -->
  11. <view style="height: 100%;width: 65%;">
  12. <leftView></leftView>
  13. </view>
  14. <!-- 右侧视图 -->
  15. <scroll-view scroll-y="true">
  16. <u-form :model="form" ref="form1">
  17. <view style="text-align: start;font-size: 34rpx;font-weight: 700;">领导意见:</view>
  18. <u-form-item prop="suggest" :borderBottom="false"><u-input type="textarea" v-model="form.suggest" border
  19. height="400" /></u-form-item>
  20. </u-form>
  21. <view style="display: flex;">
  22. <view style="flex: 1;">
  23. </view>
  24. <u-button @click="confirm" style="margin-right: 40rpx;height: 70rpx;">保存</u-button>
  25. <u-button @click="confirm" style="height: 70rpx;">常用语</u-button>
  26. </view>
  27. <view style="text-align: start;font-size: 34rpx;font-weight: 700;line-height: 80rpx;">
  28. 操作
  29. </view>
  30. <view class="selected">
  31. <view style="width: 100%;">
  32. <my-segmented-control :current="czcurrent" :values="fwBtn" @clickItem="czsubChange" />
  33. </view>
  34. <!-- <view style="padding: 20rpx;background-color: #f2f2f2;" v-show="!show">
  35. <view style="display: flex;line-height: 80rpx;padding: 10rpx;">
  36. <span style="color: #2d68ea;">转处室,直属领导:</span>
  37. <u-button v-for="(item,index) in zcszsdwList" :type="zcszsdwIndex == index ?'primary' :''" class="lybut"
  38. size="mini" @click="zcszsdwClick(index)">{{item.value}}</u-button>
  39. <view style="flex: 1;">
  40. <u-button style="float: right;margin-top: 10rpx;" size="mini" @click="openRyTree">更多</u-button>
  41. <section-ry-tree-list ref="sectionRyTreeList"></section-ry-tree-list>
  42. </view>
  43. </view>
  44. <view style="background-color: #fff;height: 100rpx;">
  45. </view>
  46. </view>
  47. <view class="" v-show="show">
  48. 已阅后,本件转入已办件!
  49. </view> -->
  50. <view style="height: 300rpx;align-items: center;">
  51. <view style="line-height: 300rpx;font-size: 30rpx">
  52. {{flowData.CODEFUNCTITLE}}
  53. <u-button v-show="showCxxzBut" style="display: inline-block;line-height: 70rpx;height: 70rpx;"
  54. type="primary" @click="openRyTree">重新选择</u-button>
  55. </view>
  56. <section-ry-tree-list ref="sectionRyTreeList"></section-ry-tree-list>
  57. </view>
  58. <view class="">
  59. <u-button type="primary" style="height: 70rpx;width: 400rpx;" @click="openRyTree">提交</u-button>
  60. </view>
  61. </view>
  62. </scroll-view>
  63. </view>
  64. </template>
  65. <script>
  66. import {
  67. ref,
  68. reactive,
  69. nextTick
  70. } from "vue"
  71. import leftView from "./leftView.vue"
  72. import mySegmentedControl from "../../components/mySegmentedControl/mySegmentedControl.vue"
  73. import sectionRyTreeList from "./sectionRyTreeList.vue"
  74. import {
  75. abaseQueryData,
  76. queryFormeditSignByCopyrightid,
  77. flowdirectionQueryData,
  78. queryDataSendByTarget,
  79. saveDataSend,
  80. saveDataOpinion
  81. } from "../api/informationApi.js"
  82. const s4 = new SM4Util()
  83. export default {
  84. components: {
  85. leftView,
  86. mySegmentedControl,
  87. sectionRyTreeList
  88. },
  89. onLoad(e) {
  90. //this.urlParams = e.url
  91. this.urlParams = {
  92. docmode: 12,
  93. guid: 'ZjNjOWU1Nj',
  94. directionid: 'Flow_19dq6vo_87f37f8f-955a-44ff-a531-4675deb7063d',
  95. routeinfoid: '1225074972981907456',
  96. routeid: '1225084527690305536',
  97. formeditid: 'FW_WFH_V_07',
  98. lastrouteinfoid: '1225072376867115008',
  99. copyrightid: '87f37f8f-955a-44ff-a531-4675deb7063d',
  100. dotype: '1',
  101. type: 'todo',
  102. lastReturnPageno: '1',
  103. flowid: 'AA08',
  104. dotype: '1',
  105. url: 'pages/handleFile/handleFile'
  106. }
  107. let data = {
  108. "ckey": "FW_WFH",
  109. "id": 0,
  110. "directionid": this.urlParams.directionid,
  111. "formeditid": this.urlParams.formeditid,
  112. "routeid": this.urlParams.routeid,
  113. "routeinfoid": this.urlParams.routeinfoid
  114. }
  115. abaseQueryData(data).then(res => {
  116. this.queryData = res.data
  117. console.log(this.queryData)
  118. this.fwBtn = []
  119. this.fwInfo = []
  120. let fwBtn = res.data["FW_WFH.FUNCLIST"]
  121. for (let i = 0; i < fwBtn.length; i++) {
  122. if (fwBtn[i].ENDNODETYPE == 2) {
  123. this.fwBtn.push(fwBtn[i].CNAME)
  124. this.fwInfo.push(fwBtn[i])
  125. }
  126. }
  127. if (this.fwInfo.length > 0) {
  128. this.doFlow(this.fwInfo[0])
  129. }
  130. })
  131. },
  132. data() {
  133. return {
  134. queryData: {},
  135. urlParams: {},
  136. show: true,
  137. list: [{
  138. name: '办理'
  139. },
  140. {
  141. name: '流程图'
  142. }
  143. ],
  144. zcszsdwIndex: -1,
  145. zcszsdwList: [{
  146. value: "处室正职",
  147. ry: ["张三", "李四", "王五"]
  148. },
  149. {
  150. value: "直属单位正职",
  151. ry: ["张三", "王五"]
  152. }
  153. ],
  154. current: 0,
  155. czcurrent: 0,
  156. form: {
  157. suggest: ""
  158. },
  159. rules: {
  160. suggest: [{
  161. required: true,
  162. message: '请输入意见',
  163. }]
  164. },
  165. fwBtn: [],
  166. fwInfo: [],
  167. flowData: {
  168. SENDERRORS: {}
  169. },
  170. forwardUser: [],
  171. flowDataList: [],
  172. activeDirection: {}
  173. };
  174. },
  175. computed: {
  176. showCxxzBut() {
  177. return this.flowData.ENDNODETYPE != 1 && this.flowData.CODEFUNCBUTTON != 'SENDCOPYEND' && this.flowData
  178. .CODEFUNCBUTTON !=
  179. 'SENDPERUSAL' && this.flowData.CODEFUNCBUTTON != 'SENDCOMMIT' && this.flowData.SENDERRORS.MESSAGE == ''
  180. }
  181. },
  182. created() {
  183. },
  184. mounted() {
  185. this.$refs.form1.setRules(this.rules)
  186. },
  187. methods: {
  188. openRyTree() {
  189. this.$refs.sectionRyTreeList.open()
  190. },
  191. onClose() {
  192. uni.reLaunch({
  193. url: this.urlParams.url
  194. })
  195. },
  196. confirm() {
  197. this.$refs.form1.validate((valid) => {
  198. if (valid) {
  199. saveDataOpinion({
  200. "cmanid": "0c67561f-5d0d-48fd-a90b-90d69a98fbac", //userid
  201. "routeinfoid": this.urlParams.routeinfoid,
  202. "routeid": this.urlParams.routeid,
  203. "tableid": "FW_WFH",
  204. "colid": "WLDSSL",
  205. "opiniontype": 0,
  206. "cresult": "",
  207. "opinion": this.form.suggest,
  208. "opinionimage": ""
  209. }).then(res => {
  210. uni.showToast({
  211. icon: "success",
  212. title: "保存成功"
  213. })
  214. })
  215. }
  216. })
  217. },
  218. zcszsdwClick(index) {
  219. this.zcszsdwIndex = index
  220. },
  221. subChange() {},
  222. czsubChange(e) {
  223. this.doFlow(this.fwInfo[e.currentIndex])
  224. },
  225. doFlow(fwInfo) {
  226. this.flowData = {
  227. SENDERRORS: {}
  228. }
  229. queryFormeditSignByCopyrightid({
  230. "copyrightid": this.urlParams.copyrightid
  231. }).then(res => {
  232. //console.log("data1", res)
  233. })
  234. flowdirectionQueryData({
  235. "directionid": this.urlParams.directionid
  236. }).then(res => {
  237. //console.log("data2", res)
  238. })
  239. queryDataSendByTarget({
  240. "codefuncbutton": fwInfo.CODE, //--
  241. "directionid": this.urlParams.directionid,
  242. "directionidtarget": fwInfo.DIRECTIONIDTARGET, //--
  243. "userid": "0c67561f-5d0d-48fd-a90b-90d69a98fbac",
  244. "routeinfoid": this.urlParams.routeinfoid,
  245. "routeid": this.urlParams.routeid
  246. }).then(res => {
  247. Object.assign(this.flowData, res.data[0])
  248. console.log(this.flowData)
  249. if (this.flowData.SENDERRORS && this.flowData.SENDERRORS.MESSAGE != "") {
  250. this.flowData.CODEFUNCTITLE = this.flowData.SENDERRORS.MESSAGE;
  251. return
  252. }
  253. if (this.flowData.ENDNODETYPE == 1 || this.flowData.CODEFUNCBUTTON == "SENDCOPYEND" || this.flowData
  254. .CODEFUNCBUTTON == "SENDPERUSAL" || this.flowData.CODEFUNCBUTTON == "SENDCOMMIT") {} else if (this
  255. .flowData.ENDNODETYPE == 3) {
  256. //弹窗
  257. // self.showContent = true;
  258. // self.forwardUser = [];
  259. // this.flowDataList = this.flowData["DIRECTION.CHILD"];
  260. // $.each(this.flowDataList, function(index, item) {
  261. // item.forwardUser = index;
  262. // self.forwardUser.push([])
  263. // item.people1 = item.SENDUSERS.USERS.USERS; //人员
  264. // item.people1.forEach(function(item) {
  265. // item.show = item.USERS.length > 0;
  266. // item.childshow = false;
  267. // item.USERS.forEach(function(item1) {
  268. // item1.show = true;
  269. // })
  270. // })
  271. // item.people2 = item.SENDUSERS.USERSALL.USERS; //人员
  272. // item.people2.forEach(function(item) {
  273. // item.show = true;
  274. // item.childshow = false;
  275. // item.USERS.forEach(function(item1) {
  276. // item1.show = true;
  277. // })
  278. // })
  279. // item.people = JSON.parse(JSON.stringify(item.people1));
  280. // })
  281. // self.activeDirection = this.flowDataList[0]
  282. // self.roleList = self.activeDirection.SENDUSERS.USERS.ROLES;
  283. } else {
  284. this.forwardUser = []
  285. this.flowDataList = [];
  286. this.flowDataList.push(this.flowData)
  287. for (let i = 0; i < this.flowDataList.length; i++) {
  288. let item = this.flowDataList[0]
  289. item.forwardUser = i;
  290. this.forwardUser.push([])
  291. item.people1 = item.SENDUSERS.USERS.USERS; //人员
  292. item.people1.forEach(function(item) {
  293. item.show = item.USERS.length > 0;
  294. item.childshow = false;
  295. item.USERS.forEach(function(item1) {
  296. item1.show = true;
  297. })
  298. })
  299. item.people2 = item.SENDUSERS.USERSALL.USERS; //人员
  300. item.people2.forEach(function(item) {
  301. item.show = true;
  302. item.childshow = false;
  303. item.USERS.forEach(function(item1) {
  304. item1.show = true;
  305. })
  306. })
  307. item.people = JSON.parse(JSON.stringify(item.people1));
  308. }
  309. this.activeDirection = this.flowDataList[0]
  310. this.roleList = this.flowData.SENDUSERS.USERS.ROLES;
  311. let n = 0;
  312. this.flowDataList[0].people1.forEach(function(item) {
  313. n = n + item.USERS.length;
  314. })
  315. if (n == 1) { //如果推荐人员唯一时,缺省直接赋值转发,可以重新选择
  316. this.showContent = false;
  317. this.adduserAll(2);
  318. var usernameStr = "";
  319. this.flowDataList[0].people1.forEach(function(item) {
  320. if (item.USERS.length == 1) {
  321. usernameStr = item.USERS[0].USERNAME
  322. }
  323. })
  324. this.flowData.CODEFUNCTITLE = "确认后将转发【" + usernameStr + "】";
  325. } else {
  326. //弹窗
  327. this.showContent = true;
  328. }
  329. }
  330. })
  331. },
  332. adduserAll() {
  333. this.activeDirection.people.forEach((item, index) => {
  334. item.USERS.forEach((item1, index1) => {
  335. if (item1.show == true) {
  336. this.forwardUser[this.activeDirection.forwardUser].push(item1);
  337. item1.checked = false;
  338. item1.show = false;
  339. }
  340. })
  341. })
  342. this.forwardUser[this.activeDirection.forwardUser].forEach(function(x, y) {
  343. x.type = y == 0 ? 1 : 2
  344. })
  345. },
  346. submit() {
  347. console.log(this.flowDataList)
  348. console.log(this.forwardUser)
  349. let sendUser = []
  350. if (this.flowData.ENDNODETYPE == 1) {
  351. sendUser.push({
  352. DIRECTIONID: this.flowData.DIRECTIONID,
  353. MAINUSERID: "STOP",
  354. COPYUSERID: ""
  355. })
  356. } else if (this.flowData.CODEFUNCBUTTON == "SENDCOPYEND" || this.flowData.CODEFUNCBUTTON ==
  357. "SENDPERUSAL" || this.flowData.CODEFUNCBUTTON == "SENDCOMMIT") {
  358. sendUser.push({
  359. DIRECTIONID: this.flowData.DIRECTIONID,
  360. MAINUSERID: "",
  361. COPYUSERID: ""
  362. })
  363. } else {
  364. let n = 0,
  365. text = [];
  366. this.flowDataList.forEach((item) => {
  367. if (this.forwardUser[item.forwardUser].length > 0) {
  368. n++
  369. sendUser.push({
  370. DIRECTIONID: item.DIRECTIONID,
  371. MAINUSERID: this.forwardUser[item.forwardUser].filter(function(item1) {
  372. return item1.type == 1
  373. }).map(function(item1) {
  374. return item1.USERID
  375. }).join("|"),
  376. COPYUSERID: this.forwardUser[item.forwardUser].filter(function(item1) {
  377. return item1.type == 2
  378. }).map(function(item1) {
  379. return item1.USERID
  380. }).join("|")
  381. })
  382. } else {
  383. text.push(item.CNAME)
  384. }
  385. })
  386. if (n == 0) {
  387. // 未选择人员,请选择至少一项人员!
  388. return
  389. }
  390. }
  391. let data = {
  392. "codefuncbutton": this.flowData.CODEFUNCBUTTON,
  393. "directionid": this.urlParams.directionid,
  394. "userid": "0c67561f-5d0d-48fd-a90b-90d69a98fbac",
  395. "routeinfoid": this.urlParams.routeinfoid,
  396. "routeid": this.urlParams.routeid,
  397. "data": JSON.stringify(sendUser)
  398. }
  399. saveDataSend(data).then(res => {
  400. console.log(res)
  401. })
  402. }
  403. }
  404. }
  405. </script>
  406. <style lang="scss" scoped>
  407. body {
  408. padding: 100rpx 50rpx;
  409. box-sizing: border-box;
  410. }
  411. .topBtn {
  412. width: calc(100vw - 100rpx);
  413. height: 100rpx;
  414. display: flex;
  415. justify-content: space-between;
  416. align-items: center;
  417. //margin-bottom: 20rpx;
  418. border-bottom: 1rpx solid #cccccc;
  419. .u-subsection {
  420. width: 600rpx;
  421. }
  422. .btn {
  423. display: flex;
  424. align-items: center;
  425. justify-content: center;
  426. uni-button {
  427. margin-left: 20rpx;
  428. }
  429. }
  430. }
  431. .content {
  432. background-color: #ebebeb;
  433. border-radius: 20rpx;
  434. width: calc(100vw - 100rpx);
  435. height: calc(100vh - 300rpx);
  436. text-align: center;
  437. }
  438. .handleFile {
  439. width: calc(100vw - 100rpx);
  440. height: calc(100vh - 300rpx);
  441. display: flex;
  442. justify-content: space-around;
  443. align-items: center;
  444. uni-scroll-view {
  445. width: 45vw;
  446. height: 100%;
  447. background-color: #fff;
  448. text-align: center;
  449. padding: 20rpx;
  450. box-sizing: border-box;
  451. }
  452. }
  453. .selected {
  454. height: 400rpx;
  455. }
  456. .mySelectTree {
  457. width: 400rpx;
  458. }
  459. .lybut {
  460. height: 50rpx;
  461. width: 200rpx;
  462. margin-top: 10rpx;
  463. margin-left: 20rpx;
  464. }
  465. </style>