material_list.vue 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197
  1. <template>
  2. <div class="app-container">
  3. <div v-if="isShow">
  4. <!-- 筛选条件 -->
  5. <div>
  6. <el-form
  7. ref="screenForm"
  8. :model="screenForm"
  9. label-width="70px"
  10. size="small"
  11. label-position="left"
  12. >
  13. <el-row :gutter="20">
  14. <el-col :xs="24" :sm="12" :lg="6">
  15. <el-form-item label="关键字" prop="keyword">
  16. <el-input
  17. placeholder="请输入关键字"
  18. v-model="screenForm.keyword"
  19. ></el-input>
  20. </el-form-item>
  21. </el-col>
  22. <el-col :xs="24" :sm="12" :lg="18" class="tr">
  23. <el-form-item label="">
  24. <el-button size="small" @click="resetScreenForm"
  25. >清空</el-button
  26. >
  27. <el-button size="small" type="primary" @click="submitScreenForm"
  28. >搜索</el-button
  29. >
  30. </el-form-item>
  31. </el-col>
  32. </el-row>
  33. </el-form>
  34. </div>
  35. <div class="mymain-container">
  36. <div class="table">
  37. <el-table
  38. v-loading="listLoading"
  39. :data="dataList"
  40. element-loading-text="Loading"
  41. border
  42. fit
  43. highlight-current-row
  44. stripe
  45. >
  46. <el-table-column
  47. type="selection"
  48. align="center"
  49. min-width="100"
  50. ></el-table-column>
  51. <el-table-column
  52. align="center"
  53. label="使用组织"
  54. prop="useOrgId"
  55. min-width="100"
  56. ></el-table-column>
  57. <el-table-column
  58. align="center"
  59. label="编码"
  60. prop="number"
  61. min-width="100"
  62. label-class-name="bianma"
  63. class-name="fontstyle"
  64. ></el-table-column>
  65. <el-table-column
  66. align="center"
  67. label="名称"
  68. prop="name"
  69. min-width="100"
  70. ></el-table-column>
  71. <el-table-column
  72. align="center"
  73. label="规格型号"
  74. prop="specification"
  75. min-width="100"
  76. ></el-table-column>
  77. <el-table-column
  78. align="center"
  79. label="数据状态"
  80. prop="forbidStatus"
  81. min-width="100"
  82. >
  83. <template slot-scope="scope">
  84. <el-tag type="success" v-if="scope.row.forbidStatus=='A'">正常</el-tag>
  85. <el-tag type="danger" v-else>禁用</el-tag>
  86. </template>
  87. </el-table-column>
  88. <el-table-column
  89. align="center"
  90. label="是否维护商城资料"
  91. prop="maintainData"
  92. min-width="100"
  93. ></el-table-column>
  94. <el-table-column
  95. align="center"
  96. label="是否维护内外机档案"
  97. prop="maintainFiles"
  98. min-width="100"
  99. ></el-table-column>
  100. <el-table-column
  101. align="center"
  102. label="基本单位"
  103. prop="baseCompany"
  104. min-width="100"
  105. ></el-table-column>
  106. <el-table-column
  107. align="center"
  108. label="已使用"
  109. prop="used"
  110. min-width="100"
  111. ></el-table-column>
  112. <el-table-column
  113. align="center"
  114. label="操作"
  115. prop="caozuo"
  116. min-width="160"
  117. show-overflow-tooltip
  118. >
  119. <template slot-scope="scope">
  120. <el-button type="text" class="textColor" @click="hanleDetail(scope.row.id)"
  121. >详情</el-button
  122. >
  123. <el-button type="text" class="textColor">删除</el-button>
  124. </template>
  125. </el-table-column>
  126. </el-table>
  127. </div>
  128. <!-- 分页 -->
  129. <div class="fr">
  130. <el-pagination
  131. :current-page="currentPage"
  132. :page-sizes="[10, 20, 30, 50]"
  133. :page-size="10"
  134. layout="total, sizes, prev, pager, next, jumper"
  135. :total="listTotal"
  136. >
  137. </el-pagination>
  138. </div>
  139. </div>
  140. </div>
  141. <MaterialListDetail v-else :detail='detail'/>
  142. </div>
  143. </template>
  144. <script>
  145. import Mixin from "@/mixin/index";
  146. import { getMaterialList,getMaterialDetail } from "@/api/basic_data/material";
  147. import MaterialListDetail from "./components/material_list-detail.vue";
  148. export default {
  149. mixins: [Mixin],
  150. data() {
  151. return {
  152. isShow: true,
  153. screenForm: {
  154. // 筛选表单数据
  155. keyword: "", // 名称
  156. },
  157. };
  158. },
  159. components: { MaterialListDetail },
  160. methods: {
  161. hanleDetail(id) {
  162. getMaterialDetail({id}).then((res)=>{
  163. console.log(res);
  164. this.detail = res.data
  165. this.isShow = false;
  166. })
  167. },
  168. getList() {
  169. this.listLoading = true;
  170. let params = {
  171. pageNum: this.currentPage,
  172. pageSize: this.pageSize,
  173. keyword: this.screenForm.keyword,
  174. };
  175. getMaterialList(params).then((res) => {
  176. this.dataList = res.data.records;
  177. this.listTotal = res.data.total;
  178. this.listLoading = false;
  179. });
  180. },
  181. },
  182. };
  183. </script>
  184. <style lang="scss" scoped>
  185. // ::v-deep .fontstyle {
  186. // color: #0909ff;
  187. // }
  188. // ::v-deep .bianma {
  189. // color: #409eff;
  190. // }
  191. </style>