issue.vue 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297
  1. <template>
  2. <div>
  3. <div class="simple-container">
  4. <simple-form
  5. :form="table_form"
  6. @search="handleSearch"
  7. ></simple-form>
  8. <simple-table
  9. :list="table_list"
  10. :config="table_config"
  11. :loading="table_loading"
  12. :handle-row="table_handle_row"
  13. @principalName="
  14. (params) => handleVisible('principalName', params)
  15. "
  16. @detail="(params) => handleVisible('detail', params)"
  17. @withdraw="handleWithdraw"
  18. @edit="(params) => handleVisible('edit', params)"
  19. ></simple-table>
  20. <simple-pagination
  21. :page="page"
  22. :total="total"
  23. @change="handleChange"
  24. ></simple-pagination>
  25. </div>
  26. <simple-dialog
  27. title="查看"
  28. fullscreen
  29. @cancel="handleVisible('template')"
  30. @confirm="handleVisible('template')"
  31. :visible="template_visible"
  32. >
  33. <!-- <div class="flex-justify-align-end padding-right-20 padding-left-20">
  34. <div>
  35. <el-button type="primary">导出</el-button>
  36. <el-button @click="handleVisible('template')" type="primary"
  37. >返回</el-button
  38. >
  39. </div>
  40. </div> -->
  41. <simpleSheet
  42. v-if="template_visible && isCheck"
  43. :id="edit_rows.id"
  44. attribute="order"
  45. />
  46. <!-- 目前不支持 下发的编辑 -->
  47. <!-- <simpleSheet
  48. v-if="template_visible && !isCheck"
  49. :id="edit_rows.id"
  50. attribute="order"
  51. type="edit"
  52. /> -->
  53. <template v-slot:footer><div></div></template>
  54. </simple-dialog>
  55. <!-- <simple-dialog
  56. title="回复详情"
  57. width="700px"
  58. @cancel="handleVisible('principalName')"
  59. @confirm="handleVisible('principalName')"
  60. :visible="receiver_visible"
  61. >
  62. <simple-table
  63. :list="receiver_table_list"
  64. :config="receiver_table_config"
  65. :loading="receiver_table_loading"
  66. @receiver="handleVisible('principalName')"
  67. ></simple-table>
  68. </simple-dialog> -->
  69. </div>
  70. </template>
  71. <script>
  72. // import analysis from "./analysis.vue";
  73. import simpleForm from "./components/form.vue";
  74. import simpleTable from "./components/table.vue";
  75. import simpleDialog from "./components/dialog.vue";
  76. import simplePagination from "./components/pagination.vue";
  77. import simpleSheet from "./components/sheet.vue";
  78. export default {
  79. components: {
  80. // analysis,
  81. simpleTable,
  82. simpleDialog,
  83. simpleForm,
  84. simplePagination,
  85. simpleSheet,
  86. },
  87. data() {
  88. return {
  89. page: 1,
  90. rows: 10,
  91. total: 0,
  92. edit_rows: {},
  93. isCheck: false,
  94. template_visible: false,
  95. receiver_visible: false,
  96. table_loading: false,
  97. receiver_table_loading: false,
  98. table_search: {},
  99. table_form: [
  100. {
  101. label: "模板名称",
  102. props: "templateName",
  103. type: "input",
  104. },
  105. {
  106. label: "截止日期",
  107. props: "endTime",
  108. type: "date",
  109. },
  110. ],
  111. table_list: [],
  112. table_handle_row: [
  113. {
  114. label: "查看",
  115. props: "detail",
  116. },
  117. // {
  118. // label: "修改",
  119. // props: "edit",
  120. // },
  121. {
  122. label: "撤回",
  123. props: "withdraw",
  124. popconfirm: true,
  125. },
  126. ],
  127. table_config: [
  128. {
  129. label: "模板名称",
  130. props: "templateName",
  131. },
  132. {
  133. label: "填报事由",
  134. props: "reason",
  135. },
  136. {
  137. label: "填报注意事项",
  138. props: "precautions",
  139. },
  140. {
  141. label: "截止时间",
  142. props: "endTime",
  143. type: "date",
  144. },
  145. {
  146. label: "接收人",
  147. props: "principalName",
  148. type: "click",
  149. },
  150. ],
  151. receiver_table_list: [
  152. {
  153. receiver: "接收人",
  154. department: "科室",
  155. date: "回复时间",
  156. value: "2021.11.4 XXX 同意\n2021.11.4 XXX 同意",
  157. },
  158. ],
  159. receiver_table_config: [
  160. {
  161. label: "接收人",
  162. props: "receiver",
  163. },
  164. {
  165. label: "科室",
  166. props: "department",
  167. },
  168. {
  169. label: "回复时间",
  170. props: "date",
  171. },
  172. {
  173. label: "审批记录",
  174. props: "value",
  175. type: "textarea",
  176. },
  177. ],
  178. };
  179. },
  180. methods: {
  181. async handleInit(data) {
  182. this.$http({
  183. url: "/market/CMKIssued/CMKIssuedList",
  184. method: "post",
  185. headers: {
  186. "Content-Type": "application/json",
  187. },
  188. data: {
  189. ...data,
  190. endTime:
  191. data.endTime &&
  192. this.$formatDate(data.endTime, "YYYY-MM-DD"),
  193. },
  194. }).then(({ data: { data, count } }) => {
  195. this.total = count;
  196. this.table_list = data;
  197. });
  198. // this.table_loading = true;
  199. // const data = [];
  200. // let index = 0;
  201. // while (index < 1) {
  202. // data.push(
  203. // ...JSON.parse(sessionStorage.getItem("global_data")).filter(
  204. // (element) => element.issue_status
  205. // )
  206. // );
  207. // index = index + 1;
  208. // }
  209. // this.total = index;
  210. // this.table_list = data;
  211. // this.table_loading = false;
  212. },
  213. handleSearch(data) {
  214. this.table_search = data;
  215. this.handleReset();
  216. this.handleInit({ ...data, page: this.page, pageSize: this.rows });
  217. },
  218. handleChange(page) {
  219. this.page = page;
  220. this.handleInit({
  221. ...this.table_search,
  222. page: this.page,
  223. pageSize: this.rows,
  224. });
  225. },
  226. handleVisible(props, params) {
  227. switch (props) {
  228. case "detail":
  229. if (params) {
  230. this.isCheck = true;
  231. this.edit_rows = params;
  232. this.template_visible = true;
  233. } else {
  234. this.isCheck = false;
  235. this.template_visible = false;
  236. }
  237. // this.template_visible = !this.template_visible;
  238. break;
  239. case "edit":
  240. if (params) {
  241. this.isCheck = false;
  242. this.edit_rows = params;
  243. this.template_visible = true;
  244. } else {
  245. this.template_visible = false;
  246. }
  247. // this.template_visible = !this.template_visible;
  248. break;
  249. case "template":
  250. this.template_visible = false;
  251. // this.template_visible = !this.template_visible;
  252. break;
  253. case "principalName":
  254. if (params) {
  255. console.log(params);
  256. }
  257. this.receiver_visible = !this.receiver_visible;
  258. break;
  259. }
  260. },
  261. handleReset() {
  262. this.page = 1;
  263. },
  264. handleWithdraw({ id }) {
  265. this.$http({
  266. url: "/market/CMKIssued/CMKDelIssuedById",
  267. method: "post",
  268. headers: {
  269. "Content-Type": "application/json",
  270. },
  271. data: { id },
  272. }).then(({ data }) => {
  273. console.log(data);
  274. if (data.desc === "删除成功") {
  275. this.$message.success("撤回成功");
  276. this.handleInit({
  277. ...this.table_search,
  278. page: this.page,
  279. pageSize: this.rows,
  280. });
  281. }
  282. });
  283. },
  284. },
  285. mounted() {
  286. this.handleInit({
  287. ...this.table_search,
  288. page: this.page,
  289. pageSize: this.rows,
  290. });
  291. },
  292. };
  293. </script>
  294. <style></style>