index.vue 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228
  1. <template>
  2. <div>
  3. <basicDetails
  4. ref="details"
  5. :titleText="mainData.itemname"
  6. :oldFormPath="{ edit: 'optionSystem/otherFileManage/modules' }"
  7. :editData="mainData"
  8. :mainAreaData="mainAreaData"
  9. turnPageId="20240605145002"
  10. delApiId="20240605144802"
  11. idname="itemid"
  12. ownertable="plm_item"
  13. tags=""
  14. :tabs="['基本信息']"
  15. :statusCheck="[{key:'lectotypestatus',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="20240605144902"
  25. keyName="itemids"
  26. :id="[$route.query.id]"
  27. :paramData="[{key:'ischeck',value:1}]"
  28. @onSuccess="queryMainData()"
  29. v-if="mainData.lectotypestatus == '新建' && tool.checkAuth($route.name,'check')"
  30. />
  31. <customBtn
  32. class="inline-16"
  33. btnName="反审核"
  34. message="确定反审核当前辅件吗?"
  35. idName="20240605144902"
  36. keyName="itemids"
  37. :id="[$route.query.id]"
  38. :paramData="[{key:'ischeck',value:0}]"
  39. @onSuccess="queryMainData()"
  40. v-if="mainData.lectotypestatus == '审核' && 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. othertype:[]
  60. };
  61. },
  62. provide() {
  63. return {
  64. othertype: () => {
  65. return this.othertype;
  66. },
  67. };
  68. },
  69. methods: {
  70. async queryMainData(id) {
  71. const res = await this.$api.requested({
  72. id:20240605144702,
  73. content: {
  74. itemid: this.$route.query.id,
  75. },
  76. });
  77. this.mainData = res.data;
  78. console.log(this.mainData,'详情');
  79. this.changeDataStructure();
  80. },
  81. changeDataStructure() {
  82. let that = this
  83. this.mainAreaData = [
  84. {
  85. label: "辅件料号",
  86. value: this.mainData.itemno,
  87. },
  88. {
  89. label: "名称",
  90. value: this.mainData.itemname,
  91. },
  92. {
  93. label: "品牌",
  94. value: this.mainData.actuatorbrand,
  95. },
  96. {
  97. label: "辅件类型",
  98. value: this.mainData.othertype,
  99. },
  100. {
  101. label: "规格",
  102. value: this.mainData.spec,
  103. },
  104. {
  105. label: "品牌",
  106. value: this.mainData.actuatorbrand,
  107. },
  108. {
  109. label: "价格",
  110. value: this.tool.formatAmount(this.mainData.marketprice,2),
  111. },
  112. {
  113. label: "状态",
  114. value:this.mainData.lectotypestatus,
  115. style:function () {
  116. let style = {}
  117. switch (that.mainData.lectotypestatus) {
  118. case '新建':
  119. style = {color:"#000000"}
  120. break;
  121. case '审核':
  122. style = {color:"#52C41A"}
  123. break;
  124. default:
  125. break;
  126. }
  127. return style
  128. }
  129. },
  130. ];
  131. this.detailInfo = [
  132. {
  133. title: "基本信息",
  134. info: [
  135. {
  136. label: "辅件料号",
  137. value: this.mainData.itemno,
  138. },
  139. {
  140. label: "名称",
  141. value: this.mainData.itemname,
  142. },
  143. {
  144. label: "辅件类型",
  145. value: this.mainData.othertype,
  146. },
  147. {
  148. label: "规格",
  149. value: this.mainData.spec,
  150. },
  151. {
  152. label: "品牌",
  153. value: this.mainData.actuatorbrand,
  154. },
  155. {
  156. label: "价格",
  157. value: this.tool.formatAmount(this.mainData.marketprice,2),
  158. },
  159. {
  160. label: "备注",
  161. value: this.mainData.remarks,
  162. },
  163. {
  164. label: "状态",
  165. value:this.mainData.lectotypestatus,
  166. style:function () {
  167. let style = {}
  168. switch (that.mainData.lectotypestatus) {
  169. case '新建':
  170. style = {color:"#000000"}
  171. break;
  172. case '审核':
  173. style = {color:"#52C41A"}
  174. break;
  175. default:
  176. break;
  177. }
  178. return style
  179. }
  180. },
  181. ],
  182. },
  183. {
  184. title: "系统信息",
  185. info: [
  186. { label: "创建人", value: this.mainData.createby },
  187. { label: "创建时间", value: this.mainData.createdate },
  188. { label: "最近编辑人", value: this.mainData.changeby },
  189. { label: "最近编辑时间", value: this.mainData.changedate },
  190. { label: "审核人", value: this.mainData.checkby },
  191. { label: "审核时间", value: this.mainData.checkdate },
  192. ],
  193. },
  194. ];
  195. console.log(this.mainAreaData);
  196. },
  197. // 监听切换数据,上一页,下一页
  198. pageChange(id, rowindex, tabIndex) {
  199. this.flag = false;
  200. tabIndex = this.$route.query.tabIndex;
  201. this.$router.replace({
  202. path: "/otherFileDetail",
  203. query: { id: id, rowindex: rowindex, tabIndex: tabIndex },
  204. });
  205. this.queryMainData(id);
  206. },
  207. onSuccess() {
  208. this.visible = false;
  209. this.queryMainData(this.$route.query.id);
  210. this.$emit("onSuccess");
  211. },
  212. optionList() {
  213. this.$store.dispatch("optiontypeselect", "othertype").then((res) => {
  214. this.othertype = res.data;
  215. console.log(this.othertype, "辅件类型");
  216. });
  217. },
  218. },
  219. created() {
  220. this.optionList()
  221. this.queryMainData(this.$route.query.id)
  222. },
  223. };
  224. </script>
  225. <style scoped>
  226. </style>