haveInHand.vue 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734
  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="woName" label="名称">
  12. </el-table-column>
  13. <el-table-column prop="supplierCode" label="统计周期">
  14. <template slot-scope="scope">
  15. <span>{{scope.row.startTime}} - {{scope.row.endTime}}</span>
  16. </template>
  17. </el-table-column>
  18. <el-table-column prop="contractName" label="填报范围">
  19. <template slot-scope="scope">
  20. <span @click="jumpfw(scope.row)" style="color: #007AFF;cursor: pointer;">{{scope.row.fillName}}</span>
  21. </template>
  22. </el-table-column>
  23. <el-table-column prop="frameSum" label="分发范围">
  24. <template slot-scope="scope">
  25. <span @click="jumpjd(scope.row)" style="color: #007AFF;cursor:pointer;">{{scope.row.groupName}}</span>
  26. </template>
  27. </el-table-column>
  28. <el-table-column prop="dutyName" label="分发负责人">
  29. </el-table-column>
  30. <el-table-column prop="initiatorName" label="发起人">
  31. </el-table-column>
  32. <el-table-column label="操作" width="160px" align="center">
  33. <template slot-scope="scope">
  34. <el-button size="mini" type="primary" @click="dialogCheck(1,scope.row)"
  35. v-if="scope.row.stsDesc == '终止'">查看</el-button>
  36. <el-button size="mini" type="primary" @click="dialogCheck(2,scope.row)"
  37. v-if="scope.row.stsDesc != '终止'">设置</el-button>
  38. <el-button size="mini" type="danger" @click="delLine(scope.row)"
  39. v-if="companyFlag == 0 && scope.row.stsDesc != '终止'">中止</el-button>
  40. </template>
  41. </el-table-column>
  42. </el-table>
  43. <el-pagination class="pageBox" @current-change="currchange" layout="prev, pager, next" background
  44. :total="total">
  45. </el-pagination>
  46. </div>
  47. </div>
  48. <el-dialog :title="titname" :visible.sync="dialogStatus" width="50%" :destroy-on-close="true"
  49. :modal-append-to-body="false" :close-on-click-modal="false" :fullscreen="true">
  50. <el-form :model="infolist" ref="infolist" :rules="rules"
  51. style="height: calc(100vh - 180px);overflow-y: scroll;">
  52. <el-form-item prop="woName" class="info-line online">
  53. <span>统计名称</span>
  54. <el-input v-model="infolist.woName" placeholder="统计名称" :disabled="disableStatus"></el-input>
  55. </el-form-item>
  56. <el-form-item prop="time" class="info-line online">
  57. <span>统计周期</span>
  58. <el-date-picker v-model="infolist.time" type="daterange" :disabled="disableStatus"></el-date-picker>
  59. </el-form-item>
  60. <el-form-item prop="woName" class="info-line online" v-if="disableStatus">
  61. <span>填报人</span>
  62. <el-input v-model="infolist.fillName" type="textarea" :autosize="{ minRows: 1, maxRows: 10}"
  63. disabled></el-input>
  64. </el-form-item>
  65. <el-form-item prop="woName" class="info-line online" v-if="disableStatus">
  66. <span>负责人</span>
  67. <el-input v-model="infolist.dutyName" type="textarea" :autosize="{ minRows: 1, maxRows: 10}"
  68. disabled></el-input>
  69. </el-form-item>
  70. <el-form-item class="info-line online" v-if="!disableStatus">
  71. <span>填报人</span>
  72. <deptTree :closeList="closeList" class="tree" @treeCheck="treeCheck">
  73. </deptTree>
  74. <div class="tree treeUser">
  75. <p v-for="(item,index) in treeList" :key="index">{{item.receiveName}}
  76. <i @click="deletes(item,index)" class="el-icon-error"></i>
  77. </p>
  78. </div>
  79. </el-form-item>
  80. <div v-if="!disableStatus">
  81. <el-form-item class="info-line online" v-if="this.companyFlag != 2">
  82. <span>负责人</span>
  83. <div class="tree treeUser" style="width: 30%;margin-right: 1%;">
  84. <p v-for="(item,index) in deptList" :key="index" @click="choseDept(item)">{{item.ou}}</p>
  85. </div>
  86. <div class="tree treeUser" style="width: 30%;margin-right: 1%;">
  87. <p v-for="(item,index) in treeListp" :key="index">
  88. <span>{{item.ou}}</span>
  89. <span class="p-btn" @click="fzperson(item)">负责人</span>
  90. <i @click="deletest(item,index)" class="el-icon-error"></i>
  91. </p>
  92. </div>
  93. <div class="tree treeUser" style="width: 30%;">
  94. <p v-for="(item,index) in treeListp" :key="index">{{item.loginNameStr}}</p>
  95. </div>
  96. </el-form-item>
  97. </div>
  98. </el-form>
  99. <div style="text-align: right;margin-top: 20px">
  100. <el-button @click="dialogCli(1)" type="primary">确 定</el-button>
  101. <el-button @click="dialogCli(2)">取 消</el-button>
  102. </div>
  103. </el-dialog>
  104. <el-dialog title="选择负责人" :visible.sync="dialogStatusp" width="50%" :destroy-on-close="true"
  105. :modal-append-to-body="false" :close-on-click-modal="false">
  106. <el-form :model="infolist" ref="infolist" style="height: 50vh;overflow-y: scroll;">
  107. <div class="treeUserp">
  108. <p v-for="(item,index) in treeListponly" :key="index" @click="chofz(item)" v-if="item.loginNameStr">
  109. {{item.groupName}} -
  110. {{item.loginNameStr}}
  111. </p>
  112. </div>
  113. </el-form>
  114. </el-dialog>
  115. <myMessage :messTit='messTit' @closeMessage="closeMessage" :centerDialogVisible="centerDialogVisible"
  116. v-if="centerDialogVisible"></myMessage>
  117. </fullscreen>
  118. </template>
  119. <script>
  120. import mySearch from "../../../components/search.vue";
  121. import myMessage from "../../../components/myMessage.vue"
  122. import toolList from '../../../components/toolList'
  123. import deptTree from "../../../components/deptTreeUser.vue"
  124. import deptTreep from "../../../components/deptTreeP.vue"
  125. export default {
  126. components: {
  127. mySearch,
  128. myMessage,
  129. toolList,
  130. deptTree,
  131. deptTreep
  132. },
  133. data() {
  134. const supplierName = (rule, value, callback) => {
  135. if (!this.infolist.supplierName) {
  136. callback(new Error('不能为空'))
  137. } else {
  138. callback()
  139. }
  140. }
  141. return {
  142. rules: {
  143. supplierName: [{
  144. required: true,
  145. trigger: 'blur',
  146. validator: supplierName
  147. }],
  148. },
  149. searchList: [{
  150. type: 'input',
  151. tit: '名称',
  152. value: '',
  153. width: '98%',
  154. }],
  155. tooltit: '任务进度跟踪',
  156. fullscreen: false,
  157. total: 0,
  158. pageSize: 1,
  159. tableData: [{}],
  160. dialogStatus: false,
  161. disableStatus: false,
  162. titname: '',
  163. infolist: {},
  164. userInfo: {},
  165. params: {},
  166. centerDialogVisible: false,
  167. messTit: '',
  168. delid: '',
  169. loading: false,
  170. loadinged: false,
  171. treeList: [],
  172. treeListp: [],
  173. treeListponly: [],
  174. closeList: [],
  175. defaultList: [],
  176. depttype: 0,
  177. fadept: {},
  178. deptList: [],
  179. companyFlag: '',
  180. dialogStatusp: false,
  181. choone: {}
  182. }
  183. },
  184. methods: {
  185. dialogCli(v) {
  186. let _this = this;
  187. if (this.titname == '查看') {
  188. v = 2;
  189. }
  190. if (v === 1) {
  191. let param = {};
  192. param = this.infolist;
  193. param.time ? param.startTime = this.$formatDate(param.time[0], "YYYY-MM-DD") : '';
  194. param.time ? param.endTime = this.$formatDate(param.time[1], "YYYY-MM-DD") : '';
  195. param.dutyList = [];
  196. for (let i = 0; i < this.treeListp.length; i++) {
  197. if(this.treeListp[i].loginNoStr){
  198. param.dutyList.push({
  199. dutyNo: this.treeListp[i].loginNoStr,
  200. dutyName: this.treeListp[i].loginNameStr,
  201. groupId: this.treeListp[i].o,
  202. groupName: this.treeListp[i].ou,
  203. })
  204. }
  205. }
  206. param.fillList = [];
  207. for (let i = 0; i < this.treeList.length; i++) {
  208. param.fillList.push({
  209. fillNo: this.treeList[i].receiveNo,
  210. fillName: this.treeList[i].label,
  211. })
  212. }
  213. // for (let i = 0; i < this.treeList.length; i++) {
  214. // for (let ii = 0; ii < this.treeListp.length; ii++) {
  215. // console.log(this.treeList);
  216. // if (this.treeListp[i].loginNoStr == this.treeList[ii].receiveNo) {
  217. // this.$message({
  218. // message: '负责人和填报人重复!',
  219. // type: 'error'
  220. // });
  221. // return
  222. // }
  223. // }
  224. // }
  225. var end_flag=false;
  226. this.treeList.forEach(item=>{
  227. this.treeListp.forEach(n=>{
  228. if(n.loginNoStr == item.receiveNo){
  229. this.$message({
  230. message: '负责人和填报人重复!',
  231. type: 'error'
  232. });
  233. end_flag=true;
  234. }
  235. })
  236. })
  237. if(end_flag)return;
  238. let url = '';
  239. if (this.companyFlag == 0) {
  240. url = '/market/cMemberWo/saveMkMemberWoByProv';
  241. } else if (this.companyFlag == 1) {
  242. url = '/market/cMemberWo/saveMkMemberWoByRegion';
  243. // param.initiatorName = this.choone.receiverName;
  244. // param.initiatorNo = this.choone.receiverNo;
  245. } else if (this.companyFlag == 2) {
  246. url = '/market/cMemberWo/saveMkMemberWoByArea';
  247. // param.initiatorName = this.choone.receiverName;
  248. // param.initiatorNo = this.choone.receiverNo;
  249. }
  250. this.$http({
  251. url: url,
  252. method: "post",
  253. headers: {
  254. "Content-Type": "application/json",
  255. },
  256. data: param,
  257. }).then((res) => {
  258. if (res.data.result === 1) {
  259. _this.$message({
  260. message: res.data.desc,
  261. type: 'error'
  262. });
  263. } else {
  264. _this.$message({
  265. message: '成功',
  266. type: 'success'
  267. });
  268. _this.infolist = {};
  269. _this.treeList = [];
  270. _this.treeListp = [];
  271. _this.dialogStatus = false;
  272. _this.getList({}, 1);
  273. }
  274. });
  275. } else if (v === 2) {
  276. this.infolist = {};
  277. this.treeList = [];
  278. this.treeListp = [];
  279. this.dialogStatus = false;
  280. }
  281. },
  282. chofz(v) {
  283. this.dialogStatusp = false;
  284. for (let i = 0; i < this.treeListp.length; i++) {
  285. if (this.treeListp[i].o == this.fadept.o) {
  286. this.treeListp[i].loginNameStr = v.loginNameStr;
  287. this.treeListp[i].loginNoStr = v.loginNoStr;
  288. }
  289. }
  290. },
  291. fzperson(v) {
  292. this.fadept= v;
  293. this.dialogStatusp = true;
  294. this.$http({
  295. url: "/sysmgr/sysuserinfo/queryList",
  296. method: "post",
  297. headers: {
  298. "Content-Type": "application/json",
  299. },
  300. data: {
  301. groupId: v.o,
  302. },
  303. }).then((res) => {
  304. this.treeListponly = res.data;
  305. });
  306. this.$http({
  307. url: "/sysmgr/csysdept/queryRegionDeptList",
  308. method: "post",
  309. headers: {
  310. "Content-Type": "application/json",
  311. },
  312. data: {
  313. parentorgid: v.o,
  314. },
  315. }).then((res) => {
  316. res.data.forEach(item=>{
  317. this.$http({
  318. url: "/sysmgr/sysuserinfo/queryList",
  319. method: "post",
  320. headers: {
  321. "Content-Type": "application/json",
  322. },
  323. data: {
  324. groupId: item.o,
  325. },
  326. }).then((ress) => {
  327. this.treeListponly.push({bumen:item.ou})
  328. this.treeListponly=this.treeListponly.concat(ress.data);
  329. });
  330. })
  331. });
  332. },
  333. deletes(val, index) {
  334. this.treeList.splice(index, 1);
  335. this.closeList = this.treeList;
  336. },
  337. deletest(val, index) {
  338. this.treeListp.splice(index, 1);
  339. },
  340. treeCheck(v) {
  341. this.treeList = v;
  342. },
  343. choseDept(v) {
  344. let x = 'no';
  345. for (let i = 0; i < this.treeListp.length; i++) {
  346. if (this.treeListp[i].o == v.o) {
  347. x = i;
  348. }
  349. }
  350. if (x != 'no') {
  351. this.treeListp.splice(x, 1)
  352. } else {
  353. this.treeListp.push(v);
  354. // console.log(this.treeListp)
  355. }
  356. },
  357. jumpfw(v) {
  358. this.$router.push({
  359. path: "/reportProgress",
  360. query: {
  361. woNo: v.woNo
  362. }
  363. });
  364. this.setabList("填报进度跟踪", "/reportProgress?woNo=" + v.woNo);
  365. },
  366. jumpjd(v) {
  367. console.log(v.receiverGroupName)
  368. this.$router.push({
  369. path: "/speedOfProgress",
  370. query: {
  371. receiverGroupName: v.receiverGroupName
  372. }
  373. });
  374. this.setabList("进度跟踪", "/speedOfProgress?groupName=" + v.receiverGroupName);
  375. },
  376. setabList(n, p) {
  377. let params = {
  378. children: "",
  379. name: n,
  380. rountPath: p,
  381. target: "_self",
  382. };
  383. for (let i = 0; i < this.$store.state.tabList.length; i++) {
  384. if (this.$store.state.tabList[i].name === params.name) {
  385. this.$store.state.tabList[i] = params;
  386. }
  387. }
  388. let set = new Set([...this.$store.state.tabList, params]);
  389. set.add(params);
  390. this.$store.commit("setDefaultActive", params.rountPath);
  391. this.$store.commit("setTabList", Array.from(set));
  392. },
  393. closedia() {
  394. this.infolist = {};
  395. this.dialogStatus = false;
  396. },
  397. //搜索数据
  398. searchInfo(v) {
  399. this.params = {};
  400. v[0] ? this.params.woName = v[0] : '';
  401. this.getList(this.params, this.pageSize);
  402. },
  403. //获取列表
  404. getList(v, n) {
  405. this.pageSize = n;
  406. let _this = this;
  407. this.loading = true;
  408. this.tableData = [];
  409. let url = '';
  410. if (this.companyFlag == 0) {
  411. url = '/market/cMemberWo/queryProvTracePage';
  412. } else if (this.companyFlag == 1) {
  413. url = '/market/cMemberWo/queryRegionTracePage';
  414. } else if (this.companyFlag == 2) {
  415. url = '/market/cMemberWo/queryAreaTracePage';
  416. }
  417. v.sts = 0;
  418. this.$http({
  419. url: url,
  420. method: "post",
  421. headers: {
  422. "Content-Type": "application/json",
  423. "page": '{"pageNo":"' + n + '","pageSize":"10"}'
  424. },
  425. data: v,
  426. }).then((res) => {
  427. this.tableData = res.data.data;
  428. this.total = res.data.totalRecord;
  429. this.loading = false;
  430. });
  431. },
  432. // 分页
  433. currchange(v) {
  434. this.pageSize = v;
  435. this.getList(this.params, this.pageSize);
  436. },
  437. //申请
  438. dialogCheck(v, n) {
  439. this.choone = n;
  440. if (v === 1) {
  441. this.titname = '查看';
  442. this.disableStatus = true;
  443. } else if (v === 2) {
  444. this.titname = '修改';
  445. this.disableStatus = false;
  446. }
  447. this.dialogStatus = true;
  448. this.$http({
  449. url: "/market/cMemberWo/queryMemeberWoInfo",
  450. method: "post",
  451. headers: {
  452. "Content-Type": "application/json",
  453. },
  454. data: {
  455. woNo: n.woNo
  456. },
  457. }).then((res) => {
  458. this.infolist = res.data;
  459. this.infolist.time = [res.data.startTime, res.data.endTime];
  460. this.infolist.opNo = this.userInfo.loginNo;
  461. this.infolist.opName = this.userInfo.loginName;
  462. //地市范围
  463. if (this.companyFlag == '0') {
  464. this.$http({
  465. url: "/sysmgr/csysdept/queryRegionDeptList",
  466. method: "post",
  467. headers: {
  468. "Content-Type": "application/json",
  469. },
  470. data: {},
  471. }).then((res) => {
  472. this.deptList = res.data[0].children;
  473. });
  474. } else {
  475. this.$http({
  476. url: "/sysmgr/csysdept/queryListByParent",
  477. method: "post",
  478. headers: {
  479. "Content-Type": "application/json",
  480. },
  481. data: {
  482. parentorgid: n.receiverGroupId
  483. },
  484. }).then((res) => {
  485. this.deptList = res.data;
  486. });
  487. }
  488. //区县进入查人
  489. // if(this.companyFlag == '2'){
  490. // this.$http({
  491. // url: "/sysmgr/csysuserinfo/queryList",
  492. // method: "post",
  493. // headers: {
  494. // "Content-Type": "application/json",
  495. // },
  496. // data: {
  497. // groupId: n.receiverGroupId
  498. // },
  499. // }).then((res) => {
  500. // this.deptList = res.data;
  501. // });
  502. // }
  503. });
  504. },
  505. closeMessage(v) {
  506. this.centerDialogVisible = false;
  507. let _this = this;
  508. if (v === 1) {
  509. _this.$http({
  510. url: "/market/cMemberWo/endFillWo",
  511. method: "post",
  512. headers: {
  513. "Content-Type": "application/json",
  514. },
  515. data: {
  516. provWoNo: this.delid
  517. },
  518. }).then((res) => {
  519. if (res.data.result === 1) {
  520. _this.$message({
  521. message: res.data.desc,
  522. type: 'error'
  523. });
  524. } else {
  525. _this.$message({
  526. message: '中止成功',
  527. type: 'success'
  528. });
  529. _this.getList(this.params, this.pageSize);
  530. }
  531. });
  532. }
  533. },
  534. //删除
  535. delLine(v) {
  536. this.centerDialogVisible = true;
  537. this.messTit = '即将中止此条数据, 是否中止?';
  538. this.delid = v.woNo;
  539. },
  540. //文件返回值
  541. uploadBack(v) {
  542. console.log(v)
  543. },
  544. //功能栏
  545. iconCli(v) {
  546. if (v === 1) {
  547. this.getList(this.params, this.pageSize);
  548. }
  549. if (v === 2) {
  550. this.fullscreen = !this.fullscreen
  551. }
  552. },
  553. getUser() {
  554. this.userInfo = JSON.parse(window.sessionStorage.userInfo);
  555. this.$http({
  556. url: "/sysmgr/csysuserinfo/queryUserInfoByLoginNo",
  557. method: "post",
  558. headers: {
  559. "Content-Type": "application/json",
  560. },
  561. data: {},
  562. }).then((res) => {
  563. this.companyFlag = res.data.companyFlag;
  564. this.getList({}, 1);
  565. });
  566. }
  567. },
  568. mounted() {
  569. this.getUser();
  570. },
  571. created() {
  572. }
  573. }
  574. </script>
  575. <style scoped lang="scss">
  576. .onetab {
  577. margin-bottom: 20px;
  578. padding: 0 20px;
  579. }
  580. .titbox {
  581. div {
  582. float: right;
  583. i {
  584. font-size: 22px;
  585. margin-left: 20px;
  586. cursor: pointer;
  587. }
  588. }
  589. }
  590. .tabbox {
  591. margin-top: 15px;
  592. }
  593. .pageBox {
  594. text-align: right;
  595. margin-top: 10px;
  596. }
  597. .info-line {
  598. width: 100%;
  599. display: block;
  600. padding-left: 20px;
  601. div {
  602. width: 50%;
  603. display: inline-block;
  604. }
  605. span {
  606. width: 80px;
  607. display: inline-block;
  608. text-align: left;
  609. i {
  610. color: red;
  611. display: inline-block;
  612. padding-right: 5px;
  613. }
  614. }
  615. .el-select,
  616. .el-input {
  617. width: calc(100% - 100px);
  618. }
  619. .tree {
  620. width: calc(50% - 60px);
  621. display: inline-block;
  622. margin-right: 20px;
  623. height: 300px;
  624. overflow-y: scroll;
  625. p {
  626. overflow: hidden;
  627. display: flex;
  628. justify-content: space-between;
  629. }
  630. .p-btn {
  631. width: 50px !important;
  632. cursor: pointer;
  633. color: #0074DA;
  634. }
  635. span {
  636. display: inline-block;
  637. width: calc(100% - 100px);
  638. }
  639. .el-icon-error {
  640. float: right;
  641. font-size: 20px;
  642. margin-top: 9px;
  643. cursor: pointer;
  644. }
  645. }
  646. .treeUser {
  647. margin: 0;
  648. border: 1px solid #ddd;
  649. p {
  650. background: #f4f4f4;
  651. padding: 0 20px;
  652. margin-bottom: 5px;
  653. }
  654. }
  655. .treeUserb {
  656. width: calc(100% - 100px);
  657. border: 1px solid #ddd;
  658. background: #f4f4f4;
  659. border-radius: 3px;
  660. height: auto;
  661. overflow: hidden;
  662. p {
  663. display: inline-block;
  664. padding: 0 20px;
  665. margin-bottom: 5px;
  666. }
  667. }
  668. }
  669. .treeUserp {
  670. p {
  671. padding: 5px;
  672. }
  673. p:hover {
  674. background: #01BEF0;
  675. color: #fff;
  676. cursor: pointer;
  677. }
  678. }
  679. .online {
  680. width: 100%;
  681. .el-select {
  682. width: calc(100% - 100px);
  683. }
  684. span {
  685. vertical-align: top;
  686. }
  687. .el-textarea {
  688. width: calc(100% - 100px);
  689. }
  690. .el-date-editor {
  691. width: calc(100% - 100px);
  692. display: inline-flex;
  693. }
  694. }
  695. </style>