workOrderReply.vue 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638
  1. <template>
  2. <fullscreen :fullscreen.sync="fullscreen" class="container">
  3. <div class="container-box">
  4. <toolList @iconCli='iconCli' :tooltit='tooltit'></toolList>
  5. <div class="search">
  6. <mySearch :searchList="searchList" @searchInfo="searchInfo"></mySearch>
  7. </div>
  8. <div class="tabbox">
  9. <el-table height="calc(100% - 40px)" class="com-table" ref="multipleTable" :data="tableData"
  10. tooltip-effect="dark" size="small" border style="width: 100%" v-loading="loading">
  11. <el-table-column prop="woTitle" label="工单标题">
  12. </el-table-column>
  13. <el-table-column prop="sendNo" label="派发工号">
  14. </el-table-column>
  15. <el-table-column prop="sendName" label="派发姓名">
  16. <template slot-scope="scope">
  17. <span>{{$desensitization(scope.row.sendName,1)}}</span>
  18. </template>
  19. </el-table-column>
  20. <el-table-column prop="sendTime" label="派发时间" width="140">
  21. </el-table-column>
  22. <!-- <el-table-column prop="auditName" label="审核人">
  23. <template slot-scope="scope">
  24. <span>{{$desensitization(scope.row.auditName,1)}}</span>
  25. </template>
  26. </el-table-column>
  27. <el-table-column prop="auditTime" label="审核时间" width="140">
  28. </el-table-column> -->
  29. <el-table-column prop="stsDesc" label="状态">
  30. </el-table-column>
  31. <el-table-column label="操作" width="180px" align="center">
  32. <template slot-scope="scope">
  33. <el-button size="mini" type="primary" @click="dialogCheck(1,scope.row)">查看</el-button>
  34. <el-button v-if="scope.row.sts == 2 && scope.row.auditNo == userInfo.loginNoStr" size="mini" type="primary"
  35. @click="dialogCheck(3,scope.row)">回复</el-button>
  36. </template>
  37. </el-table-column>
  38. </el-table>
  39. <el-pagination class="pageBox" @current-change="currchange" layout="prev, pager, next" background
  40. :total="total">
  41. </el-pagination>
  42. </div>
  43. </div>
  44. <el-dialog title="工单任务" :visible.sync="dialogStatus" width="50%" :destroy-on-close="true"
  45. :modal-append-to-body="false" :close-on-click-modal="false" :fullscreen="true">
  46. <div class="dialog-l">
  47. <el-tabs tab-position="left" v-model="activeName">
  48. <el-tab-pane v-for="item in routerList" :key="item.label" :name="item.label" :label="item.name">
  49. </el-tab-pane>
  50. </el-tabs>
  51. </div>
  52. <div v-loading="loadinged" class="dialog-r">
  53. <el-form :model="infolist" ref="infolist" :rules="rules"
  54. style="height: calc(100vh - 180px);overflow-y: scroll;">
  55. <div class="info-line">
  56. <el-form-item>
  57. <span>任务标题</span>
  58. <el-input v-model="infolist.woTitle" placeholder="标题" :disabled='disableStatus'></el-input>
  59. </el-form-item>
  60. </div>
  61. <el-form-item class="info-line online" v-if="activeName != '3'">
  62. <span>接收人员</span>
  63. <deptTreeOnly class="tree" @treeCheck="treeCheckonly" :defaultList="defaultList"
  64. :type="depttype"></deptTreeOnly>
  65. <div class="tree treeUser">
  66. <p>{{treeListonly.leaderAuditName}}</p>
  67. </div>
  68. </el-form-item>
  69. <el-form-item class="info-line online">
  70. <span>工单备注</span>
  71. <el-input v-model="infolist.dealRemark" placeholder="工单备注" type="textarea" :rows="3">
  72. </el-input>
  73. </el-form-item>
  74. <div style="padding-left: 80px" v-if="activeName == '3'">
  75. <myUpload @uploadBack="uploadBack" :fileInfo="fileInfo" :fileList="fileInfo.fileList">
  76. </myUpload>
  77. </div>
  78. </el-form>
  79. <div slot="footer" class="dialog-footer myfooter">
  80. <el-button type="primary" @click="dialogCli(2)">确 定</el-button>
  81. <el-button @click="dialogCli(1)">取 消</el-button>
  82. </div>
  83. </div>
  84. </el-dialog>
  85. <el-dialog title="查看工单" :visible.sync="dialogInfo" width="70%" :close-on-press-escape="false" :show-close="true"
  86. :destroy-on-close="true" :modal-append-to-body="false" :close-on-click-modal="false" :fullscreen="true">
  87. <div style="height: calc(100vh - 180px);overflow-y: scroll;">
  88. <orderCheck :historySts="historySts" :infolist="infolist" :datalist="datalist" :backlist="backlist" :dialogInfo="dialogInfo"></orderCheck>
  89. </div>
  90. <div class="dialog-footer myfooter">
  91. <el-button @click="dialoginfoCli(1)" type="primary">轨 迹</el-button>
  92. <el-button @click="dialoginfoCli(2)" type="primary" v-if="infolist.sts == '2' && infolist.auditNo == userInfo.loginNoStr">回 复</el-button>
  93. <el-button @click="dialoginfoCli(3)">取 消</el-button>
  94. </div>
  95. </el-dialog>
  96. </fullscreen>
  97. </template>
  98. <script>
  99. import mySearch from "../../../components/search.vue";
  100. import myUpload from '../../../components/upload'
  101. import uploadDown from '../../../components/uploadDown'
  102. import toolList from '../../../components/toolList'
  103. import deptTree from "../../../components/deptTreeUser.vue"
  104. import deptTreeOnly from "../../../components/deptTreeOnly.vue"
  105. import orderCheck from "./orderCheck.vue"
  106. export default {
  107. components: {
  108. mySearch,
  109. myUpload,
  110. uploadDown,
  111. toolList,
  112. deptTree,
  113. deptTreeOnly,
  114. orderCheck
  115. },
  116. data() {
  117. const terminalTypeName = (rule, value, callback) => {
  118. if (!this.infolist.tit) {
  119. callback(new Error('不能为空'))
  120. } else {
  121. callback()
  122. }
  123. }
  124. const brandName = (rule, value, callback) => {
  125. if (!this.infolist.num) {
  126. callback(new Error('不能为空'))
  127. } else {
  128. if (this.infolist.num > 10) {
  129. this.infolist.num = 10;
  130. }
  131. callback()
  132. }
  133. }
  134. const modelType = (rule, value, callback) => {
  135. if (!this.infolist.time) {
  136. callback(new Error('不能为空'))
  137. } else {
  138. callback()
  139. }
  140. }
  141. return {
  142. rules: {
  143. terminalTypeName: [{
  144. required: true,
  145. trigger: 'blur',
  146. validator: terminalTypeName
  147. }],
  148. brandName: [{
  149. required: true,
  150. trigger: 'blur',
  151. validator: brandName
  152. }],
  153. modelType: [{
  154. required: true,
  155. trigger: 'blur',
  156. validator: modelType
  157. }],
  158. },
  159. tooltit: '工单回复',
  160. searchList: [{
  161. type: 'input',
  162. tit: '工单标题',
  163. value: '',
  164. width: '32%',
  165. },
  166. {
  167. type: 'date',
  168. tit: '开始时间',
  169. value: '',
  170. width: '32%',
  171. },
  172. {
  173. type: 'date',
  174. tit: '结束时间',
  175. value: '',
  176. width: '32%',
  177. },
  178. ],
  179. fullscreen: false,
  180. total: 0,
  181. pageSize: 1,
  182. tableData: [{}],
  183. dialogStatus: false,
  184. disableStatus: false,
  185. titname: '终端',
  186. infolist: {},
  187. typeOptions: [{
  188. dataCode: 1,
  189. dataName: 111,
  190. }],
  191. userInfo: {},
  192. params: {},
  193. infoApply: [],
  194. fileInfo: {
  195. limit: 10,
  196. url: '/market/cwo/revertUpload',
  197. fileList: []
  198. },
  199. datalist: {
  200. url: '/sysmgr/noticeatt/downfile',
  201. type: 1
  202. },
  203. backlist: {
  204. url: '/sysmgr/noticeatt/downfile',
  205. type: 1
  206. },
  207. datalistback: {
  208. url: '/sysmgr/noticeatt/downfile',
  209. type: 2
  210. },
  211. uploadstatus: false,
  212. visiblec: [],
  213. attList: [],
  214. btnctrlStatus: true,
  215. typelist: [],
  216. loading: false,
  217. loadinged: false,
  218. treeList: [],
  219. treeListonly: [],
  220. defaultList: [],
  221. depttype: 0,
  222. transfer: false,
  223. activeName: '3',
  224. routerList: [{
  225. name: '其他人办理',
  226. label: '1'
  227. }, {
  228. name: '领导审批',
  229. label: '2'
  230. }, {
  231. name: '办理结束',
  232. label: '3'
  233. }, ],
  234. dialogInfo:false,
  235. historySts:false,
  236. }
  237. },
  238. methods: {
  239. treeCheck(v) {
  240. this.treeList = v;
  241. },
  242. treeCheckonly(v) {
  243. this.treeListonly = v;
  244. },
  245. //搜索数据
  246. searchInfo(v) {
  247. this.params = {};
  248. v[0] ? this.params.woTitle = v[0] : '';
  249. v[1] ? this.params.sendTimeFrom = this.$formatDate(v[1], "YYYY-MM-DD") : '';
  250. v[2] ? this.params.sendTimeTo = this.$formatDate(v[2], "YYYY-MM-DD") : '';
  251. // v[3] ? this.params.modelType = v[3] : '';
  252. this.getList(this.params, this.pageSize);
  253. },
  254. //获取列表
  255. getList(v, n) {
  256. this.pageSize = n;
  257. let _this = this;
  258. this.tableData = [];
  259. this.loading = true;
  260. this.$http({
  261. url: "/market/cwo/queryListByTraceDeal",
  262. method: "post",
  263. headers: {
  264. "Content-Type": "application/json",
  265. "page": '{"pageNo":"' + n + '","pageSize":"10"}'
  266. },
  267. data: v,
  268. }).then((res) => {
  269. this.tableData = res.data.data;
  270. this.total = res.data.totalRecord;
  271. this.loading = false;
  272. });
  273. },
  274. // 分页
  275. currchange(v) {
  276. this.pageSize = v;
  277. this.getList(this.params, this.pageSize);
  278. },
  279. //申请
  280. overcheck(v) {
  281. let _this = this;
  282. this.$http({
  283. url: "/market/cwo/closeWoInfo",
  284. method: "post",
  285. headers: {
  286. "Content-Type": "application/json",
  287. },
  288. data: {
  289. woNo: v.woNo
  290. },
  291. }).then((res) => {
  292. _this.$message({
  293. message: '成功',
  294. type: 'success'
  295. });
  296. _this.getList({}, _this.pageSize);
  297. });
  298. },
  299. dialogCheck(v, n) {
  300. this.defaultList = [];
  301. if (v == 1) {
  302. this.titname = '查看';
  303. } else if (v == 3) {
  304. this.titname = '回复';
  305. this.dialogStatus = true;
  306. this.disableStatus = false;
  307. }
  308. this.$http({
  309. url: "/market/cwo/queryInfo",
  310. method: "post",
  311. headers: {
  312. "Content-Type": "application/json",
  313. },
  314. data: {
  315. woNo: n.woNo,
  316. id: n.id,
  317. },
  318. }).then((res) => {
  319. this.uploadstatus = true;
  320. this.infolist = res.data;
  321. this.infolist.sendName = this.$desensitization(res.data.sendName, 1);
  322. this.infolist.auditName = this.$desensitization(res.data.auditName, 1);
  323. this.visiblec = [];
  324. this.treeList = res.data.deptList;
  325. this.datalist.attList = res.data.attList;
  326. this.backlist.attList = res.data.revertAttList;
  327. this.infolist.attList = res.data.attList;
  328. if (v == 1) {
  329. this.dialogInfo = true;
  330. }
  331. this.attList = [];
  332. this.fileInfo.fileList = [];
  333. // if (res.data.revertAttList) {
  334. // res.data.revertAttList.forEach(item => {
  335. // this.fileInfo.fileList.push({
  336. // name: item.fileName,
  337. // url: '',
  338. // id: item.id,
  339. // fileName: item.fileName,
  340. // fileCode: item.fileCode,
  341. // });
  342. // this.attList.push({
  343. // name: item.fileName,
  344. // url: '',
  345. // id: item.id,
  346. // fileName: item.fileName,
  347. // fileCode: item.fileCode,
  348. // });
  349. // })
  350. // }
  351. this.depttype = 1;
  352. });
  353. },
  354. //添加
  355. dialogCli(v) {
  356. if (v === 1) {
  357. this.infolist = {};
  358. this.dialogStatus = false;
  359. this.defaultList = [];
  360. this.depttype = 0;
  361. return
  362. } else if (v === 2) {
  363. let params = {
  364. woNo: this.infolist.woNo,
  365. woTitle: this.infolist.woTitle,
  366. dealRemark: this.infolist.dealRemark,
  367. revertAttList: [],
  368. }
  369. if(this.activeName == '1'){
  370. params.sts = "2";
  371. params.stsDesc = "待处理";
  372. params.auditName = this.treeListonly.leaderAuditName;
  373. params.auditNo = this.treeListonly.leaderAuditNo;
  374. if(!this.treeListonly.leaderAuditName){
  375. this.$message({
  376. message: '请选择接单人!',
  377. type: 'error'
  378. });
  379. return
  380. }
  381. }else if(this.activeName == '2'){
  382. params.sts = "0";
  383. params.stsDesc = "待审核";
  384. params.leaderAuditName = this.treeListonly.leaderAuditName;
  385. params.leaderAuditNo = this.treeListonly.leaderAuditNo;
  386. if(!this.treeListonly.leaderAuditName){
  387. this.$message({
  388. message: '请选择接单人!',
  389. type: 'error'
  390. });
  391. return
  392. }
  393. }else if(this.activeName == '3'){
  394. params.sts = "1";
  395. params.stsDesc = "已处理";
  396. }
  397. let attList = [];
  398. for (let i = 0; i < this.attList.length; i++) {
  399. attList.push({
  400. id: this.attList[i].id,
  401. fileCode: this.attList[i].fileCode,
  402. fileName: this.attList[i].fileName,
  403. opName: this.attList[i].opName,
  404. opNo: this.attList[i].opNo,
  405. opTime: this.attList[i].opTime,
  406. type: this.attList[i].type,
  407. noticeId: this.infolist.noticeId
  408. });
  409. }
  410. params.revertAttList = attList;
  411. params.stepSts = this.activeName;
  412. if (this.infolist.type == 1) {
  413. params.msgType = this.infolist.msgType;
  414. params.msgTypeName = this.infolist.msgTypeName;
  415. params.msgInfo = this.infolist.dealTypeDesc;
  416. params.msgTital = this.infolist.woTitle;
  417. this.submitInfo("/market/cwo/recRptInfo", params);
  418. } else {
  419. this.submitInfo("/market/cwo/recWoInfo", params);
  420. }
  421. }
  422. },
  423. submitInfo(u, v) {
  424. let _this = this;
  425. this.$refs.infolist.validate(valid => {
  426. if (valid) {
  427. this.loadinged = true;
  428. this.$http({
  429. url: u,
  430. method: "post",
  431. headers: {
  432. "Content-Type": "application/json",
  433. },
  434. data: v,
  435. }).then((res) => {
  436. this.loadinged = false;
  437. if (res.data.result === 1) {
  438. _this.$message({
  439. message: res.data.desc,
  440. type: 'error'
  441. });
  442. } else {
  443. _this.$message({
  444. message: '成功',
  445. type: 'success'
  446. });
  447. _this.infolist = {};
  448. _this.dialogStatus = false;
  449. _this.getList({}, _this.pageSize);
  450. _this.defaultList = [];
  451. _this.depttype = 0;
  452. }
  453. })
  454. }
  455. })
  456. },
  457. dialoginfoCli(v) {
  458. if (v == 1) {
  459. this.historySts = !this.historySts;
  460. } else if (v == 2) {
  461. this.dialogInfo = false;
  462. this.dialogStatus = true;
  463. this.historySts = false;
  464. this.titname = '修改';
  465. } else if (v == 3) {
  466. this.dialogInfo = false;
  467. this.historySts = false;
  468. this.infolist = {};
  469. }
  470. },
  471. //文件返回值
  472. uploadBack(v) {
  473. this.attList = v;
  474. },
  475. //功能栏
  476. iconCli(v) {
  477. if (v === 1) {
  478. this.getList(this.params, this.pageSize);
  479. }
  480. if (v === 2) {
  481. this.fullscreen = !this.fullscreen
  482. }
  483. },
  484. getUser() {
  485. this.userInfo = JSON.parse(window.sessionStorage.userInfo);
  486. },
  487. getType() {
  488. this.$http({
  489. url: "/market/qatype/queryPage",
  490. method: "post",
  491. headers: {
  492. "Content-Type": "application/json",
  493. "page": '{"pageNo":"' + 1 + '","pageSize":"100"}'
  494. },
  495. data: {},
  496. }).then((res) => {
  497. this.typelist = res.data.data;
  498. });
  499. },
  500. changemsgType() {
  501. for (let i = 0; i < this.typelist.length; i++) {
  502. if (this.infolist.msgType === this.typelist[i].id) {
  503. this.infolist.msgTypeName = this.typelist[i].msgType;
  504. }
  505. }
  506. },
  507. },
  508. mounted() {
  509. this.getList({}, 1);
  510. this.getUser();
  511. this.getType();
  512. if (this.$route.query.id) {
  513. let params = {
  514. woNo: this.$route.query.id + ''
  515. }
  516. this.dialogCheck(this.$route.query.type, params);
  517. }
  518. },
  519. created() {
  520. }
  521. }
  522. </script>
  523. <style scoped lang="scss">
  524. .onetab {
  525. margin-bottom: 20px;
  526. padding: 0 20px;
  527. }
  528. .titbox {
  529. div {
  530. float: right;
  531. i {
  532. font-size: 22px;
  533. margin-left: 20px;
  534. cursor: pointer;
  535. }
  536. }
  537. }
  538. .tabbox {
  539. margin-top: 15px;
  540. }
  541. .pageBox {
  542. text-align: right;
  543. margin-top: 10px;
  544. }
  545. .info-line {
  546. width: 100%;
  547. display: block;
  548. padding-left: 20px;
  549. div {
  550. width: 50%;
  551. display: inline-block;
  552. }
  553. span {
  554. width: 80px;
  555. display: inline-block;
  556. text-align: left;
  557. i {
  558. color: red;
  559. display: inline-block;
  560. padding-right: 5px;
  561. }
  562. }
  563. .el-select,
  564. .el-input {
  565. width: calc(100% - 100px);
  566. }
  567. }
  568. .online {
  569. width: 100%;
  570. .el-select {
  571. width: calc(100% - 100px);
  572. }
  573. span {
  574. vertical-align: top;
  575. }
  576. .el-textarea {
  577. width: calc(100% - 100px);
  578. }
  579. .tree {
  580. width: calc(50% - 60px);
  581. display: inline-block;
  582. margin-right: 20px;
  583. height: 300px;
  584. overflow-y: scroll;
  585. }
  586. .treeUser {
  587. margin: 0;
  588. border: 1px solid #ddd;
  589. p {
  590. background: #f4f4f4;
  591. padding: 0 20px;
  592. margin-bottom: 5px;
  593. }
  594. }
  595. .treeUserb {
  596. width: calc(100% - 100px);
  597. border: 1px solid #ddd;
  598. background: #f4f4f4;
  599. border-radius: 3px;
  600. height: auto;
  601. overflow: hidden;
  602. p {
  603. display: inline-block;
  604. padding: 0 20px;
  605. margin-bottom: 5px;
  606. }
  607. }
  608. }
  609. </style>