index.vue 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227
  1. <template>
  2. <div>
  3. <save-form
  4. :inline="true"
  5. :model="searchForm"
  6. ref="searchForm"
  7. @submit="search"
  8. @reset="onReSet"
  9. save-key="teamSchedule"
  10. >
  11. <el-form-item prop="organId">
  12. <el-select
  13. class="multiple"
  14. v-model.trim="searchForm.organId"
  15. filterable
  16. clearable
  17. placeholder="请选择分部"
  18. >
  19. <el-option
  20. v-for="(item, index) in selects.branchs"
  21. :key="index"
  22. :label="item.name"
  23. :value="item.id"
  24. ></el-option>
  25. </el-select>
  26. </el-form-item>
  27. <el-form-item prop="userId">
  28. <remote-search :commit="'setEducations'" v-model="searchForm.userId" />
  29. </el-form-item>
  30. <el-form-item prop="month">
  31. <el-date-picker
  32. v-model="searchForm.month"
  33. value-format="yyyy-MM"
  34. type="month"
  35. placeholder="请选择月"
  36. >
  37. </el-date-picker>
  38. </el-form-item>
  39. <el-form-item>
  40. <el-button native-type="submit" type="primary">搜索</el-button>
  41. <el-button native-type="reset" type="danger">重置</el-button>
  42. </el-form-item>
  43. </save-form>
  44. <el-table
  45. style="width: 100%"
  46. :header-cell-style="{ background: '#EDEEF0', color: '#444' }"
  47. :data="tableList"
  48. >
  49. <el-table-column align="center" prop="organName" label="分部">
  50. <template slot-scope="scope">
  51. <div>
  52. <copy-text>{{ scope.row.organName }}</copy-text>
  53. </div>
  54. </template>
  55. </el-table-column>
  56. <el-table-column align="center" prop="month" label="工作周期">
  57. <template slot-scope="scope">
  58. <div>
  59. {{ scope.row.month | dayjsFormatWeek }}
  60. </div>
  61. </template>
  62. </el-table-column>
  63. <el-table-column align="center" prop="userName" label="乐团主管">
  64. <template slot-scope="scope">
  65. <div>
  66. <copy-text>{{ scope.row.userName }}</copy-text>
  67. </div>
  68. </template>
  69. </el-table-column>
  70. <el-table-column align="center" prop="item" label="任务事项">
  71. <template slot-scope="scope">
  72. <div>
  73. {{ scope.row.item | inspectionItemFormat }}
  74. </div>
  75. </template>
  76. </el-table-column>
  77. <el-table-column
  78. align="center"
  79. prop="times"
  80. label="任务次数"
  81. ></el-table-column>
  82. <el-table-column
  83. align="center"
  84. prop="plannedTimes"
  85. label="已安排日程次数"
  86. ></el-table-column>
  87. <el-table-column
  88. align="center"
  89. prop="submittedTimes"
  90. label="已提交任务数"
  91. >
  92. <template slot-scope="scope">
  93. <div
  94. :style="
  95. scope.row.times > scope.row.submittedTimes ? 'color:red' : ''
  96. "
  97. >
  98. {{ scope.row.submittedTimes }}
  99. </div>
  100. </template>
  101. </el-table-column>
  102. <el-table-column align="center" prop="memo" label="处理意见" width="220">
  103. <template slot-scope="scope">
  104. <overflow-text :text="scope.row.memo"></overflow-text>
  105. </template>
  106. </el-table-column>
  107. <el-table-column align="center" prop="studentId" label="操作">
  108. <template slot-scope="scope">
  109. <div>
  110. <el-button type="text" @click="gotoHander(scope.row)">安排日程</el-button>
  111. <auth :auths="['inspectionItem/update']">
  112. <el-button
  113. type="text"
  114. :disabled="scope.row.times < scope.row.submittedTimes"
  115. @click="resetLine(scope.row)"
  116. >处理方式</el-button
  117. >
  118. </auth>
  119. </div>
  120. </template>
  121. </el-table-column>
  122. </el-table>
  123. <pagination
  124. sync
  125. :total.sync="rules.total"
  126. save-key="teamSchedule"
  127. :page.sync="rules.page"
  128. :limit.sync="rules.limit"
  129. :page-sizes="rules.page_size"
  130. @pagination="getList"
  131. />
  132. <el-dialog title="处理方式" width="700px" :visible.sync="handleVisible">
  133. <el-form :model="handleForm">
  134. <el-form-item label="请填写处理方式" prop="memo">
  135. <el-input
  136. type="textarea"
  137. :rows="3"
  138. v-model="handleForm.memo"
  139. ></el-input>
  140. </el-form-item>
  141. </el-form>
  142. <div slot="footer" class="dialog-footer">
  143. <el-button @click="handleVisible = false">取 消</el-button>
  144. <el-button type="primary" @click="submitHandle">确 定</el-button>
  145. </div>
  146. </el-dialog>
  147. </div>
  148. </template>
  149. <script>
  150. import { getInspectionItem, resetInspectionItem } from "../api";
  151. import { permission } from "@/utils/directivePage";
  152. import pagination from "@/components/Pagination/index";
  153. export default {
  154. components: { pagination },
  155. data() {
  156. return {
  157. searchForm: {
  158. userId: "",
  159. organId: "",
  160. month: "",
  161. },
  162. handleForm: {
  163. memo: "",
  164. id: "",
  165. },
  166. tableList: [],
  167. handleVisible: false,
  168. rules: {
  169. // 分页规则
  170. limit: 10, // 限制显示条数
  171. page: 1, // 当前页
  172. total: 0, // 总条数
  173. page_size: [10, 20, 40, 50], // 选择限制显示条数
  174. },
  175. };
  176. },
  177. mounted() {
  178. this.$store.dispatch("setBranchs");
  179. this.getList();
  180. },
  181. methods: {
  182. permission(str) {
  183. return permission(str);
  184. },
  185. onReSet() {
  186. this.rules.page = 1;
  187. this.$refs.searchForm.resetFields();
  188. },
  189. search() {
  190. this.rules.page = 1;
  191. this.getList();
  192. },
  193. async getList() {
  194. try {
  195. this.searchForm.page = this.rules.page;
  196. this.searchForm.rows = this.rules.limit;
  197. const res = await getInspectionItem(this.searchForm);
  198. this.tableList = res.data.rows;
  199. this.rules.total = res.data.total;
  200. } catch (e) {
  201. console.log(e);
  202. }
  203. },
  204. resetLine(row) {
  205. let { id, memo } = row;
  206. this.handleForm = { id, memo };
  207. this.handleVisible = true;
  208. },
  209. async submitHandle() {
  210. console.log(this.handleForm);
  211. try {
  212. const res = await resetInspectionItem(this.handleForm);
  213. this.$message.success('提交成功')
  214. this.getList()
  215. console.log(res);
  216. } catch (e) {
  217. console.log(e);
  218. }
  219. },
  220. gotoHander(row){
  221. }
  222. },
  223. };
  224. </script>
  225. <style lang="scss" scoped>
  226. </style>