workersList.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482
  1. <template>
  2. <div class="workersList-container">
  3. <simple-form
  4. :form="table_form"
  5. :handle="table_handle"
  6. @search="handleSearch"
  7. @summary="handleVisible('summary')"
  8. @add="handleVisible('add')"
  9. >
  10. </simple-form>
  11. <simple-table
  12. :list="table_list"
  13. :config="table_config"
  14. :loading="table_loading"
  15. :multiple="true"
  16. :handle-row="table_handle_row"
  17. @selection="handleaaa"
  18. @check="handleCheck"
  19. @edit="handleEdit"
  20. ></simple-table>
  21. <simple-pagination
  22. :page="page"
  23. :total="total"
  24. @change="handleChange"
  25. ></simple-pagination>
  26. <simple-dialog
  27. :title="title"
  28. :fullscreen="true"
  29. @cancel="handleVisible('add')"
  30. :visible="add_visible"
  31. >
  32. <el-form
  33. label-width="120px"
  34. :model="add_form"
  35. ref="add_ref"
  36. >
  37. <el-form-item
  38. label="提出人"
  39. prop="proposer"
  40. :rules="{
  41. required: true,
  42. message: '提出人不能为空',
  43. trigger: 'blur',
  44. }"
  45. >
  46. <el-input v-model="add_form.proposer"></el-input>
  47. </el-form-item>
  48. <el-form-item
  49. label="联系电话"
  50. prop="telephone"
  51. :rules="{
  52. required: true,
  53. message: '联系电话不能为空',
  54. trigger: 'blur',
  55. }"
  56. >
  57. <el-input v-model="add_form.telephone"></el-input>
  58. </el-form-item>
  59. <el-form-item
  60. label="网格划分需求"
  61. prop="wanggeText"
  62. :rules="{
  63. required: true,
  64. message: '网格划分需求不能为空',
  65. trigger: 'blur',
  66. }"
  67. >
  68. <el-input
  69. type="textarea"
  70. v-model="add_form.wanggeText"
  71. ></el-input>
  72. </el-form-item>
  73. <el-form-item
  74. label="附件上传"
  75. prop="file"
  76. >
  77. <myUpload
  78. @uploadBack="uploadBack"
  79. :fileInfo="fileInfo"
  80. :fileList="fileInfo.fileList"
  81. ></myUpload>
  82. </el-form-item>
  83. <el-form-item
  84. label="审批轨迹"
  85. prop=""
  86. v-if="edit_visible"
  87. >
  88. <simple-table
  89. :list="table_list_approve"
  90. :config="table_config_approve"
  91. :loading="table_loading_approve"
  92. ></simple-table>
  93. </el-form-item>
  94. <el-form-item
  95. label="审批意见"
  96. prop="desc"
  97. v-if="edit_visible"
  98. >
  99. <el-input
  100. type="textarea"
  101. v-model="add_form.desc"
  102. ></el-input>
  103. </el-form-item>
  104. </el-form>
  105. <template v-slot:footer>
  106. <div v-if="!isCheck">
  107. <el-button
  108. @click="handleSubmit"
  109. type="primary"
  110. >保存</el-button>
  111. <el-button
  112. @click="handleVisible('add')"
  113. type="default"
  114. >取消</el-button>
  115. </div>
  116. <div v-else></div>
  117. </template>
  118. </simple-dialog>
  119. <simple-dialog
  120. title="工单汇总"
  121. width="40%"
  122. @cancel="handleVisible('summary')"
  123. @confirm="handleSummary"
  124. :visible="summary_visible"
  125. >
  126. <div class="summary">
  127. <p>是否要对所选工单进行汇总?</p>
  128. <p class="summary-tip">可对未审批的区县网格划分审批工单合并为同一条工单,由相关审批人员进行审批,减少审批工作量</p>
  129. </div>
  130. </simple-dialog>
  131. </div>
  132. </template>
  133. <script>
  134. import myUpload from "../../../components/upload";
  135. import simpleForm from "./components/form.vue";
  136. import simpleTable from "./components/table.vue";
  137. import simpleDialog from "./components/dialog.vue";
  138. import simplePagination from "./components/pagination.vue";
  139. export default {
  140. components: {
  141. simpleForm,
  142. simpleDialog,
  143. myUpload,
  144. simpleTable,
  145. simplePagination,
  146. },
  147. data() {
  148. return {
  149. fileInfo: {
  150. limit: 3,
  151. url: "mkWangge/upload",
  152. fileList: [],
  153. },
  154. attList: [],
  155. page: 1,
  156. rows: 10,
  157. total: 0,
  158. // 模态框标题
  159. title: "",
  160. // 是否为查看状态
  161. isCheck: false,
  162. table_search: {},
  163. // 新建模态框
  164. add_visible: false,
  165. summary_visible: false,
  166. edit_visible: false,
  167. add_form: {},
  168. table_handle: [
  169. {
  170. label: "工单汇总",
  171. props: "summary",
  172. },
  173. {
  174. label: "新建",
  175. props: "add",
  176. },
  177. ],
  178. table_form: [
  179. {
  180. label: "公司名称",
  181. props: "companyName",
  182. type: "input",
  183. },
  184. {
  185. label: "状态",
  186. props: "approve",
  187. type: "select",
  188. // 0.待办 1.已办
  189. dictionary: [
  190. {
  191. label: "待办",
  192. value: "0",
  193. },
  194. {
  195. label: "已办",
  196. value: "1",
  197. },
  198. ],
  199. },
  200. ],
  201. // 列表数据
  202. table_list: [
  203. {
  204. id: 1,
  205. companyName: "xq",
  206. proposer: "mll",
  207. createTime: 1654563154824,
  208. status: 0,
  209. },
  210. {
  211. id: 2,
  212. companyName: "xq",
  213. proposer: "mll",
  214. createTime: 1654963568455,
  215. status: 1,
  216. },
  217. ],
  218. table_loading: false,
  219. // 表格里的操作按钮
  220. table_handle_row: [
  221. {
  222. label: "查看",
  223. props: "check",
  224. },
  225. {
  226. label: "处理",
  227. props: "edit",
  228. // visible: {
  229. // status: [1],
  230. // },
  231. },
  232. ],
  233. // 表头配置
  234. table_config: [
  235. {
  236. label: "序号",
  237. props: "id",
  238. },
  239. {
  240. label: "公司名称",
  241. props: "companyName",
  242. },
  243. {
  244. label: "发起人",
  245. props: "proposer",
  246. },
  247. {
  248. label: "发起时间",
  249. props: "createTime",
  250. type: "date",
  251. },
  252. {
  253. label: "状态",
  254. props: "status",
  255. type: "dictionary",
  256. dictionary: { 0: "待办", 1: "已办" },
  257. },
  258. ],
  259. // 模态框内表数据
  260. table_list_approve: [],
  261. table_loading_approve: false,
  262. // 模态框内表头配置
  263. table_config_approve: [
  264. {
  265. label: "编号",
  266. props: "number",
  267. },
  268. {
  269. label: "流程环节",
  270. props: "cpmName",
  271. },
  272. {
  273. label: "处理人",
  274. props: "person",
  275. },
  276. {
  277. label: "处理工号",
  278. props: "number",
  279. },
  280. {
  281. label: "处理时间",
  282. props: "createTime",
  283. type: "date",
  284. },
  285. {
  286. label: "审批意见",
  287. props: "status",
  288. type: "dictionary",
  289. dictionary: { 0: "同意", 1: "不同意" },
  290. },
  291. ],
  292. };
  293. },
  294. mounted() {
  295. this.handleInit({
  296. ...this.table_search,
  297. type: "0",
  298. page: this.page,
  299. pageSize: this.rows,
  300. });
  301. },
  302. methods: {
  303. // 表格数据初始化
  304. handleInit(data) {
  305. // this.table_loading = true;
  306. // console.log(data);
  307. this.$http({
  308. url: "/mkWangge/queryPage",
  309. method: "post",
  310. headers: {
  311. "Content-Type": "application/json",
  312. },
  313. data: data,
  314. }).then(({ data: { count, data } }) => {
  315. this.table_loading = false;
  316. this.total = count;
  317. this.table_list = data || [];
  318. console.log(data);
  319. });
  320. },
  321. // 搜索事件
  322. handleSearch(data) {
  323. this.table_search = data;
  324. this.page = 1;
  325. this.handleInit({
  326. ...data,
  327. type: "0",
  328. page: this.page,
  329. pageSize: this.rows,
  330. });
  331. },
  332. handleVisible(props) {
  333. switch (props) {
  334. case "add":
  335. this.add_visible = !this.add_visible;
  336. this.edit_visible = false;
  337. this.title = "新建";
  338. this.isCheck = false;
  339. this.add_form = {};
  340. break;
  341. case "summary":
  342. this.summary_visible = !this.summary_visible;
  343. break;
  344. case "edit":
  345. this.edit_visible = !this.edit_visible;
  346. this.add_visible = !this.add_visible;
  347. this.title = "发起人处理";
  348. this.isCheck = false;
  349. break;
  350. case "check":
  351. this.edit_visible = !this.edit_visible;
  352. this.add_visible = !this.add_visible;
  353. this.title = "查看";
  354. this.isCheck = true;
  355. break;
  356. }
  357. },
  358. handleaaa(val) {
  359. console.log(val);
  360. },
  361. //文件返回值
  362. uploadBack(v) {
  363. console.log(v);
  364. this.attList = v;
  365. },
  366. // 查看按钮
  367. handleCheck(row) {
  368. let id = row.id;
  369. this.handleVisible('check')
  370. this.$http({
  371. url: "/mkWangge/getMkWanggeById",
  372. method: "get",
  373. headers: {
  374. "Content-Type": "application/json",
  375. },
  376. params:{
  377. id
  378. }
  379. }).then(({data})=>{
  380. console.log(data);
  381. this.add_form = {
  382. id: data.id,
  383. proposer: data.proposer,
  384. telephone: data.telephone,
  385. wanggeText: data.wanggeText,
  386. }
  387. })
  388. },
  389. // 编辑按钮
  390. handleEdit(row) {
  391. let id = row.id;
  392. this.handleVisible('edit')
  393. this.$http({
  394. url: "/mkWangge/getMkWanggeById",
  395. method: "get",
  396. headers: {
  397. "Content-Type": "application/json",
  398. },
  399. params:{
  400. id
  401. }
  402. }).then(({data})=>{
  403. console.log(data);
  404. this.add_form = {
  405. id: data.id,
  406. proposer: data.proposer,
  407. telephone: data.telephone,
  408. wanggeText: data.wanggeText,
  409. }
  410. })
  411. },
  412. handleSubmit() {
  413. console.log(this.add_form);
  414. // let _this = this;
  415. this.$refs.add_ref.validate((valid) => {
  416. if (valid) {
  417. let reqdata = [{ ...this.add_form, processId: "729294602773110788" }];
  418. this.$http({
  419. url: "/mkWangge/saveOrUpdateList",
  420. method: "post",
  421. headers: {
  422. "Content-Type": "application/json",
  423. },
  424. data: reqdata,
  425. }).then((res) => {
  426. console.log(res);
  427. });
  428. this.handleInit({
  429. ...this.table_search,
  430. page: this.page,
  431. pageSize: this.rows,
  432. });
  433. this.edit_visible = false;
  434. this.add_visible = false;
  435. }
  436. });
  437. },
  438. handleSummary() {},
  439. handleChange(page) {
  440. this.page = page;
  441. this.handleInit({
  442. ...this.table_search,
  443. type: "0",
  444. page: this.page,
  445. pageSize: this.rows,
  446. });
  447. },
  448. },
  449. };
  450. </script>
  451. <style lang="scss" scoped>
  452. .workersList-container {
  453. background: #ffffff;
  454. padding: 0 20px;
  455. margin: 15px;
  456. overflow: auto;
  457. width: calc(100% - 30px);
  458. max-width: calc(100% - 30px);
  459. height: 100%;
  460. overflow-x: hidden;
  461. }
  462. .simple-container .el-form-item {
  463. padding-bottom: 22px;
  464. }
  465. .summary {
  466. padding: 20px 50px 100px;
  467. font-size: 16px;
  468. .summary-tip {
  469. color: #7f7f7f;
  470. padding-top: 30px;
  471. }
  472. }
  473. ::v-deep .el-row {
  474. padding-top: 12px;
  475. padding-bottom: 12px;
  476. }
  477. </style>