AssetSelection.vue 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231
  1. <template>
  2. <div class="container">
  3. <!-- 单据弹窗 -->
  4. <el-dialog
  5. title="选择设备"
  6. :before-close="handleClose"
  7. :visible.sync="dialogVisible"
  8. :close-on-click-modal="false"
  9. :append-to-body="true"
  10. width="60%"
  11. >
  12. <el-form label-width="60px">
  13. <el-row>
  14. <el-col :span="6">
  15. <el-form-item label="编码:">
  16. <el-input
  17. clearable
  18. placeholder="请输入"
  19. v-model.trim="search.code"
  20. ></el-input>
  21. </el-form-item>
  22. </el-col>
  23. <el-col :span="6">
  24. <el-form-item label="名称:">
  25. <el-input
  26. clearable
  27. v-model="search.name"
  28. placeholder="请输入"
  29. ></el-input>
  30. </el-form-item>
  31. </el-col>
  32. <el-col :span="6">
  33. <el-form-item label="型号:">
  34. <el-input
  35. clearable
  36. v-model="search.model"
  37. placeholder="请输入"
  38. ></el-input>
  39. </el-form-item>
  40. </el-col>
  41. <el-col :span="6">
  42. <el-form-item label-width="20px">
  43. <el-button type="primary" @click="getList">搜索</el-button>
  44. <el-button @click="reset">重置</el-button>
  45. </el-form-item>
  46. </el-col>
  47. </el-row>
  48. </el-form>
  49. <el-table
  50. :data="tableData"
  51. height="450"
  52. highlight-current-row
  53. @row-click="single"
  54. >
  55. <el-table-column label="设备编码" prop="code" width="200"></el-table-column>
  56. <el-table-column label="设备分类" prop="name"></el-table-column>
  57. <el-table-column label="设备名称" prop="remark"></el-table-column>
  58. <el-table-column label="型号" prop="name"></el-table-column>
  59. <el-table-column label="供应商" prop="remark"></el-table-column>
  60. <el-table-column label="选择" align="center">
  61. <template slot-scope="scope">
  62. <el-radio class="radio" v-model="radio" :label="scope.row.id"><i></i></el-radio>
  63. </template>
  64. </el-table-column>
  65. </el-table>
  66. <div class="pagination">
  67. <el-pagination
  68. background
  69. layout="total, sizes, prev, pager, next, jumper"
  70. :total="total"
  71. :page-sizes="[10, 20, 50, 100]"
  72. :page-size="pagination.size"
  73. :current-page.sync="pagination.pageNum"
  74. @current-change="handleCurrent"
  75. @size-change="handleSize"
  76. >
  77. </el-pagination>
  78. </div>
  79. <div slot="footer" class="dialog-footer">
  80. <el-button size="small" @click="handleClose">关 闭</el-button>
  81. <el-button size="small" @click="sumbit" type="primary">确 认</el-button>
  82. </div>
  83. </el-dialog>
  84. </div>
  85. </template>
  86. <script>
  87. import { getAssetList } from '@/api/ledgerAssets';
  88. export default {
  89. data() {
  90. return {
  91. tableData:[],
  92. search:{},
  93. pagination: {
  94. pageNum: 1,
  95. size: 10,
  96. },
  97. total: 0,
  98. radio: '',
  99. current:null,
  100. dialogVisible: false
  101. };
  102. },
  103. created() {},
  104. methods: {
  105. // 单击获取id
  106. single (row) {
  107. this.current = row
  108. this.radio = row.id
  109. },
  110. open() {
  111. this.dialogVisible = true;
  112. this.getList();
  113. },
  114. getList(){
  115. let params = {
  116. rootCategoryLevelId:'1666337718796607490',
  117. ...this.search,
  118. ...this.pagination
  119. }
  120. getAssetList(params).then(res=>{
  121. console.log('rrr',res)
  122. })
  123. },
  124. reset(){
  125. this.search={}
  126. this.getList()
  127. },
  128. handleCurrent (page) {
  129. this.pagination.pageNum = page
  130. this.getList()
  131. },
  132. handleSize (size) {
  133. this.pagination.pageNum = 1
  134. this.pagination.size = size
  135. this.getList()
  136. },
  137. //保存
  138. sumbit() {
  139. if (this.selectStafflist.length === 0) {
  140. this.$message.warning('请选择设备');
  141. } else {
  142. this.$emit('confirm', JSON.parse(JSON.stringify(this.selectStafflist)));
  143. this.handleClose();
  144. }
  145. },
  146. handleClose() {
  147. this.staffList = [];
  148. this.selectStafflist = [];
  149. this.dialogVisible = false;
  150. }
  151. }
  152. };
  153. </script>
  154. <style lang='scss' scoped>
  155. .container {
  156. padding: 10px 0;
  157. }
  158. .zw-container {
  159. height: 500px;
  160. }
  161. .zw-header-title {
  162. display: inline-block;
  163. margin-right: 10px;
  164. font-weight: 600;
  165. }
  166. .details-title {
  167. line-height: 32px;
  168. height: 32px;
  169. }
  170. .zw-page-list-p {
  171. font-size: 14px;
  172. margin-bottom: 18px;
  173. display: flex;
  174. justify-content: space-between;
  175. // align-items: center;
  176. .zw-page-list-right {
  177. display: flex;
  178. }
  179. }
  180. .zw-page {
  181. background: #fff;
  182. // padding: 20px 0;
  183. .zw-page-left {
  184. padding: 0 10px;
  185. }
  186. .zw-page-main {
  187. padding: 0 10px;
  188. .zw-page-main-list {
  189. span {
  190. margin-right: 10px;
  191. }
  192. .zw-page-span-num {
  193. font-size: 12px;
  194. color: #157a2c;
  195. }
  196. .zw-page-p-operation {
  197. text-align: right;
  198. // width: 200px;
  199. }
  200. .zw-page-operation-num {
  201. width: 100px;
  202. margin: 0 10px;
  203. }
  204. }
  205. .zw-page-list-more {
  206. text-align: center;
  207. }
  208. }
  209. .zw-page-right {
  210. .zw-card-header {
  211. display: flex;
  212. justify-content: space-between;
  213. align-items: center;
  214. height: 32px;
  215. }
  216. span {
  217. margin-right: 10px;
  218. }
  219. .zw-page-span-num {
  220. font-size: 12px;
  221. color: #157a2c;
  222. }
  223. }
  224. }
  225. .notes {
  226. font-size: 12px;
  227. color: #909090;
  228. }
  229. </style>