processed.vue 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252
  1. <!--已处理 processed-->
  2. <template>
  3. <div class="photonote-processed">
  4. <el-table v-loading="loading" border :data="photonoteList" @selection-change="handleSelectionChange">
  5. <el-table-column label="实验室名称" align="left" prop="subName" width="253" show-overflow-tooltip/>
  6. <el-table-column label="描述" align="left" prop="describe" show-overflow-tooltip/>
  7. <el-table-column label="反馈人" align="left" prop="applyName" width="157" show-overflow-tooltip/>
  8. <el-table-column label="提交时间" align="left" prop="createTime" width="200" show-overflow-tooltip>
  9. <template slot-scope="scope">
  10. <span>{{ parseTime(scope.row.createTime,"{y}-{m}-{d} {h}:{i}") }}</span>
  11. </template>
  12. </el-table-column>
  13. <el-table-column label="处理人" align="left" prop="handleName" width="135" show-overflow-tooltip/>
  14. <el-table-column label="处理时间" align="left" prop="handleTime" width="200" show-overflow-tooltip>
  15. <template slot-scope="scope">
  16. <span>{{ parseTime(scope.row.handleTime,"{y}-{m}-{d} {h}:{i}") }}</span>
  17. </template>
  18. </el-table-column>
  19. </el-table>
  20. <pagination
  21. v-show="total>0"
  22. :total="total"
  23. layout="total, prev, pager, next, sizes, jumper"
  24. :page.sync="queryParams.pageNum"
  25. :limit.sync="queryParams.pageSize"
  26. @pagination="getList"
  27. />
  28. <!-- 添加或修改随手拍记录对话框 -->
  29. <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body :close-on-click-modal="false">
  30. <el-form ref="form" :model="form" :rules="rules" label-width="80px">
  31. <el-form-item label="图片地址" prop="imgUrl">
  32. <el-input v-model="form.imgUrl" placeholder="请输入图片地址" />
  33. </el-form-item>
  34. <el-form-item label="处理人ID" prop="handleUser">
  35. <el-input v-model="form.handleUser" placeholder="请输入处理人ID" />
  36. </el-form-item>
  37. <el-form-item label="处理时间" prop="handleTime">
  38. <el-date-picker clearable size="small"
  39. v-model="form.handleTime"
  40. type="date"
  41. value-format="yyyy-MM-dd"
  42. placeholder="选择处理时间">
  43. </el-date-picker>
  44. </el-form-item>
  45. <el-form-item label="处理标记 0:待处理 1:已处理">
  46. <el-radio-group v-model="form.handleStatus">
  47. <el-radio label="1">请选择字典生成</el-radio>
  48. </el-radio-group>
  49. </el-form-item>
  50. <el-form-item label="部门id" prop="deptId">
  51. <el-input v-model="form.deptId" placeholder="请输入部门id" />
  52. </el-form-item>
  53. <el-form-item label="部门名称" prop="deptName">
  54. <el-input v-model="form.deptName" placeholder="请输入部门名称" />
  55. </el-form-item>
  56. <el-form-item label="创建人" prop="userId">
  57. <el-input v-model="form.userId" placeholder="请输入创建人" />
  58. </el-form-item>
  59. <el-form-item label="备注" prop="remark">
  60. <el-input v-model="form.remark" placeholder="请输入备注" />
  61. </el-form-item>
  62. <el-form-item label="实验室ID" prop="subjectId">
  63. <el-input v-model="form.subjectId" placeholder="请输入实验室ID" />
  64. </el-form-item>
  65. <el-form-item label="描述" prop="describe">
  66. <el-input v-model="form.describe" type="textarea" placeholder="请输入内容" />
  67. </el-form-item>
  68. </el-form>
  69. <div slot="footer" class="dialog-footer dialog-footer-box">
  70. <p class="dialog-footer-button-null"></p>
  71. <p class="dialog-footer-button-info" @click="cancel">取消</p>
  72. <p class="dialog-footer-button-primary" @click="submitForm">提交</p>
  73. <p class="dialog-footer-button-null"></p>
  74. </div>
  75. </el-dialog>
  76. </div>
  77. </template>
  78. <script>
  79. import { listPhotonote, getPhotonote,
  80. delPhotonote, addPhotonote,
  81. updatePhotonote } from "@/api/securityCheck/index";
  82. export default {
  83. name: "Photonote",
  84. data() {
  85. return {
  86. // 遮罩层
  87. loading: true,
  88. // 选中数组
  89. ids: [],
  90. // 非单个禁用
  91. single: true,
  92. // 非多个禁用
  93. multiple: true,
  94. // 显示搜索条件
  95. showSearch: true,
  96. // 总条数
  97. total: 0,
  98. // 随手拍记录表格数据
  99. photonoteList: [],
  100. // 弹出层标题
  101. title: "",
  102. // 是否显示弹出层
  103. open: false,
  104. // 查询参数
  105. queryParams: {
  106. pageNum: 1,
  107. pageSize:20,
  108. imgUrl: null,
  109. handleUser: null,
  110. handleTime: null,
  111. handleStatus: 1,
  112. deptId: null,
  113. deptName: null,
  114. userId: null,
  115. subjectId: null,
  116. describe: null
  117. },
  118. // 表单参数
  119. form: {},
  120. // 表单校验
  121. rules: {
  122. }
  123. };
  124. },
  125. created() {
  126. this.getList();
  127. },
  128. methods: {
  129. /** 查询随手拍记录列表 */
  130. getList() {
  131. this.loading = true;
  132. listPhotonote(this.queryParams).then( response => {
  133. this.photonoteList = response.rows;
  134. this.total = response.total;
  135. this.loading = false;
  136. });
  137. },
  138. // 取消按钮
  139. cancel() {
  140. this.open = false;
  141. this.reset();
  142. },
  143. // 表单重置
  144. reset() {
  145. this.form = {
  146. id: null,
  147. imgUrl: null,
  148. handleUser: null,
  149. handleTime: null,
  150. handleStatus: 0,
  151. deptId: null,
  152. deptName: null,
  153. userId: null,
  154. remark: null,
  155. createBy: null,
  156. createTime: null,
  157. updateBy: null,
  158. updateTime: null,
  159. subjectId: null,
  160. describe: null
  161. };
  162. this.resetForm("form");
  163. },
  164. /** 搜索按钮操作 */
  165. handleQuery() {
  166. this.queryParams.pageNum = 1;
  167. this.getList();
  168. },
  169. /** 重置按钮操作 */
  170. resetQuery() {
  171. this.resetForm("queryForm");
  172. this.handleQuery();
  173. },
  174. // 多选框选中数据
  175. handleSelectionChange(selection) {
  176. this.ids = selection.map(item => item.id)
  177. this.single = selection.length!==1
  178. this.multiple = !selection.length
  179. },
  180. /** 新增按钮操作 */
  181. handleAdd() {
  182. this.reset();
  183. this.open = true;
  184. this.title = "添加随手拍记录";
  185. },
  186. /** 修改按钮操作 */
  187. handleUpdate(row) {
  188. this.reset();
  189. const id = row.id || this.ids
  190. getPhotonote(id).then( response => {
  191. this.form = response.data;
  192. this.open = true;
  193. this.title = "修改随手拍记录";
  194. });
  195. },
  196. /** 提交按钮 */
  197. submitForm() {
  198. this.$refs["form"].validate(valid => {
  199. if (valid) {
  200. if (this.form.id != null) {
  201. updatePhotonote(this.form).then( response => {
  202. this.msgSuccess("修改成功");
  203. this.open = false;
  204. this.getList();
  205. });
  206. } else {
  207. addPhotonote(this.form).then( response => {
  208. this.msgSuccess("新增成功");
  209. this.open = false;
  210. this.getList();
  211. });
  212. }
  213. }
  214. });
  215. },
  216. /** 删除按钮操作 */
  217. handleDelete(row) {
  218. const ids = row.id || this.ids;
  219. this.$confirm('是否确认删除随手拍记录?', "警告", {
  220. confirmButtonText: "确定",
  221. cancelButtonText: "取消",
  222. type: "warning"
  223. }).then(function() {
  224. return delPhotonote(ids);
  225. }).then(() => {
  226. this.getList();
  227. this.msgSuccess("删除成功");
  228. }).catch(() => {});
  229. },
  230. /** 导出按钮操作 */
  231. handleExport() {
  232. this.download('laboratory/photonote/export', {
  233. ...this.queryParams
  234. }, `laboratory_photonote.xlsx`)
  235. }
  236. }
  237. };
  238. </script>
  239. <style scoped lang="scss">
  240. .photonote-processed {
  241. flex:1;
  242. display: flex!important;
  243. flex-direction: column;
  244. }
  245. </style>