dialog.select.point.vue 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  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. header-align="center"
  48. prop="itemName"
  49. label="履职项"
  50. min-width="40%"
  51. ></el-table-column>
  52. <el-table-column
  53. header-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. header-align="center"
  64. align="center"
  65. prop="areaName"
  66. label="履职区域"
  67. min-width="20%"
  68. ></el-table-column>
  69. <el-table-column
  70. header-align="center"
  71. prop="checkName"
  72. label="履职点位"
  73. min-width="20%"
  74. ></el-table-column>
  75. <!-- <el-table-column header-align="center" prop="nfcName"
  76. label="采集点"
  77. width="120"></el-table-column>-->
  78. </template>
  79. </g-search-table>
  80. </div>
  81. <div slot="footer" class="dialog-footer">
  82. <el-button type="primary" @click="onSubmit">确定</el-button>
  83. <el-button @click="onHide">关闭</el-button>
  84. </div>
  85. </DialogCom>
  86. </template>
  87. <script>
  88. import GSearchTable from "@/components/table/gx.search.table.vue";
  89. import { ruleListForOrg } from "@/api/resumption/rule.js";
  90. export default {
  91. components: { GSearchTable },
  92. data() {
  93. return {
  94. isShow: false,
  95. prevOrgType: null,
  96. selectList: [],
  97. ruleList: [],
  98. search: this.emptySearch(),
  99. };
  100. },
  101. computed: {},
  102. watch: {
  103. search: {
  104. deep: true,
  105. handler(v) {
  106. if (v.ruleId) {
  107. this.$refs.st.search();
  108. }
  109. },
  110. },
  111. },
  112. props: {
  113. // defaultSelect:{
  114. // type:Array
  115. // },
  116. orgType: {
  117. type: String,
  118. },
  119. },
  120. methods: {
  121. show(defaultSelect) {
  122. if (this.orgType == null) {
  123. this.prevOrgType = this.orgType;
  124. this.$modal.alert("请选择机构类型");
  125. return;
  126. }
  127. this.isShow = true;
  128. if (defaultSelect && defaultSelect.map) {
  129. this.selectList = defaultSelect.map((s) => ({ id: s }));
  130. }
  131. if (this.prevOrgType == this.orgType) {
  132. this.search.itemName = null;
  133. if (this.search.ruleId) {
  134. this.$refs.st.search();
  135. }
  136. } else {
  137. this.search = this.emptySearch();
  138. ruleListForOrg({ orgType: this.orgType }).then((r) => {
  139. this.ruleList = r.data;
  140. this.prevOrgType = this.orgType;
  141. if (r.data && r.data.length > 0) {
  142. this.search.ruleId = r.data[0].id;
  143. }
  144. });
  145. }
  146. },
  147. onHide() {
  148. this.isShow = false;
  149. },
  150. closed() {
  151. this.$refs.st.dataList = [];
  152. },
  153. onSelect(item) {
  154. this.selectList = item;
  155. },
  156. onSubmit() {
  157. let s = this.selectList;
  158. this.$emit("select", this.selectList);
  159. this.onHide();
  160. },
  161. emptySearch() {
  162. return {
  163. ruleId: null,
  164. itemName: null,
  165. };
  166. },
  167. },
  168. mounted() {},
  169. };
  170. </script>
  171. <style lang="scss" scoped>
  172. .DialogCom-div {
  173. overflow: auto;
  174. }
  175. .dialog-footer {
  176. margin-top: 20px;
  177. }
  178. </style>