AssetList.vue 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262
  1. <template>
  2. <a-card :bordered="false">
  3. <!-- 查询区域 -->
  4. <div class="table-page-search-wrapper">
  5. <a-form layout="inline" @keyup.enter.native="searchQuery">
  6. <a-row :gutter="24">
  7. <a-col :xl="6" :lg="7" :md="8" :sm="24">
  8. <a-form-item label="资产编号">
  9. <a-input placeholder="请输入资产编号" v-model="queryParam.assetNumber"></a-input>
  10. </a-form-item>
  11. </a-col>
  12. <a-col :xl="6" :lg="7" :md="8" :sm="24">
  13. <a-form-item label="资产名称">
  14. <a-input placeholder="请输入资产名称" v-model="queryParam.assetName"></a-input>
  15. </a-form-item>
  16. </a-col>
  17. <template v-if="toggleSearchStatus">
  18. <a-col :xl="6" :lg="7" :md="8" :sm="24">
  19. <a-form-item label="资产类别">
  20. <a-input placeholder="请输入资产类别" v-model="queryParam.assetsCategory"></a-input>
  21. </a-form-item>
  22. </a-col>
  23. <a-col :xl="6" :lg="7" :md="8" :sm="24">
  24. <a-form-item label="品牌">
  25. <a-input placeholder="请输入品牌" v-model="queryParam.brand"></a-input>
  26. </a-form-item>
  27. </a-col>
  28. <a-col :xl="6" :lg="7" :md="8" :sm="24">
  29. <a-form-item label="单位名称">
  30. <a-input placeholder="请输入单位名称" v-model="queryParam.unitName"></a-input>
  31. </a-form-item>
  32. </a-col>
  33. <a-col :xl="6" :lg="7" :md="8" :sm="24">
  34. <a-form-item label="规格型号">
  35. <a-input placeholder="请输入规格型号" v-model="queryParam.model"></a-input>
  36. </a-form-item>
  37. </a-col>
  38. <a-col :xl="6" :lg="7" :md="8" :sm="24">
  39. <a-form-item label="使用人">
  40. <a-input placeholder="请输入使用人" v-model="queryParam.user"></a-input>
  41. </a-form-item>
  42. </a-col>
  43. <a-col :xl="6" :lg="7" :md="8" :sm="24">
  44. <a-form-item label="使用部门">
  45. <a-input placeholder="请输入使用部门" v-model="queryParam.userDept"></a-input>
  46. </a-form-item>
  47. </a-col>
  48. <a-col :xl="6" :lg="7" :md="8" :sm="24">
  49. <a-form-item label="资产状态">
  50. <a-input placeholder="请输入资产状态" v-model="queryParam.state"></a-input>
  51. </a-form-item>
  52. </a-col>
  53. </template>
  54. <a-col :xl="6" :lg="7" :md="8" :sm="24">
  55. <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
  56. <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
  57. <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
  58. <a @click="handleToggleSearch" style="margin-left: 8px">
  59. {{ toggleSearchStatus ? '收起' : '展开' }}
  60. <a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>
  61. </a>
  62. </span>
  63. </a-col>
  64. </a-row>
  65. </a-form>
  66. </div>
  67. <!-- 查询区域-END -->
  68. <!-- table区域-begin -->
  69. <div>
  70. <a-table
  71. ref="table"
  72. size="middle"
  73. bordered
  74. rowKey="id"
  75. :columns="columns"
  76. :dataSource="dataSource"
  77. :pagination="ipagination"
  78. :loading="loading"
  79. rowselection="false"
  80. @change="handleTableChange">
  81. <template slot="htmlSlot" slot-scope="text">
  82. <div v-html="text"></div>
  83. </template>
  84. <template slot="imgSlot" slot-scope="text">
  85. <span v-if="!text" style="font-size: 12px;font-style: italic;">无此图片</span>
  86. <img v-else :src="getImgView(text)" height="25px" alt="图片不存在" style="max-width:80px;font-size: 12px;font-style: italic;"/>
  87. </template>
  88. <template slot="fileSlot" slot-scope="text">
  89. <span v-if="!text" style="font-size: 12px;font-style: italic;">无此文件</span>
  90. <a-button
  91. v-else
  92. :ghost="true"
  93. type="primary"
  94. icon="download"
  95. size="small"
  96. @click="uploadFile(text)">
  97. 下载
  98. </a-button>
  99. </template>
  100. <span slot="action" slot-scope="text, record">
  101. <a @click="handleEdit(record)">编辑</a>
  102. </span>
  103. </a-table>
  104. </div>
  105. <asset-modal ref="modalForm" @ok="modalFormOk"></asset-modal>
  106. </a-card>
  107. </template>
  108. <script>
  109. import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  110. import AssetModal from './modules/AssetModal'
  111. import JDate from '@/components/jeecg/JDate.vue'
  112. export default {
  113. name: "AssetList",
  114. mixins:[JeecgListMixin],
  115. components: {
  116. JDate,
  117. AssetModal
  118. },
  119. data () {
  120. return {
  121. description: '固定资产管理页面',
  122. // 表头
  123. columns: [
  124. {
  125. title: '#',
  126. dataIndex: '',
  127. key:'rowIndex',
  128. width:60,
  129. align:"center",
  130. customRender:function (t,r,index) {
  131. return parseInt(index)+1;
  132. }
  133. },
  134. {
  135. title:'资产编号',
  136. align:"center",
  137. dataIndex: 'assetNumber'
  138. },
  139. {
  140. title:'资产名称',
  141. align:"center",
  142. dataIndex: 'assetName'
  143. },
  144. {
  145. title:'资产类别',
  146. align:"center",
  147. dataIndex: 'assetsCategory'
  148. },
  149. {
  150. title:'品牌',
  151. align:"center",
  152. dataIndex: 'brand'
  153. },
  154. {
  155. title:'单位名称',
  156. align:"center",
  157. dataIndex: 'unitName'
  158. },
  159. {
  160. title:'规格型号',
  161. align:"center",
  162. dataIndex: 'model'
  163. },
  164. {
  165. title:'计量单位',
  166. align:"center",
  167. dataIndex: 'unit'
  168. },
  169. {
  170. title:'数量',
  171. align:"center",
  172. dataIndex: 'quantity'
  173. },
  174. {
  175. title:'金额',
  176. align:"center",
  177. dataIndex: 'amount'
  178. },
  179. {
  180. title:'使用年限',
  181. align:"center",
  182. dataIndex: 'exp'
  183. },
  184. {
  185. title:'购置日期',
  186. align:"center",
  187. dataIndex: 'purhcaseDate',
  188. customRender:function (text) {
  189. return !text?"":(text.length>10?text.substr(0,10):text)
  190. }
  191. },
  192. {
  193. title:'入库日期',
  194. align:"center",
  195. dataIndex: 'inDate',
  196. customRender:function (text) {
  197. return !text?"":(text.length>10?text.substr(0,10):text)
  198. }
  199. },
  200. {
  201. title:'存放地点',
  202. align:"center",
  203. dataIndex: 'place'
  204. },
  205. {
  206. title:'使用人',
  207. align:"center",
  208. dataIndex: 'user'
  209. },
  210. {
  211. title:'使用部门',
  212. align:"center",
  213. dataIndex: 'userDept'
  214. },
  215. {
  216. title:'资产状态',
  217. align:"center",
  218. dataIndex: 'state'
  219. },
  220. {
  221. title: '操作',
  222. dataIndex: 'action',
  223. align:"center",
  224. scopedSlots: { customRender: 'action' }
  225. }
  226. ],
  227. url: {
  228. list: "/oa/asset/list",
  229. delete: "/oa/asset/delete",
  230. deleteBatch: "/oa/asset/deleteBatch",
  231. exportXlsUrl: "/oa/asset/exportXls",
  232. importExcelUrl: "oa/asset/importExcel",
  233. },
  234. dictOptions:{},
  235. }
  236. },
  237. computed: {
  238. importExcelUrl: function(){
  239. return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
  240. }
  241. },
  242. methods: {
  243. initDictConfig(){
  244. }
  245. }
  246. }
  247. </script>
  248. <style scoped>
  249. @import '~@assets/less/common.less';
  250. </style>