plm前端
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.

261 lines
7.2 KiB

1 year ago
  1. <script>
  2. import {queryChangeLogList} from "../../../../api/sampleManagement/technicalSpecificationList";
  3. export default {
  4. name: "changeLog",
  5. props:{
  6. row:{
  7. type:Object,
  8. required:true
  9. },
  10. height:{
  11. type:[Number,String],
  12. default:200
  13. }
  14. },
  15. data(){
  16. return{
  17. queryLoading:false,
  18. dataList:[],
  19. columns:[
  20. {
  21. userId: this.$store.state.user.name,
  22. functionId: 108002,
  23. serialNumber: '108002Table1BuNo',
  24. tableId: '108002Table1',
  25. tableName: '工程变更记录表',
  26. columnProp: 'buNo',
  27. headerAlign: 'center',
  28. align: 'center',
  29. columnLabel: 'BU',
  30. columnHidden: false,
  31. columnImage: false,
  32. status: true,
  33. fixed: '',
  34. columnWidth: 80
  35. },
  36. {
  37. userId: this.$store.state.user.name,
  38. functionId: 108002,
  39. serialNumber: '108002Table1ChangeNo',
  40. tableId: '108002Table1',
  41. tableName: '工程变更记录表',
  42. columnProp: 'changeNo',
  43. headerAlign: 'center',
  44. align: 'left',
  45. columnLabel: '申请编号',
  46. columnHidden: false,
  47. columnImage: false,
  48. status: true,
  49. fixed: '',
  50. columnWidth: 120
  51. },
  52. {
  53. userId: this.$store.state.user.name,
  54. functionId: 108002,
  55. serialNumber: '108002Table1ApplicantName',
  56. tableId: '108002Table1',
  57. tableName: '工程变更记录表',
  58. columnProp: 'applicantName',
  59. headerAlign: 'center',
  60. align: 'left',
  61. columnLabel: '申请人',
  62. columnHidden: false,
  63. columnImage: false,
  64. status: true,
  65. fixed: '',
  66. columnWidth: 120
  67. },
  68. {
  69. userId: this.$store.state.user.name,
  70. functionId: 108002,
  71. serialNumber: '108002Table1DepartmentName',
  72. tableId: '108002Table1',
  73. tableName: '工程变更记录表',
  74. columnProp: 'applicationDepartmentName',
  75. headerAlign: 'center',
  76. align: 'left',
  77. columnLabel: '申请部门',
  78. columnHidden: false,
  79. columnImage: false,
  80. status: true,
  81. fixed: '',
  82. columnWidth: 120
  83. },
  84. {
  85. userId: this.$store.state.user.name,
  86. functionId: 108002,
  87. serialNumber: '108002Table1ChangeStatus',
  88. tableId: '108002Table1',
  89. tableName: '工程变更记录表',
  90. columnProp: 'changeStatus',
  91. headerAlign: 'center',
  92. align: 'left',
  93. columnLabel: '变更单状态',
  94. columnHidden: false,
  95. columnImage: false,
  96. status: true,
  97. fixed: '',
  98. columnWidth: 100
  99. },
  100. {
  101. userId: this.$store.state.user.name,
  102. functionId: 108002,
  103. serialNumber: '108002Table1EcnStage',
  104. tableId: '108002Table1',
  105. tableName: '工程变更记录表',
  106. columnProp: 'ecnStage',
  107. headerAlign: 'center',
  108. align: 'left',
  109. columnLabel: 'ECN阶段',
  110. columnHidden: false,
  111. columnImage: false,
  112. status: true,
  113. fixed: '',
  114. columnWidth: 100
  115. },
  116. {
  117. userId: this.$store.state.user.name,
  118. functionId: 108002,
  119. serialNumber: '108002Table1ChangeType',
  120. tableId: '108002Table1',
  121. tableName: '工程变更记录表',
  122. columnProp: 'changeType',
  123. headerAlign: 'center',
  124. align: 'left',
  125. columnLabel: '变更类别',
  126. columnHidden: false,
  127. columnImage: false,
  128. status: true,
  129. fixed: '',
  130. columnWidth: 100
  131. },
  132. {
  133. userId: this.$store.state.user.name,
  134. functionId: 108002,
  135. serialNumber: '108002Table1EcnType',
  136. tableId: '108002Table1',
  137. tableName: '工程变更记录表',
  138. columnProp: 'ecnType',
  139. headerAlign: 'center',
  140. align: 'left',
  141. columnLabel: 'ECN种类',
  142. columnHidden: false,
  143. columnImage: false,
  144. status: true,
  145. fixed: '',
  146. columnWidth: 100
  147. },
  148. {
  149. userId: this.$store.state.user.name,
  150. functionId: 108002,
  151. serialNumber: '108002Table1ApplyDate',
  152. tableId: '108002Table1',
  153. tableName: '工程变更记录表',
  154. columnProp: 'applyDate',
  155. headerAlign: 'center',
  156. align: 'center',
  157. columnLabel: '申请日期',
  158. columnHidden: false,
  159. columnImage: false,
  160. status: true,
  161. fixed: '',
  162. columnWidth: 100
  163. },
  164. {
  165. userId: this.$store.state.user.name,
  166. functionId: 108002,
  167. serialNumber: '108002Table1ChangePhaseInDate',
  168. tableId: '108002Table1',
  169. tableName: '工程变更记录表',
  170. columnProp: 'changePhaseInDate',
  171. headerAlign: 'center',
  172. align: 'center',
  173. columnLabel: '变更生效日期',
  174. columnHidden: false,
  175. columnImage: false,
  176. status: true,
  177. fixed: '',
  178. columnWidth: 100
  179. },
  180. {
  181. userId: this.$store.state.user.name,
  182. functionId: 108002,
  183. serialNumber: '108002Table1xxx',
  184. tableId: '108002Table1',
  185. tableName: '工程变更记录表',
  186. columnProp: 'xxx',
  187. headerAlign: 'center',
  188. align: 'center',
  189. columnLabel: 'ECN执行日期',
  190. columnHidden: false,
  191. columnImage: false,
  192. status: true,
  193. fixed: '',
  194. columnWidth: 100
  195. },
  196. ],
  197. }
  198. },
  199. watch:{
  200. row(newVal,oldVal){
  201. this.queryChangeLogList();
  202. },
  203. queryLoading(newVal,oldVal){
  204. if (!newVal){
  205. setTimeout(()=>{
  206. this.queryLoading = false;
  207. },10000)
  208. }
  209. }
  210. },
  211. methods:{
  212. queryChangeLogList(){
  213. let params = {
  214. site:this.row.site,
  215. codeNo:this.row.codeNo,
  216. }
  217. this.queryLoading = true;
  218. queryChangeLogList(params).then(({data})=>{
  219. if (data && data.code === 0){
  220. this.dataList = data.rows;
  221. }else {
  222. this.$message.warning(data.msg);
  223. }
  224. this.queryLoading = false;
  225. }).catch((error)=>{
  226. this.$message.error(error);
  227. this.queryLoading = false;
  228. })
  229. }
  230. },
  231. }
  232. </script>
  233. <template>
  234. <div>
  235. <el-table
  236. :data="dataList"
  237. border v-loading="queryLoading" :height="height">
  238. <el-table-column
  239. v-for="(item,index) in columns" :key="index"
  240. :sortable="item.columnSortable"
  241. :prop="item.columnProp"
  242. :header-align="item.headerAlign"
  243. :show-overflow-tooltip="item.showOverflowTooltip"
  244. :align="item.align"
  245. :fixed="item.fixed === ''?false:item.fixed"
  246. :min-width="item.columnWidth"
  247. :label="item.columnLabel">
  248. <template slot-scope="scope">
  249. <span v-if="!item.columnHidden">{{ scope.row[item.columnProp] }}</span>
  250. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  251. </template>
  252. </el-table-column>
  253. </el-table>
  254. </div>
  255. </template>
  256. <style scoped>
  257. </style>