fixedZyModal.vue 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295
  1. <template>
  2. <div id="fixedZyModal">
  3. <a-modal
  4. title=""
  5. v-model="fixedZyModVis"
  6. @cancel="handleCancel"
  7. width="80%"
  8. style="top:330px;left:100px;"
  9. >
  10. <!-- 増行 子表 -->
  11. <a-card :bordered="false" style="margin:10px 0">
  12. <!-- 子表 -->
  13. <a-form-model ref="formRef">
  14. <a-table
  15. v-if="fixedZyData"
  16. bordered
  17. rowKey="id"
  18. :columns="fixedZyColumns"
  19. :data-source="fixedZyData"
  20. :rowSelection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
  21. :pagination="false"
  22. :scroll="{x:2100,y: 300}"
  23. >
  24. </a-table>
  25. </a-form-model>
  26. </a-card>
  27. <!-- 页面底部保存取消 -->
  28. <div
  29. :style="{
  30. position: 'absolute',
  31. right: 0,
  32. bottom: 0,
  33. width: '100%',
  34. borderTop: '1px solid #e9e9e9',
  35. padding: '10px 16px',
  36. background: '#fff',
  37. textAlign: 'right',
  38. zIndex: 1
  39. }"
  40. >
  41. <a-popconfirm title="确定放弃?" @confirm="close" okText="确定" cancelText="取消">
  42. <a-button :style="{ marginRight: '8px' }">返回</a-button>
  43. </a-popconfirm>
  44. <a-button type="primary" @click="addSave">
  45. 确认
  46. </a-button>
  47. </div>
  48. </a-modal>
  49. </div>
  50. </template>
  51. <script>
  52. import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  53. import JEllipsis from '@/components/jeecg/JEllipsis'
  54. import moment from 'moment'
  55. import {getFixedZy} from '@api/oa/cd-personnel-files'
  56. export default {
  57. name: 'FixedZyModal', // 报关要素
  58. mixins: [JeecgListMixin],
  59. components: { JEllipsis, moment },
  60. data() {
  61. let ellipsis = (v, l = 20) => <j-ellipsis value={v} length={l} /> // 省略
  62. return {
  63. loading: false, // 表格加载
  64. pushState: false, //是否推送
  65. // 子表表头
  66. fixedZyColumns: [
  67. {
  68. title: '入库单号',
  69. dataIndex: 'realname',
  70. width: 140,
  71. ellipsis: true,
  72. className: 'replacecolor'
  73. },
  74. {
  75. title: '资产类别',
  76. dataIndex: 'assetsCategory',
  77. width: 140,
  78. ellipsis: true,
  79. className: 'replacecolor'
  80. },
  81. {
  82. title: '资产编号',
  83. dataIndex: 'assetNumber',
  84. width: 130,
  85. ellipsis: true,
  86. className: 'replacecolor'
  87. },
  88. {
  89. title: '资产名称',
  90. dataIndex: 'assetName',
  91. width: 130,
  92. ellipsis: true,
  93. className: 'replacecolor'
  94. },
  95. {
  96. title: '规则型号',
  97. dataIndex: 'specificationsModels',
  98. width: 130,
  99. ellipsis: true,
  100. className: 'replacecolor'
  101. },
  102. {
  103. title: '品牌',
  104. dataIndex: 'brand',
  105. width: 120,
  106. ellipsis: true,
  107. className: 'replacecolor'
  108. },
  109. {
  110. title: '单位',
  111. dataIndex: 'unit',
  112. width: 120,
  113. ellipsis: true,
  114. className: 'replacecolor'
  115. },
  116. {
  117. title: '价值',
  118. dataIndex: 'unitPrice',
  119. ellipsis: true,
  120. width: 180,
  121. className: 'replacecolor'
  122. },
  123. {
  124. title: '购置日期',
  125. dataIndex: 'acquisitionDate',
  126. width: 120,
  127. ellipsis: true,
  128. className: 'replacecolor'
  129. },
  130. {
  131. title: '厂家',
  132. dataIndex: 'manufacturer',
  133. width: 120,
  134. ellipsis: true,
  135. className: 'replacecolor'
  136. },
  137. {
  138. title: '使用部门',
  139. dataIndex: 'useDepartment',
  140. width: 120,
  141. ellipsis: true,
  142. className: 'replacecolor'
  143. },
  144. {
  145. title: '入库时间',
  146. dataIndex: 'inputDate',
  147. width: 90,
  148. className: 'replacecolor',
  149. },
  150. {
  151. title: '采购人',
  152. dataIndex: 'purchasingStaff',
  153. width: 90,
  154. className: 'replacecolor',
  155. },
  156. {
  157. title: '采购人',
  158. dataIndex: 'acceptPersonnel: ',
  159. width: 90,
  160. className: 'replacecolor',
  161. },
  162. {
  163. title: '其他说明',
  164. dataIndex: 'otherDescription',
  165. width: 90,
  166. className: 'replacecolor',
  167. },
  168. {
  169. title: '采购单号',
  170. dataIndex: 'buyid',
  171. width: 90,
  172. className: 'replacecolor',
  173. },
  174. {
  175. title: '资产状态',
  176. dataIndex: 'assetState',
  177. width: 90,
  178. className: 'replacecolor',
  179. },
  180. ],
  181. fixedZyData: [ ], // 子表信息
  182. fixedZyModVis: false,
  183. selectedRowKeys:[],
  184. selectedRows:[],
  185. sat:''
  186. }
  187. },
  188. // 接收父组件 方法
  189. props: {},
  190. created() {
  191. },
  192. methods: {
  193. personLists(value){
  194. getFixedZy({state:value}).then(res => {
  195. if (res.success) {
  196. this.fixedZyData = res.result
  197. }else{
  198. this.$message.error(res.message);
  199. }
  200. })
  201. },
  202. close() {
  203. this.$emit('close-declare')
  204. this.fixedZyModVis = false
  205. this.declareElements = {}
  206. this.declareElementsData = []
  207. this.selectedRowKeys = [],
  208. this.sat = ''
  209. },
  210. handleCancel() {
  211. this.close()
  212. },
  213. onSelectChange(keys,rows){
  214. this.selectedRowKeys = keys;
  215. this.selectedRows = rows;
  216. },
  217. addSave(){
  218. if(this.selectedRowKeys.length == 0){
  219. this.$message.error('请勾选数据');
  220. }else if(this.selectedRowKeys.length >1){
  221. this.$message.error('一次只可勾选一行数据');
  222. }else{
  223. if(this.sat == '转移'){
  224. var data ={
  225. assets_category : this.selectedRows[0].assetsCategory,
  226. asset_encoding:this.selectedRows[0].assetNumber,
  227. asset_name:this.selectedRows[0].assetName,
  228. specifications_models:this.selectedRows[0].specificationsModels
  229. }
  230. }else if(this.sat == '归还'){
  231. var data ={
  232. assets_category : this.selectedRows[0].assetsCategory,
  233. asset_encoding:this.selectedRows[0].assetNumber,
  234. asset_name:this.selectedRows[0].assetName,
  235. specifications_models:this.selectedRows[0].specificationsModels
  236. }
  237. }else if(this.sat == '调拨'){
  238. var data ={
  239. asset_encoding:this.selectedRows[0].assetNumber,
  240. assets_category : this.selectedRows[0].assetsCategory,
  241. asset_name:this.selectedRows[0].assetName,
  242. specifications_models:this.selectedRows[0].specificationsModels
  243. }
  244. }else if(this.sat == '报废'){
  245. var data ={
  246. asset_encoding:this.selectedRows[0].assetNumber,
  247. assets_category : this.selectedRows[0].assetsCategory,
  248. asset_name:this.selectedRows[0].assetName,
  249. specifications_models:this.selectedRows[0].specificationsModels
  250. }
  251. }
  252. this.$emit('close',data)
  253. this.close()
  254. }
  255. }
  256. },
  257. computed: {}
  258. }
  259. </script>
  260. <style lang="less" scoped>
  261. /deep/ .ant-table-thead > tr > th {
  262. text-align: center;
  263. // font-weight: 700;
  264. }
  265. /deep/ .ant-table-tbody {
  266. text-align: center;
  267. }
  268. // th.replacecolor {
  269. // background-color: #ccc;
  270. // }
  271. // 对话框里的card样式
  272. /deep/ .ant-modal-content {
  273. background-color: #f0f2f5;
  274. }
  275. /deep/ .ant-modal-body {
  276. padding: 10px;
  277. }
  278. /deep/.ant-form-item{
  279. margin-bottom: 0px !important;
  280. }
  281. /deep/.ant-table-scroll {
  282. word-break: break-all;
  283. }
  284. </style>