setOrderCalc.vue 9.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220
  1. <template>
  2. <table bgcolor="#FAFAFA" cellpadding="0" style="width: 100%;" class="result">
  3. <tr style="width: 100px;">
  4. <td class="title">{{$t('光头')}}</td>
  5. <td>
  6. <div class="text1" v-if="!resultArr[0].itemname && !resultArr[0].actuatorbrand">-</div>
  7. <div v-else>
  8. <div class="text1" style="margin-bottom: 8px;">
  9. <el-tag style="margin-right: 10px;" size="small" type="warning">{{ resultArr[0] && resultArr[0].actuatorbrand || '无品牌' }}</el-tag>
  10. <span>{{ resultArr[0] && resultArr[0].itemname || '无'}}</span>
  11. </div>
  12. <div class="descript">
  13. <div class="item" v-if="resultArr.length && resultArr[0].itemno"><span style="color: #888888;">{{$t('料号')}}:</span>{{resultArr[0].itemno }}</div>
  14. <div class="item" v-if="resultArr.length && resultArr[0].torque"><span style="color: #888888;">{{$t('扭矩')}}:</span>{{resultArr[0].torque }}</div>
  15. <div class="item" v-if="resultArr.length && resultArr[0].flh"><span style="color: #888888;">{{$t('法兰号')}}:</span>{{resultArr[0].flh.join('-') }}</div>
  16. <div class="item" v-if="resultArr.length && resultArr[0].caliber"><span style="color: #888888;">{{$t('公称通径')}}:</span>{{resultArr[0].caliber }}</div>
  17. <div class="item" v-if="resultArr.length && resultArr[0].nominalpressure"><span style="color: #888888;">{{$t('公称压力')}}:</span>{{ tool.nominalPressureSet(resultArr[0].nominalpressure) }}</div>
  18. <div class="item" v-if="resultArr.length && resultArr[0].stemmaterial"><span style="color: #888888;">{{$t('阀杆材质')}}:</span>{{resultArr[0].stemmaterial }}</div>
  19. <div class="item" v-if="resultArr.length && resultArr[0].mainmaterial"><span style="color: #888888;">{{$t('主体材质')}}:</span>{{resultArr[0].mainmaterial }}</div>
  20. </div>
  21. </div>
  22. </td>
  23. </tr>
  24. <tr>
  25. <td class="title">{{$t('节流件')}}</td>
  26. <td>
  27. <div class="text1" style="margin-bottom: 8px;">
  28. <el-tag style="margin-right: 10px;" size="small" type="warning">{{ resultArr[1] && resultArr[1].actuatorbrand || '无品牌' }}</el-tag>
  29. <span>{{ resultArr[1].itemname || '无' }}</span>
  30. </div>
  31. <div class="descript">
  32. <!-- <div class="item" v-if="resultArr.length >= 2 && resultArr[1].actuatorname"><span style="color: #888888;">{{$t('执行器名称')}}:</span>{{resultArr[1].actuatorname }}</div> -->
  33. <div class="item" v-if="resultArr.length >= 2 && resultArr[1].itemno"><span style="color: #888888;">{{$t('节流件料号')}}:</span>{{resultArr[1].itemno }}</div>
  34. <div class="item" v-if="resultArr.length >= 2 && resultArr[1].itemname"><span style="color: #888888;">{{$t('节流件类型')}}:</span>{{resultArr[1].throttletype }}</div>
  35. <div class="item" v-if="resultArr.length >= 2 && resultArr[1].itemname"><span style="color: #888888;">{{$t('Kv100')}}:</span>{{resultArr[1].kv100 }}</div>
  36. </div>
  37. </td>
  38. </tr>
  39. <!-- <tr>
  40. <td class="title">{{$t('辅件')}}</td>
  41. <td style="padding: 0;">
  42. <tr style="border-bottom: 1px solid #DDDDDD;" class="custom-table">
  43. <div style="color: #333333;">{{$t('定位器')}}</div>
  44. <div class="text1">
  45. <el-tag style="margin-right: 10px;" size="small" type="warning" v-if="resultArr.filter(item => item.itemname == '定位器').length ">{{resultArr.filter(item => item.itemname == '定位器')[0].actuatorbrand }}</el-tag>
  46. <span>{{ resultArr.filter(item => item.itemname == '定位器').length ? resultArr.filter(item => item.itemname == '定位器')[0].model : '-' }}</span>
  47. </div>
  48. <div style="color: #333333;">{{$t('电磁阀')}}</div>
  49. <div class="text1">
  50. <el-tag style="margin-right: 10px;" size="small" type="warning" v-if="resultArr.filter(item => item.itemname == '电磁阀').length ">{{resultArr.filter(item => item.itemname == '电磁阀')[0].actuatorbrand }}</el-tag>
  51. <span>{{ resultArr.filter(item => item.itemname == '电磁阀').length ? resultArr.filter(item => item.itemname == '电磁阀')[0].model : '-' }}</span>
  52. </div>
  53. </tr>
  54. <tr class="custom-table">
  55. <div style="color: #333333;">{{$t('限位开关')}}</div>
  56. <div class="text1">
  57. <el-tag style="margin-right: 10px;" size="small" type="warning" v-if="resultArr.filter(item => item.itemname == '限位开关').length ">{{resultArr.filter(item => item.itemname == '限位开关')[0].actuatorbrand }}</el-tag>
  58. <span>{{ resultArr.filter(item => item.itemname == '限位开关').length ? resultArr.filter(item => item.itemname == '限位开关')[0].model : '-' }}</span>
  59. </div>
  60. <div style="color: #333333;">{{$t('过滤减压阀')}}</div>
  61. <div class="text1">
  62. <el-tag style="margin-right: 10px;" size="small" type="warning" v-if="resultArr.filter(item => item.itemname == '过滤减压阀').length ">{{resultArr.filter(item => item.itemname == '过滤减压阀')[0].actuatorbrand }}</el-tag>
  63. <span>{{ resultArr.filter(item => item.itemname == '过滤减压阀').length ? resultArr.filter(item => item.itemname == '过滤减压阀')[0].model : '-' }}</span>
  64. </div>
  65. </tr>
  66. </td>
  67. </tr> -->
  68. <tr>
  69. <td class="title">{{$t('成品料号')}}</td>
  70. <td class="text1" style="height: 100%;"><span>{{ Object.keys(product).length ? product.itemno||'-' : '' }}</span></td>
  71. </tr>
  72. <tr>
  73. <td class="title">{{$t(product.itemno?'牌价':'最低经销价')}}</td>
  74. <td class="text2">
  75. ¥{{ Object.keys(product).length ? tool.formatAmount(product.price,2) : 'xxxxxx' }}
  76. <div style="color:#1C1919;font-weight: normal;font-size: 12px;">*{{$t('非标准产品,当前价格仅供参考')}}!</div>
  77. </td>
  78. </tr>
  79. </table>
  80. </template>
  81. <script>
  82. export default {
  83. data () {
  84. return {
  85. resultArr:[],
  86. product:{}
  87. }
  88. },
  89. methods: {
  90. listData () {
  91. this.$api.requested({
  92. "id": 20240718162002,
  93. "content": {
  94. "sa_lectotypecfgid": this.$route.query.id
  95. },
  96. }).then(res => {
  97. console.log("123123321",res)
  98. this.resultArr = res.data
  99. // 判断数组中是否存在parttype为'主阀'的项,如果没有则在第一行插入一条空数据
  100. const hasMainValve = this.resultArr.some(item => item.parttype === '主阀')
  101. if (!hasMainValve) {
  102. this.resultArr.unshift({
  103. parttype: '主阀',
  104. actuatorbrand: '',
  105. itemname: '',
  106. itemno: '',
  107. torque: '',
  108. flh: [],
  109. caliber: '',
  110. nominalpressure: '',
  111. stemmaterial: '',
  112. mainmaterial: '',
  113. itemid: ''
  114. })
  115. }
  116. this.$api.requested({
  117. "id": 2024071916224702,
  118. "content": {
  119. "part_itemids": this.resultArr.map(item => {
  120. return {
  121. parttype:item.parttype,
  122. itemid:item.itemid
  123. }
  124. })
  125. },
  126. }).then(res => {
  127. this.product = res.data
  128. })
  129. })
  130. }
  131. },
  132. created () {
  133. this.listData()
  134. }
  135. }
  136. </script>
  137. <style scoped>
  138. .descript {
  139. font-size:12px;
  140. color:red;
  141. display: flex;
  142. flex-wrap: wrap;
  143. }
  144. table,td,tr {
  145. border-collapse: collapse;
  146. }
  147. td {
  148. padding: 10px;
  149. }
  150. table,td {
  151. border: 1px solid #DDDDDD;
  152. }
  153. .result{
  154. margin-top: 10px;
  155. }
  156. .result .title {
  157. font-family: Source Han Sans SC, Source Han Sans SC;
  158. font-weight: bold;
  159. font-size: 16px;
  160. color: #333333;
  161. padding: 10px;
  162. min-width: 120px;
  163. }
  164. .custom-table {
  165. border: none;
  166. display: flex;
  167. height: 64px;
  168. align-items: center;
  169. align-content: center;
  170. }
  171. .custom-table div{
  172. border-right: 1px solid #DDDDDD;
  173. height: 100%;
  174. display: flex;
  175. align-items: center;
  176. align-content: center;
  177. padding-left: 20px;
  178. }
  179. .custom-table div:nth-child(1) {
  180. width: 120px;
  181. }
  182. .custom-table div:nth-child(2) {
  183. flex: 1;
  184. }
  185. .custom-table div:nth-child(3) {
  186. width: 120px;
  187. }
  188. .custom-table div:nth-child(4) {
  189. flex: 1;
  190. }
  191. .descript {
  192. display: flex;
  193. }
  194. .descript .item {
  195. font-family: Source Han Sans SC, Source Han Sans SC;
  196. font-weight: 400;
  197. font-size: 14px;
  198. color: #333333;
  199. margin-right: 40px;
  200. }
  201. .descript .item:last-child {
  202. margin-right: 0 !important;
  203. }
  204. .text1 {
  205. font-family: Source Han Sans SC, Source Han Sans SC;
  206. font-weight: bold;
  207. font-size: 16px;
  208. color: #3874F6;
  209. }
  210. .text2 {
  211. font-family: Source Han Sans SC, Source Han Sans SC;
  212. font-weight: bold;
  213. font-size: 16px;
  214. color: #E80000;
  215. }
  216. </style>