AssetList.vue 8.6 KB

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