dialog.select.point.vue 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  1. <template>
  2. <DialogCom
  3. title="选择履职内容"
  4. :visible.sync="isShow"
  5. class="g-dialog-select-safe-check"
  6. width="55%"
  7. top="10vh"
  8. append-to-body
  9. @close="closed"
  10. >
  11. <div class="el-dialog-div">
  12. <g-search-table
  13. ref="st"
  14. url="/core/resumption/ruleItem/pointSelectionPage"
  15. method="get"
  16. :search-data="search"
  17. :manual="true"
  18. :pageable="true"
  19. :select="true"
  20. :select-default="selectList"
  21. :drag="false"
  22. @select="onSelect"
  23. >
  24. <!-- 搜索 -->
  25. <template slot="searchs">
  26. <el-form-item prop="key" label="关键字">
  27. <el-input
  28. v-model="search.key"
  29. maxlength="50"
  30. placeholder="请输入履职项或履职内容"
  31. ></el-input>
  32. </el-form-item>
  33. <el-form-item prop="ruleId" label="履职手册">
  34. <el-select v-model="search.ruleId">
  35. <el-option
  36. v-for="item in ruleList"
  37. :value="item.id"
  38. :key="item.id"
  39. :label="item.name"
  40. ></el-option>
  41. </el-select>
  42. </el-form-item>
  43. </template>
  44. <!-- 表格 -->
  45. <template slot="columns">
  46. <el-table-column
  47. align="center"
  48. prop="itemName"
  49. label="履职项"
  50. min-width="40%"
  51. ></el-table-column>
  52. <el-table-column
  53. align="center"
  54. label="履职内容"
  55. prop="pointName"
  56. min-width="40%"
  57. >
  58. <template slot-scope="scope">
  59. <div style="white-space: pre-wrap">{{ scope.row.pointName }}</div>
  60. </template>
  61. </el-table-column>
  62. <el-table-column
  63. align="center"
  64. prop="areaName"
  65. label="履职区域"
  66. min-width="20%"
  67. ></el-table-column>
  68. <el-table-column
  69. align="center"
  70. prop="checkName"
  71. label="履职点位"
  72. min-width="20%"
  73. ></el-table-column>
  74. <!-- <el-table-column align="center" prop="nfcName"
  75. label="采集点"
  76. width="120"></el-table-column>-->
  77. </template>
  78. </g-search-table>
  79. </div>
  80. <div slot="footer" class="dialog-footer">
  81. <el-button type="primary" @click="onSubmit">确定</el-button>
  82. <el-button @click="onHide">关闭</el-button>
  83. </div>
  84. </DialogCom>
  85. </template>
  86. <script>
  87. import GSearchTable from "@/components/table/gx.search.table.vue";
  88. import { ruleListForOrg } from "@/api/resumption/rule.js";
  89. export default {
  90. components: { GSearchTable },
  91. data() {
  92. return {
  93. isShow: false,
  94. prevOrgType: null,
  95. selectList: [],
  96. ruleList: [],
  97. search: this.emptySearch(),
  98. };
  99. },
  100. computed: {},
  101. watch: {
  102. search: {
  103. deep: true,
  104. handler(v) {
  105. if (v.ruleId) {
  106. this.$refs.st.search();
  107. }
  108. },
  109. },
  110. },
  111. props: {
  112. // defaultSelect:{
  113. // type:Array
  114. // },
  115. orgType: {
  116. type: String,
  117. },
  118. },
  119. methods: {
  120. show(defaultSelect) {
  121. if (this.orgType == null) {
  122. this.prevOrgType = this.orgType;
  123. this.$modal.alert("请选择机构类型");
  124. return;
  125. }
  126. this.isShow = true;
  127. if (defaultSelect && defaultSelect.map) {
  128. this.selectList = defaultSelect.map((s) => ({ id: s }));
  129. }
  130. if (this.prevOrgType == this.orgType) {
  131. this.search.itemName = null;
  132. if (this.search.ruleId) {
  133. this.$refs.st.search();
  134. }
  135. } else {
  136. this.search = this.emptySearch();
  137. ruleListForOrg({ orgType: this.orgType }).then((r) => {
  138. this.ruleList = r.data;
  139. this.prevOrgType = this.orgType;
  140. if (r.data && r.data.length > 0) {
  141. this.search.ruleId = r.data[0].id;
  142. }
  143. });
  144. }
  145. },
  146. onHide() {
  147. this.isShow = false;
  148. },
  149. closed() {
  150. this.$refs.st.dataList = [];
  151. },
  152. onSelect(item) {
  153. this.selectList = item;
  154. },
  155. onSubmit() {
  156. let s = this.selectList;
  157. this.$emit("select", this.selectList);
  158. this.onHide();
  159. },
  160. emptySearch() {
  161. return {
  162. ruleId: null,
  163. itemName: null,
  164. };
  165. },
  166. },
  167. mounted() {},
  168. };
  169. </script>
  170. <style lang="scss" scoped>
  171. .DialogCom-div {
  172. overflow: auto;
  173. }
  174. .dialog-footer {
  175. margin-top: 20px;
  176. }
  177. </style>