You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

196 lines
4.7 KiB

  1. <template>
  2. <view class="welcome">
  3. <view class="welT">资产信息</view>
  4. <view class="welBox">
  5. <!-- <input type="hidden" name="AIId" :value="AIId" id="AIId" /> -->
  6. <l-input title="资产名称" placeholder="请填写" :value="Ass_AssetsInfoItemEntity.AIASSName" disabled right />
  7. <l-input title="资产编号" placeholder="请填写" :value="Ass_AssetsInfoItemEntity.ACode" disabled right />
  8. <l-input title="明细编号" placeholder="请填写" :value="Ass_AssetsInfoItemEntity.AICode" disabled right />
  9. <l-input title="使用人员" placeholder="请填写" :value="displayListItem(Ass_AssetsInfoItemEntity, 'AIUsePeople')" disabled right />
  10. <l-input title="所在库房" placeholder="请填写" :value="displayListItem(Ass_AssetsInfoItemEntity, 'AIIStorageId')" disabled right />
  11. </view>
  12. </view>
  13. </template>
  14. <script>
  15. import moment from 'moment';
  16. import get from 'lodash/get';
  17. import set from 'lodash/set';
  18. import todayTime from '@/common/js/todayTime.js';
  19. export default {
  20. data() {
  21. return {
  22. pageInfo: '',
  23. scheme: {
  24. AIUsePeople: {
  25. type: 'sourceData',
  26. dataSource: '1',
  27. dataSourceId: 'BaseUser,f_realname,f_userid'
  28. },
  29. AIIStorageId: {
  30. type: 'sourceData',
  31. dataSource: '1',
  32. dataSourceId: 'Ass_StorageData,sname,sid'
  33. }
  34. },
  35. userInfo: {},
  36. dataSource:{
  37. AIUsePeople:[],
  38. AIIStorageId:[]
  39. },
  40. AIId: '',
  41. Ass_AssetsInfoItemEntity:{}
  42. };
  43. },
  44. methods: {
  45. init() {
  46. // console.log(this.API)
  47. let _this = this;
  48. Promise.all([
  49. this.FETCH_DATASOURCE('BaseUser').then(data => {
  50. // console.log(data)
  51. this.dataSource.AIUsePeople = data.data.map(t => ({
  52. text: t.f_realname,
  53. value: t.f_userid
  54. }));
  55. }),
  56. this.FETCH_DATASOURCE('Ass_StorageData').then(data => {
  57. // console.log(data)
  58. this.dataSource.AIIStorageId = data.data.map(t => ({
  59. text: t.sname,
  60. value: t.sid
  61. }));
  62. }),
  63. () => {}
  64. ]);
  65. _this.LOADING('加载数据…');
  66. _this.pageInfo = _this.GET_PARAM(); //获取页面传递参数
  67. _this.AIId=_this.pageInfo.AIId;
  68. _this.HTTP_GET('/learun/adms/AssetManagementSystem/Ass_AssetsInfoItem/getEntity', _this.pageInfo.AIId, '加载数据时出错').then(res => {
  69. this.HIDE_LOADING();
  70. console.log(res);
  71. _this.Ass_AssetsInfoItemEntity = _this.COPY(res.Ass_AssetsInfoItemEntity);
  72. });
  73. },
  74. // 显示列表中的标题项
  75. displayListItem(item, field) {
  76. const fieldItem = this.scheme[field];
  77. const value = item[field];
  78. // console.log(Object.values(this.GET_GLOBAL('dataDictionary').usersex));
  79. switch (fieldItem.type) {
  80. case 'currentInfo':
  81. case 'organize':
  82. return fieldItem.dataType === 'time' ? value : get(this.GET_GLOBAL(fieldItem.dataType), `${value}.name`, '');
  83. case 'dataItem':
  84. const sex = this.dataSource[field].find(t => t.value === String(value));
  85. return get(sex, 'text', '');
  86. case 'sourceData':
  87. const BCdPartyFace = this.dataSource[field].find(t => t.value === String(value));
  88. return get(BCdPartyFace, 'text', '');
  89. case 'radio':
  90. case 'select':
  91. const selectItem = this.dataSource[field].find(t => t.value === String(value));
  92. return get(selectItem, 'text', '');
  93. case 'checkbox':
  94. if (!value || value.split(',').length <= 0) {
  95. return '';
  96. }
  97. const checkboxItems = value.split(',');
  98. return this.dataSource[field]
  99. .filter(t => checkboxItems.includes(t.value))
  100. .map(t => t.text)
  101. .join(',');
  102. case 'datetime':
  103. if (!value) {
  104. return '';
  105. }
  106. return moment(value).format(Number(fieldItem.dateformat) === 0 ? 'YYYY年 M月 D日' : 'YYYY-MM-DD HH:mm');
  107. default:
  108. return value === null || value === undefined ? '' : value;
  109. }
  110. }
  111. },
  112. created() {
  113. this.userInfo = this.GET_GLOBAL('loginUser'); //获取登录信息
  114. this.init();
  115. }
  116. };
  117. </script>
  118. <style lang="less" scoped>
  119. /deep/ .cu-form-group {
  120. min-height: 40px;
  121. }
  122. .welcome {
  123. padding: 1px 0px 20px;
  124. background: #fff;
  125. }
  126. .welT {
  127. font-size: 16px;
  128. margin-bottom: 10px;
  129. line-height: 26px;
  130. padding: 0 12px;
  131. }
  132. .welT text {
  133. width: 26px;
  134. height: 26px;
  135. line-height: 24px;
  136. border: 1px solid #efefef;
  137. border-radius: 4px;
  138. float: right;
  139. text-align: center;
  140. color: #999;
  141. }
  142. .welLine {
  143. height: 1px;
  144. background: #efefef;
  145. // margin: 10px -12px;
  146. }
  147. .welInput {
  148. overflow: hidden;
  149. font-size: 14px;
  150. margin-top: 10px;
  151. }
  152. .welInput span {
  153. float: left;
  154. width: 26%;
  155. text-align: right;
  156. line-height: 30px;
  157. }
  158. .welInput input {
  159. display: block;
  160. margin-left: 28%;
  161. width: 72%;
  162. border: 1px solid #efefef;
  163. border-radius: 4px;
  164. height: 30px;
  165. line-height: 28px;
  166. padding: 0 10px;
  167. margin-bottom: 0;
  168. }
  169. .welCon {
  170. padding: 10px;
  171. border: 1px solid #efefef;
  172. margin-top: 18px;
  173. border-radius: 4px;
  174. position: relative;
  175. }
  176. </style>