index.vue 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312
  1. <template>
  2. <div>
  3. <basicDetails
  4. ref="details"
  5. :titleText="mainData.itemname"
  6. :oldFormPath="{ edit: 'optionSystem/executeManage/modules' }"
  7. :editData="mainData"
  8. :mainAreaData="mainAreaData"
  9. turnPageId="2024060514063602"
  10. delApiId="2024060514040602"
  11. idname="itemid"
  12. ownertable="plm_item"
  13. tags=""
  14. :tabs="['基本信息']"
  15. :statusCheck="[{key:'status',value:'审核'}]"
  16. @pageChange="pageChange"
  17. @onEditSuccess="queryMainData($route.query.id)"
  18. >
  19. <div slot="customOperation">
  20. <customBtn
  21. class="inline-16"
  22. btnName="审核"
  23. message="确定审核当前执行器吗?"
  24. idName="2024060514051502"
  25. keyName="itemids"
  26. :id="[$route.query.id]"
  27. :paramData="[{key:'ischeck',value:1}]"
  28. @onSuccess="queryMainData()"
  29. v-if="mainData.status == '新建' && tool.checkAuth($route.name,'check')"
  30. />
  31. <customBtn
  32. class="inline-16"
  33. btnName="反审核"
  34. message="确定反审核当前执行器吗?"
  35. idName="2024060514051502"
  36. keyName="itemids"
  37. :id="[$route.query.id]"
  38. :paramData="[{key:'ischeck',value:0}]"
  39. @onSuccess="queryMainData()"
  40. v-if="mainData.status == '审核' && tool.checkAuth($route.name,'nocheck')"
  41. />
  42. </div>
  43. <div slot="slot0">
  44. <DetailInfo :more="true" :data="detailInfo"></DetailInfo>
  45. </div>
  46. </basicDetails>
  47. </div>
  48. </template>
  49. <script>
  50. import DetailInfo from "@/components/detailInfo/index";
  51. export default {
  52. name: "detail",
  53. components:{DetailInfo},
  54. data() {
  55. return {
  56. mainData: {},
  57. mainAreaData: {},
  58. detailInfo: [],
  59. bodystructure: [],
  60. actuatordrivetype:[],
  61. actuatortype:[],
  62. func: [],
  63. };
  64. },
  65. provide() {
  66. return {
  67. bodystructure: () => {
  68. return this.bodystructure;
  69. },
  70. actuatordrivetype: () => {
  71. return this.actuatordrivetype;
  72. },
  73. actuatortype: () => {
  74. return this.actuatortype;
  75. },
  76. func: () => {
  77. return this.func;
  78. },
  79. };
  80. },
  81. methods: {
  82. async queryMainData(id) {
  83. const res = await this.$api.requested({
  84. id:2024060513424502,
  85. content: {
  86. itemid: this.$route.query.id,
  87. },
  88. });
  89. this.mainData = res.data;
  90. console.log(this.mainData,'详情');
  91. this.changeDataStructure();
  92. },
  93. changeDataStructure() {
  94. let that = this
  95. this.mainAreaData = [
  96. {
  97. label: "执行器料号",
  98. value: this.mainData.itemno,
  99. },
  100. {
  101. label: "名称",
  102. value: this.mainData.itemname,
  103. },
  104. {
  105. label: "转速",
  106. value: this.mainData.speed,
  107. },
  108. {
  109. label: "法兰号",
  110. value: this.mainData.flh.join('-'),
  111. },
  112. {
  113. label: "品牌",
  114. value: this.mainData.actuatorbrand,
  115. },
  116. {
  117. label: "系列",
  118. value: this.mainData.actuatorseries,
  119. },
  120. {
  121. label: "牌价",
  122. value: this.tool.formatAmount(this.mainData.marketprice,2),
  123. },
  124. {
  125. label: "状态",
  126. value:this.mainData.status,
  127. style:function () {
  128. let style = {}
  129. switch (that.mainData.status) {
  130. case '新建':
  131. style = {color:"#000000"}
  132. break;
  133. case '审核':
  134. style = {color:"#52C41A"}
  135. break;
  136. default:
  137. break;
  138. }
  139. return style
  140. }
  141. },
  142. ];
  143. this.detailInfo = [
  144. {
  145. title: "基本信息",
  146. info: [
  147. {
  148. label: "执行器料号",
  149. value: this.mainData.itemno,
  150. },
  151. {
  152. label: "名称",
  153. value: this.mainData.itemname,
  154. },
  155. {
  156. label: "执行器类型",
  157. value: this.mainData.actuatortype,
  158. },
  159. {
  160. label: "执行器驱动类型",
  161. value: this.mainData.actuatordrivetype,
  162. },
  163. {
  164. label: "电源电压",
  165. value: this.mainData.supplyvoltage,
  166. },
  167. {
  168. label: "转速",
  169. value: this.mainData.speed,
  170. },
  171. {
  172. label: "法兰号",
  173. value: this.mainData.flh.join('-'),
  174. },
  175. {
  176. label: "重量",
  177. value: this.mainData.weight,
  178. },
  179. {
  180. label: "说明",
  181. value: this.mainData.remarks,
  182. },
  183. {
  184. label: "品牌",
  185. value: this.mainData.actuatorbrand,
  186. },
  187. {
  188. label: "型号",
  189. value: this.mainData.model,
  190. },
  191. {
  192. label: "手轮速比",
  193. value: this.mainData.handwheelratio,
  194. },
  195. {
  196. label: "扭矩",
  197. value: this.mainData.torque,
  198. },
  199. {
  200. label: "额定功率",
  201. value: this.mainData.ratedpower,
  202. },
  203. {
  204. label: "额定电流",
  205. value: this.mainData.ratedcurrent,
  206. },
  207. {
  208. label: "90°最大运行时间",
  209. value: this.mainData.maxruntime,
  210. },
  211. {
  212. label: "圆阀杆最大直径",
  213. value: this.mainData.maxrounddiameter,
  214. },
  215. {
  216. label: "方阀杆最大宽度",
  217. value: this.mainData.maxsquarewidth.join('-'),
  218. },
  219. {
  220. label: "结构",
  221. value: this.mainData.bodystructure,
  222. },
  223. {
  224. label: "功能",
  225. value: this.mainData.func,
  226. },
  227. {
  228. label: "备注",
  229. value: this.mainData.remarks,
  230. },
  231. {
  232. label: "牌价",
  233. value: this.tool.formatAmount(this.mainData.marketprice,2),
  234. },
  235. {
  236. label: "状态",
  237. value:this.mainData.status,
  238. style:function () {
  239. let style = {}
  240. switch (that.mainData.status) {
  241. case '新建':
  242. style = {color:"#000000"}
  243. break;
  244. case '审核':
  245. style = {color:"#52C41A"}
  246. break;
  247. default:
  248. break;
  249. }
  250. return style
  251. }
  252. },
  253. ],
  254. },
  255. {
  256. title: "系统信息",
  257. info: [
  258. { label: "创建人", value: this.mainData.createby },
  259. { label: "创建时间", value: this.mainData.createdate },
  260. { label: "最近编辑人", value: this.mainData.changeby },
  261. { label: "最近编辑时间", value: this.mainData.changedate },
  262. { label: "审核人", value: this.mainData.checkby },
  263. { label: "审核时间", value: this.mainData.checkdate },
  264. ],
  265. },
  266. ];
  267. console.log(this.mainAreaData);
  268. },
  269. optionList() {
  270. this.$store.dispatch("optiontypeselect", "bodystructure").then((res) => {
  271. this.bodystructure = res.data;
  272. console.log(this.bodystructure, "结构");
  273. });
  274. this.$store.dispatch("optiontypeselect", "func").then((res) => {
  275. this.func = res.data;
  276. console.log(this.func, "功能");
  277. });
  278. this.$store.dispatch("optiontypeselect", "actuatortype").then((res) => {
  279. this.actuatortype = res.data;
  280. console.log(this.actuatortype, "执行器类型");
  281. });
  282. this.$store.dispatch("optiontypeselect", "actuatordrivetype").then((res) => {
  283. this.actuatordrivetype = res.data;
  284. console.log(this.actuatordrivetype, "执行器驱动类型");
  285. });
  286. },
  287. // 监听切换数据,上一页,下一页
  288. pageChange(id, rowindex, tabIndex) {
  289. this.flag = false;
  290. tabIndex = this.$route.query.tabIndex;
  291. this.$router.replace({
  292. path: "/executeDetail",
  293. query: { id: id, rowindex: rowindex, tabIndex: tabIndex },
  294. });
  295. this.queryMainData(id);
  296. },
  297. onSuccess() {
  298. this.visible = false;
  299. this.queryMainData(this.$route.query.id);
  300. this.$emit("onSuccess");
  301. },
  302. },
  303. created() {
  304. this.optionList()
  305. this.queryMainData(this.$route.query.id)
  306. },
  307. };
  308. </script>
  309. <style scoped>
  310. </style>