DieFa.vue 46 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034
  1. <template>
  2. <div style="display: flex;height: 100vh">
  3. <Aside :resultArr="resultArr" :fujianArr="fujianArr" @refresh="resultRefresh"></Aside>
  4. <div class="drawer__panel">
  5. <div class="my-steps">
  6. <a-steps :current="active-1" style="margin-bottom: 10px;">
  7. <a-step :title="item.title" v-for="(item,index) in items" :key="index">
  8. <i slot="icon" class="iconfont" style="font-size: 32px;color: #3874F6 !important" v-if="active > index+1">&#xe6fd;</i>
  9. </a-step>
  10. </a-steps>
  11. </div>
  12. <!--选光头-->
  13. <div class="dialog-content" v-show="active == 1">
  14. <div class="option-line">
  15. <div class="item">
  16. <div class="label">驱动方式:</div>
  17. <MySelect :isClear="false" @click="$event => {guangtouChange($event);Search('guangtouParam','drivetype')}" :options="drivetype" v-model="guangtouParam.content.where.drivetype"></MySelect>
  18. </div>
  19. </div>
  20. <div class="option-line">
  21. <div class="item">
  22. <div class="label">公称通径:</div>
  23. <el-select filterable v-model="guangtouParam.content.where.caliber" placeholder="请选择公称通径" size="small" style="width:100%" clearable @change="Search('guangtouParam','caliber')">
  24. <el-option v-for="item in caliber" :key="item.value" :value="item.value" :label="item.value"></el-option>
  25. </el-select>
  26. </div>
  27. <div class="item">
  28. <div class="label">公称压力:</div>
  29. <el-select filterable @change="Search('guangtouParam','nominalpressure')" :disabled="!guangtouParam.content.where.caliber" v-model="guangtouParam.content.where.nominalpressure" placeholder="请选择公称压力" size="small" style="width:100%" clearable>
  30. <el-option v-for="item in nominalpressure" :key="item.value" :value="item.value" :label="item.remarks"></el-option>
  31. </el-select>
  32. </div>
  33. </div>
  34. <div class="option-line">
  35. <div class="item">
  36. <div class="label">连接方式:</div>
  37. <MySelect @click="Search('guangtouParam','connection')" :disabled="!guangtouParam.content.where.nominalpressure" :options="connection" v-model="guangtouParam.content.where.connection"></MySelect>
  38. </div>
  39. </div>
  40. <div class="option-line">
  41. <div class="item">
  42. <div class="label">阀体材质:</div>
  43. <el-select filterable @change="Search('guangtouParam','bodymaterial')" :disabled="!guangtouParam.content.where.connection" v-model="guangtouParam.content.where.bodymaterial" placeholder="请选择阀体材质" size="small" style="width:100%" clearable>
  44. <el-option v-for="item in bodymaterial" :key="item.value" :value="item.value" :label="item.remarks"></el-option>
  45. </el-select>
  46. </div>
  47. <div class="item">
  48. <div class="label">阀杆材质:</div>
  49. <el-select filterable @change="Search('guangtouParam','stemmaterial')" :disabled="!guangtouParam.content.where.bodymaterial" v-model="guangtouParam.content.where.stemmaterial" placeholder="请选择阀杆材质" size="small" style="width:100%" clearable>
  50. <el-option v-for="item in stemmaterial" :key="item.value" :value="item.value" :label="item.remarks"></el-option>
  51. </el-select>
  52. </div>
  53. <div class="item">
  54. <div class="label">阀座材质:</div>
  55. <el-select filterable @change="Search('guangtouParam','plinthmaterial')" :disabled="!guangtouParam.content.where.stemmaterial" v-model="guangtouParam.content.where.plinthmaterial" placeholder="请选择阀座材质" size="small" style="width:100%" clearable>
  56. <el-option v-for="item in plinthmaterial" :key="item.value" :value="item.value" :label="item.remarks"></el-option>
  57. </el-select>
  58. </div>
  59. </div>
  60. <!--光头-->
  61. <MyTable :height="tableHeight" ref="guangtouRef" :layout="tool.tabelCol($route.name)['guangtouTable'].tablecols" :param="guangtouParam" :opwidth="200" :custom="true" style="margin-top: 14px">
  62. <template v-slot:customcol="scope">
  63. <span v-if="scope.column.columnname != 'operation'">{{scope.column.data[scope.column.columnname]}}</span>
  64. </template>
  65. <template v-slot:opreation="scope">
  66. <el-button type="text" size="mini" @click="selectTarget(scope.data,'主阀')" :disabled="!guangtouParam.content.where.drivetype">选择</el-button>
  67. </template>
  68. </MyTable>
  69. </div>
  70. <!--选执行器-->
  71. <div class="dialog-content" v-show="active == 2">
  72. <div class="option-line" v-if="guangtouParam.content.where.drivetype=='气动'">
  73. <div class="item">
  74. <div class="label">驱动方式:</div>
  75. <MySelect :isClear="false" :options="[{remarks:'气动调节',value:'气动调节'},{remarks:'气动开关',value:'气动开关'}]" v-model="excelParam.content.where.drivetype"></MySelect>
  76. </div>
  77. </div>
  78. <div class="option-line" v-if="guangtouParam.content.where.drivetype=='电动'">
  79. <div class="item">
  80. <div class="label">驱动方式:</div>
  81. <MySelect @click="Search('excelParam','actuatordrivetype');calcTableHieght('excelRef')" :options="[{remarks:'电动开关',value:'电动开关'},{remarks:'电动调节',value:'电动调节'}]" v-model="excelParam.content.where.actuatordrivetype"></MySelect>
  82. </div>
  83. </div>
  84. <div class="option-line" v-if="guangtouParam.content.where.drivetype=='电动'">
  85. <div class="item">
  86. <div class="label">品牌:</div>
  87. <MySelect @click="Search('excelParam','actuatorbrand');calcTableHieght('excelRef')" :disabled="!excelParam.content.where.actuatordrivetype" :options="actuatorbrand" v-model="excelParam.content.where.actuatorbrand"></MySelect>
  88. </div>
  89. </div>
  90. <div class="option-line" v-else>
  91. <div class="item">
  92. <div class="label">品牌:</div>
  93. <MySelect @click="Search('excelParam','actuatorbrand')" :options="actuatorbrand" v-model="excelParam.content.where.actuatorbrand"></MySelect>
  94. </div>
  95. </div>
  96. <div v-if="guangtouParam.content.where.drivetype == '电动' && excelParam.content.where.actuatorbrand && actuatorname.length">
  97. <div class="option-line">
  98. <div class="item">
  99. <div class="label" style="width: 80px;">执行器类型:</div>
  100. <span style="font-size: 14px;font-weight: bold;color:#3874F6">{{ excelParam.content.where.actuatorname || '--' }}</span>
  101. </div>
  102. </div>
  103. <SelectBar style="margin: 20px 0" v-model="excelParam.content.where.actuatorname" :options="actuatorname.map(v => {return {url:v.url,remarks:v.remarks.split('-').pop(),value:v.remarks}})" @change="Search('excelParam','actuatorname')"></SelectBar>
  104. </div>
  105. <div class="option-line" v-if="guangtouParam.content.where.drivetype=='电动'">
  106. <div class="item">
  107. <div class="label">电源电压:</div>
  108. <MySelect @click="Search('excelParam','supplyvoltage')" :disabled="!excelParam.content.where.actuatorname" :options="supplyvoltage" v-model="excelParam.content.where.supplyvoltage"></MySelect>
  109. </div>
  110. <div class="item">
  111. <div class="label">信号类型:</div>
  112. <MySelect @click="Search('excelParam','actuatorsignal')" :disabled="!excelParam.content.where.supplyvoltage" :options="actuatorsignal" v-model="excelParam.content.where.actuatorsignal"></MySelect>
  113. </div>
  114. </div>
  115. <div class="option-line" v-show="guangtouParam.content.where.drivetype=='气动'">
  116. <div class="item">
  117. <div class="label">功能:</div>
  118. <MySelect :disabled="!excelParam.content.where.actuatorname" @click="Search('excelParam','func')" :options="func" v-model="excelParam.content.where.func"></MySelect>
  119. </div>
  120. </div>
  121. <div class="option-line" v-show="guangtouParam.content.where.drivetype=='气动'">
  122. <div class="item">
  123. <div class="label">结构:</div>
  124. <MySelect :disabled="!excelParam.content.where.func" @click="Search('excelParam','bodystructure')" :options="bodystructure" v-model="excelParam.content.where.bodystructure"></MySelect>
  125. </div>
  126. </div>
  127. <div class="tips" v-if="guangtouParam.content.where.drivetype=='电动' && resultArr.length" style="color:#3874F6;margin-top: 10px;"><i class="el-icon-warning" style="margin-right: 5px;"></i>建议开关阀时间{{ caliber.filter(v=>v.value==resultArr[0].caliber).length ? caliber.filter(v=>v.value==resultArr[0].caliber)[0].remarks:'-' }}秒</div>
  128. <!--执行器-->
  129. <MyTable fixedName="operation" :height="tableHeight" :noQuery="true" ref="excelRef" :tableName="guangtouParam.content.where.drivetype=='电动'?'excelTable1':'excelTable2'" :layout="guangtouParam.content.where.drivetype=='电动'?tool.tabelCol($route.name)['excelTable1'].tablecols:tool.tabelCol($route.name)['excelTable2'].tablecols" :param="excelParam" :opwidth="200" :custom="true" style="margin-top: 14px">
  130. <template v-slot:customcol="scope">
  131. <span v-if="scope.column.columnname == 'matchratio'" style="color:red">{{scope.column.data[scope.column.columnname]}}</span>
  132. <span v-else-if="scope.column.columnname == 'maxsquarewidth'">{{scope.column.data[scope.column.columnname].join(',')}}</span>
  133. <span v-else-if="scope.column.columnname != 'operation'">{{scope.column.data[scope.column.columnname]}}</span>
  134. </template>
  135. <template v-slot:opreation="scope">
  136. <el-button type="text" size="mini" @click="selectTarget(scope.data,'执行器')" :disabled="(loading) || (guangtouParam.content.where.drivetype=='电动' && resultArr.length == 2)">选择</el-button>
  137. </template>
  138. </MyTable>
  139. </div>
  140. <!--选辅件-->
  141. <div class="dialog-content" v-show="active == 3">
  142. <MyTable :noQuery="true" ref="fujianRef" :height="tableHeight" :layout="tool.tabelCol($route.name)['itemList'].tablecols" :param="fujianParam" :opwidth="200" :custom="true" style="margin-top: 14px">
  143. <template v-slot:customcol="scope">
  144. <span v-if="scope.column.columnname != 'operation'">{{scope.column.data[scope.column.columnname]}}</span>
  145. </template>
  146. <template v-slot:opreation="scope">
  147. <el-button type="text" size="mini" @click="selectTarget(scope.data,'辅件')" :disabled="loading">选择</el-button>
  148. </template>
  149. </MyTable>
  150. </div>
  151. <div class="dialog-content" v-if="active == 4">
  152. <table bgcolor="#FAFAFA" cellpadding="0" style="width: 100%;" class="result">
  153. <tr style="width: 100px;">
  154. <td class="title">光头</td>
  155. <td>
  156. <div class="text1" style="margin-bottom: 8px;">{{ resultArr[0] && resultArr[0].itemname}}</div>
  157. <div class="descript">
  158. <div class="item" v-if="resultArr.length && resultArr[0].itemno"><span style="color: #888888;">料号:</span>{{resultArr[0].itemno }}</div>
  159. <div class="item" v-if="resultArr.length && resultArr[0].torque"><span style="color: #888888;">扭矩:</span>{{resultArr[0].torque }}</div>
  160. <div class="item" v-if="resultArr.length && resultArr[0].flh"><span style="color: #888888;">法兰号:</span>{{resultArr[0].flh }}</div>
  161. <div class="item" v-if="resultArr.length && resultArr[0].caliber"><span style="color: #888888;">公称通径:</span>{{resultArr[0].caliber }}</div>
  162. <div class="item" v-if="resultArr.length && resultArr[0].stemmaterial"><span style="color: #888888;">阀杆材质:</span>{{resultArr[0].stemmaterial }}</div>
  163. <div class="item" v-if="resultArr.length && resultArr[0].mainmaterial"><span style="color: #888888;">主体材质:</span>{{resultArr[0].mainmaterial }}</div>
  164. </div>
  165. </td>
  166. </tr>
  167. <tr>
  168. <td class="title">执行器</td>
  169. <td>
  170. <div class="text1" style="margin-bottom: 8px;">{{ resultArr[1] && resultArr[1].actuatormodel }} {{guangtouParam.content.where.drivetype == '电动' && resultArr[1] && resultArr[1].gearboxname ? ` + 减速箱:${resultArr[1] && resultArr[1].gearboxname}` : '' }}</div>
  171. <div class="descript">
  172. <div class="item" v-if="resultArr.length >= 2 && resultArr[1].torque"><span style="color: #888888;">输出扭矩:</span>{{resultArr[1].torque }}(Nm)</div>
  173. <div class="item" v-if="resultArr.length >= 2 && resultArr[1].maxruntime"><span style="color: #888888;">开关时间:</span>{{resultArr[1].maxruntime }}(s)</div>
  174. <div class="item" v-if="resultArr.length >= 2 && resultArr[1].speed"><span style="color: #888888;">转速:</span>{{resultArr[1].speed }}(rpm)</div>
  175. <div class="item" v-if="resultArr.length >= 2 && resultArr[1].handwheelratio"><span style="color: #888888;">减速比:</span>{{resultArr[1].ratio }}</div>
  176. <div class="item" v-if="resultArr.length >= 2 && resultArr[1].supplyvoltage"><span style="color: #888888;">电压:</span>{{resultArr[1].supplyvoltage }}(V)</div>
  177. <div class="item" v-if="resultArr.length >= 2 && resultArr[1].ratedcurrent"><span style="color: #888888;">电流:</span>{{resultArr[1].ratedcurrent }}(A)</div>
  178. <div class="item" v-if="resultArr.length >= 2 && resultArr[1].ratedpower"><span style="color: #888888;">功率:</span>{{resultArr[1].ratedpower }}(KW)</div>
  179. <div class="item" v-if="resultArr.length >= 2 && resultArr[1].actuatorsignal"><span style="color: #888888;">信号类型:</span>{{resultArr[1].actuatorsignal.join(',') }}</div>
  180. </div>
  181. </td>
  182. </tr>
  183. <tr v-if="fujianArr.length">
  184. <td class="title">辅件</td>
  185. <td style="padding: 0;">
  186. <tr style="border-bottom: 1px solid #DDDDDD;" class="custom-table">
  187. <div>定位器</div>
  188. <div class="text1">{{ resultArr.filter(item => item.itemname == '定位器').length ? resultArr.filter(item => item.itemname == '定位器')[0].model : '-' }}</div>
  189. <div>电磁阀</div>
  190. <div class="text1">{{ resultArr.filter(item => item.itemname == '电磁阀').length ? resultArr.filter(item => item.itemname == '电磁阀')[0].model : '-' }}</div>
  191. </tr>
  192. <tr class="custom-table">
  193. <div>限位开关</div>
  194. <div class="text1">{{ resultArr.filter(item => item.itemname == '限位开关').length ? resultArr.filter(item => item.itemname == '限位开关')[0].model : '-' }}</div>
  195. <div>过滤减压阀</div>
  196. <div class="text1">{{ resultArr.filter(item => item.itemname == '过滤减压阀').length ? resultArr.filter(item => item.itemname == '过滤减压阀')[0].model : '-' }}</div>
  197. </tr>
  198. </td>
  199. </tr>
  200. <tr>
  201. <td class="title">成品料号</td>
  202. <td class="text1">{{ Object.keys(product).length ? product.itemno||'-' : '' }}</td>
  203. </tr>
  204. <tr>
  205. <td class="title">{{product.itemno?'牌价':'预估价格'}}</td>
  206. <td class="text2">¥{{ Object.keys(product).length ? tool.formatAmount(product.price,2) : 'xxxxxx' }}</td>
  207. </tr>
  208. </table>
  209. </div>
  210. <div class="fixed__btn__panel">
  211. <el-button size="small" @click="close" class="normal-btn-width">取 消</el-button>
  212. <el-button size="small" @click="guangtouParam.content.where.drivetype == '电动' ? active = 2 : active = 3" type="primary" v-if="active == 4" class="normal-btn-width">上一步</el-button>
  213. <el-button size="small" type="primary" @click="onSubmit" class="normal-btn-width" v-if="active == 4">确认添加</el-button>
  214. </div>
  215. </div>
  216. </div>
  217. </template>
  218. <script>
  219. import MySelect from '@/optionSystem/FProductManage/modules/select.vue'
  220. import MyTable from '@/optionSystem/FProductManage/modules/table.vue'
  221. import SelectBar from '@/optionSystem/FProductManage/modules/selectBar.vue'
  222. import Aside from '@/optionSystem/FProductManage/modules/aside.vue'
  223. export default {
  224. props:['position'],
  225. components:{MySelect,MyTable,SelectBar,Aside},
  226. inject:['valvetype','detailData'],
  227. data () {
  228. return {
  229. items: [
  230. {title:'选光头',value:'光头'},
  231. {title:'选执行器',value:'执行器'},
  232. {title:'选辅件',value:'辅件'},
  233. {title:'确认配置',value:'配置'}
  234. ],
  235. active:1,
  236. tableHeight:'400px',
  237. excel:'',
  238. gangtou:'',
  239. resultArr:[],
  240. caliber:[],
  241. nominalpressure:[],
  242. connection:[],
  243. bodymaterial:[],
  244. stemmaterial:[],
  245. plinthmaterial:[],
  246. actuatorbrand:[],
  247. actuatorsignal:[],
  248. supplyvoltage:[],
  249. actuatorname:[],
  250. actuatordrivetype:[],
  251. drivetype:[],
  252. bodystructure:[],
  253. func:[],
  254. guangtouList:[],
  255. isFujianShow:false,//辅件是否显示
  256. form: {
  257. "itemid": 0,
  258. "plm_itemextendid": 0,
  259. "valvetype": "蝶阀", //阀门类型(固定)
  260. "itemno": "", //产品编码(必填,唯一)
  261. "itemname": "", //产品名称(必填)
  262. "erpitemno": "", //erp品号(必填)
  263. "erpitemname": "", //erp品名(必填)
  264. "spec": "", //规格尺寸(必填)
  265. "model": "", //型号(必填)
  266. "material": "", //材质(必填,选项)
  267. "marketprice": '',
  268. "caliber": "", //公称通径
  269. "nominalpressure": [
  270. ], //公称压力
  271. "connection": "",
  272. "drivetype": [
  273. ], //驱动方式
  274. "valveplatematerial": "",
  275. "bodymaterial": "",
  276. "stemmaterial": "",
  277. "plinthmaterial": "",
  278. "torque": "", //
  279. "maxruntime": "", //90°最大运行时间
  280. "actuatorbrand":"",//执行器品牌
  281. "actuatordrivetype":"",//执行器类型
  282. "part_itemids": [
  283. ]
  284. },
  285. guangtouParam: {
  286. "id": 20240718162102,
  287. "content": {
  288. "pageNumber": 1,
  289. "pageSize": 30,
  290. "where": {
  291. "condition": "",
  292. "caliber": "", //公称通径
  293. "nominalpressure": "", //公称压力
  294. "connection": "", //连接方式
  295. "bodymaterial": "", //阀体材质
  296. "stemmaterial": "", //阀杆材质
  297. "plinthmaterial": "", //阀座材质
  298. "drivetype": "电动" //驱动方式
  299. }
  300. },
  301. },
  302. excelList:[],
  303. excelParam: {
  304. "id": 20240718162202,
  305. "content": {
  306. "itemid": "",//光头id
  307. "pageNumber": 1,
  308. "pageSize": 30,
  309. "where": {
  310. "actuatordrivetype": "电动开关", //驱动方式
  311. "condition1": "",
  312. "condition2": "",
  313. "torque": "", //阀门扭矩
  314. "flh": "", //法兰号
  315. "actuatorbrand": "", //品牌
  316. "actuatorname":'',
  317. "supplyvoltage":'',
  318. "actuatorsignal":'',
  319. "maxsquarewidth": "", //方阀杆最大宽度
  320. "maxrounddiameter": "" //圆阀杆最大直径
  321. }
  322. },
  323. },
  324. fujianList:[],
  325. fujianArr:[],
  326. loading:false,
  327. fujianParam: {
  328. "id": 20240718162402,
  329. "content": {
  330. "othertypes": [
  331. ],
  332. "pageNumber": 1,
  333. "pageSize": 300,
  334. "where": {
  335. "actuatorbrand": "" //品牌
  336. }
  337. },
  338. },
  339. timer:null,
  340. product:{}
  341. }
  342. },
  343. watch: {
  344. active (val) {
  345. switch (val) {
  346. case 1:
  347. this.calcTableHieght('guangtouRef')
  348. break;
  349. case 2:
  350. this.calcTableHieght('excelRef')
  351. break;
  352. case 3:
  353. this.calcTableHieght('fujianRef')
  354. break;
  355. default:
  356. break;
  357. }
  358. if (val == 4) {
  359. if (this.guangtouParam.content.where.drivetype == '电动') {
  360. if (this.resultArr[1].gearboxid) this.resultArr.push({parttype:'减速箱',itemid:this.resultArr[1].gearboxid,itemname:this.resultArr[1].gearboxname,actuatorbrand:this.resultArr[1].gearboxbrand})
  361. }
  362. this.$api.requested({
  363. "id": 2024071916224702,
  364. "content": {
  365. "sa_projectid": this.detailData().sa_projectid,
  366. "part_itemids": this.resultArr.map(item => {
  367. return {
  368. parttype:item.parttype,
  369. itemid:item.itemid
  370. }
  371. })
  372. },
  373. }).then(res => {
  374. this.product = res.data
  375. })
  376. }
  377. }
  378. },
  379. methods: {
  380. resultRefresh (type) {
  381. if (type == '光头') {
  382. this.active=1
  383. this.resultArr=[]
  384. this.fujianArr=[]
  385. this.items.splice(2,1)
  386. } else if (type == '执行器') {
  387. this.active=2
  388. this.resultArr.splice(1)
  389. this.fujianArr=[]
  390. } else {
  391. this.fujianArr=[]
  392. this.active = 3
  393. this.fujianParam.content.othertypes = ['电磁阀','限位开关','过滤减压阀']
  394. this.$refs.fujianRef.listData()
  395. }
  396. },
  397. close () {
  398. this.active = 1
  399. this.guangtouParam.content.where.drivetype = '电动'
  400. this.resultArr = []
  401. this.fujianArr = []
  402. this.$emit('close')
  403. },
  404. //搜索
  405. Search (type,position) {
  406. let index = 0
  407. let whereKeys = Object.keys(this[type].content.where)
  408. if (position) {
  409. index = whereKeys.indexOf(position) + 1
  410. }
  411. if (type != 'excelParam') {
  412. for (let i = index; i < whereKeys.length - 1; i++) {
  413. if (!position && whereKeys[i].indexOf('condition') != -1) continue
  414. this[type].content.where[whereKeys[i]] = ''
  415. }
  416. } else if (type == 'excelParam') {
  417. for (let i = index; i < whereKeys.length; i++) {
  418. if (whereKeys[i].indexOf('condition') != -1 || whereKeys[i].indexOf('flh') != -1 || whereKeys[i].indexOf('maxrounddiameter') != -1 || whereKeys[i].indexOf('maxsquarewidth') != -1 || whereKeys[i].indexOf('torque') != -1 || whereKeys[i].indexOf('drivetype') != -1) continue
  419. this[type].content.where[whereKeys[i]] = ''
  420. }
  421. }
  422. switch (type) {
  423. case 'guangtouParam':
  424. if (this.loading) return
  425. this.loading = true
  426. whereKeys = whereKeys.filter(item => item != 'caliber')
  427. this.$refs.guangtouRef&&this.$refs.guangtouRef.listData(_changeOption)
  428. break;
  429. case 'excelParam':
  430. if (this.loading) return
  431. this.loading = true
  432. this.$nextTick(() => {
  433. this.$refs.excelRef&&this.$refs.excelRef.listData(_changeOption2)
  434. })
  435. break;
  436. default:
  437. break;
  438. }
  439. //更新选项列表
  440. let that = this
  441. function _changeOption () {
  442. that.loading = false
  443. let isbreak=false
  444. for (let i = 0; i < whereKeys.length; i++) {
  445. if (isbreak) break;
  446. if (whereKeys[i].indexOf('condition') == -1) {
  447. if (that.$refs.guangtouRef.list.length) {
  448. if (i >= index-1 && whereKeys[i]!='drivetype') {
  449. that[whereKeys[i]] = that.$refs.guangtouRef.list[0].option[whereKeys[i]]
  450. if (that[whereKeys[i]].length == 1) {
  451. if (that.guangtouParam.content.where[position]) that.guangtouParam.content.where[whereKeys[i]] = that[whereKeys[i]][0].value
  452. if (that.timer) clearTimeout(that.timer)
  453. that.timer = setTimeout(() => {
  454. that.$refs.guangtouRef&&that.$refs.guangtouRef.listData()
  455. })
  456. } else if (that[whereKeys[i]].length > 1) {
  457. that.guangtouParam.content.where[whereKeys[i]] = ''
  458. }
  459. if (that.$refs.guangtouRef.list[0].option[whereKeys[i]].length>1) {
  460. isbreak = true
  461. }
  462. }
  463. } else {
  464. if (i >= index && whereKeys[i] != 'drivetype') that[whereKeys[i]] = []
  465. }
  466. }
  467. }
  468. }
  469. function _changeOption2 () {
  470. that.loading = false
  471. let isbreak=false
  472. for (let i = 5; i < whereKeys.length; i++) {
  473. if (isbreak) break;
  474. if (whereKeys[i].indexOf('condition') == -1) {
  475. if (that.$refs.excelRef.list.length) {
  476. if (i >= index) {
  477. if (whereKeys[i] != 'drivetype') that[whereKeys[i]] = that.$refs.excelRef.list[0].option[whereKeys[i]]
  478. if (that[whereKeys[i]].length == 1) {
  479. if (that.excelParam.content.where[position]) that.excelParam.content.where[whereKeys[i]] = that[whereKeys[i]][0].value
  480. if (that.timer) clearTimeout(that.timer)
  481. that.timer = setTimeout(() => {
  482. that.$refs.excelRef&&that.$refs.excelRef.listData()
  483. })
  484. } else if (that[whereKeys[i]].length > 1 && whereKeys[i] != 'drivetype') {
  485. that.excelParam.content.where[whereKeys[i]] = ''
  486. }
  487. if (that.$refs.excelRef.list[0].option[whereKeys[i]].length>1) {
  488. isbreak = true
  489. }
  490. }
  491. } else {
  492. if (i >= index && whereKeys[i] != 'drivetype') that[whereKeys[i]] = []
  493. }
  494. }
  495. }
  496. }
  497. },
  498. calcTableHieght (id) {
  499. this.$nextTick(() => {
  500. if (!this.$refs[id]) return
  501. let target = this.$refs[id].$el.getBoundingClientRect()
  502. let clientHeight = document.body.clientHeight
  503. this.tableHeight = clientHeight - target.top - 85 + 'px'
  504. this.$refs[id].$refs.table.doLayout()
  505. })
  506. },
  507. guangtouChange (val) {
  508. switch (val) {
  509. case '电动':
  510. this.excelParam = {
  511. "id": 20240718162202,
  512. "content": {
  513. "itemid": 0,//光头id
  514. "pageNumber": 1,
  515. "pageSize": 30,
  516. "where": {
  517. "actuatordrivetype": "电动开关", //驱动方式
  518. "condition1": "",
  519. "condition2": "",
  520. "torque": "", //阀门扭矩
  521. "flh": "", //法兰号
  522. "actuatorbrand": "", //品牌
  523. "actuatorname":'',
  524. "supplyvoltage":'',
  525. "actuatorsignal":'',
  526. "maxsquarewidth": "", //方阀杆最大宽度
  527. "maxrounddiameter": "" //圆阀杆最大直径
  528. }
  529. },
  530. }
  531. break;
  532. case '气动':
  533. this.excelParam = {
  534. "id": 20240718162302,
  535. "content": {
  536. "pageNumber": 1,
  537. "pageSize": 30,
  538. "where": {
  539. "condition1": "",
  540. "torque": "", //阀门扭矩
  541. "flh": "", //法兰号
  542. "maxsquarewidth": "", //方阀杆最大宽度
  543. "maxrounddiameter": "", //圆阀杆最大直径
  544. "actuatorbrand": "", //品牌
  545. "actuatorname":'',
  546. "func": "", //功能
  547. "bodystructure": "", //结构
  548. "drivetype":'气动调节',
  549. }
  550. },
  551. }
  552. break;
  553. default:
  554. break;
  555. }
  556. },
  557. async onSubmit () {
  558. this.$confirm('确认加入单据吗?', '提示', {
  559. confirmButtonText: '确定',
  560. cancelButtonText: '取消',
  561. type: 'warning'
  562. }).then(async () => {
  563. let mainvalve = Object.keys(this.guangtouParam.content.where).filter(v => v.indexOf('condition') == -1).reduce((result,item) => {
  564. result[item] = this.guangtouParam.content.where[item]
  565. return result
  566. },{})
  567. let actuator = Object.keys(this.excelParam.content.where).filter(v => v.indexOf('condition') == -1).reduce((result,item) => {
  568. result[item] = this.excelParam.content.where[item]
  569. return result
  570. },{})
  571. let param = {
  572. "id": 2024071809123402,
  573. "content": {
  574. "sa_lectotypecfgid": 0,
  575. "projectname": "",
  576. "enterprisename": "",
  577. "source": "",
  578. "sourceid": this.$route.query.id,
  579. "sourcetable": "",
  580. "valvetype":this.valvetype(),
  581. "filter": {
  582. "mainvalve": mainvalve,
  583. "actuator": actuator,
  584. "other": {
  585. fujianArr:this.fujianArr
  586. }
  587. },
  588. "part_itemids": this.resultArr
  589. },
  590. }
  591. this.$emit('handleParam',param)
  592. let res = await this.$api.requested(param)
  593. this.tool.showMessage(res,() => {
  594. this.close()
  595. })
  596. }).catch(() => {
  597. })
  598. },
  599. //选择目标
  600. selectTarget (data,type) {
  601. data.parttype = type
  602. this.resultArr.push(data)
  603. if (type == '主阀') {
  604. this.guangtouChange(this.guangtouParam.content.where.drivetype)
  605. this.excelParam.content.itemid = data.itemid
  606. this.excelParam.content.where.torque = data.torque
  607. this.excelParam.content.where.flh = data.flh
  608. this.excelParam.content.where.maxsquarewidth = data.maxsquarewidth
  609. this.excelParam.content.where.maxrounddiameter = data.maxrounddiameter
  610. this.$nextTick(() => {
  611. this.$refs.excelRef.listData(() => {
  612. if (!this.$refs.excelRef.list.length) return
  613. this.actuatorbrand = this.$refs.excelRef.list[0].option.actuatorbrand
  614. this.bodystructure = this.$refs.excelRef.list[0].option.bodystructure
  615. this.func = this.$refs.excelRef.list[0].option.func
  616. })
  617. })
  618. this.active = 2
  619. } else if (type == '执行器') {
  620. this.resultArr[1].itenname = this.resultArr[1].actuatorname
  621. this.resultArr[1].itemno = this.resultArr[1].actuatorno
  622. if (this.excelParam.content.where.drivetype == '气动调节') {
  623. this.fujianParam.content.othertypes = ['定位器','过滤减压阀']
  624. } else {
  625. this.fujianParam.content.othertypes = ['电磁阀','限位开关','过滤减压阀']
  626. }
  627. data.itemid = data.actuatorid
  628. data.itemname = data.actuatorname
  629. if (this.guangtouParam.content.where.drivetype == '气动') {
  630. this.active = 3
  631. this.$refs.fujianRef.listData()
  632. } else {
  633. this.active = 4
  634. }
  635. } else {
  636. if (this.fujianArr.filter(item=>item.itemid==data.itemid).length) return
  637. this.fujianParam.content.othertypes.splice(this.fujianParam.content.othertypes.indexOf(data.itemname),1)
  638. if (!this.fujianParam.content.othertypes.length) return this.active = 4
  639. this.loading = true
  640. this.$refs.fujianRef.listData(()=> {
  641. this.fujianArr.push(data)
  642. this.loading = false
  643. })
  644. }
  645. this.resultArr[this.resultArr.length - 1] = data
  646. },
  647. //重置
  648. refresh () {
  649. this.resultArr = []
  650. this.fujianArr = []
  651. this.dialogVisible = false
  652. this.active = 1
  653. this.items = this.items.splice(0,2)
  654. },
  655. //选项
  656. optionsList () {
  657. this.$store.dispatch("optiontypeselect", "caliber").then((res) => {
  658. this.caliber = res.data;
  659. console.log(this.caliber, "公称通径");
  660. });
  661. this.$store.dispatch("optiontypeselect", "pressure").then((res) => {
  662. this.nominalpressure = res.data;
  663. console.log(this.nominalpressure, "公称压力");
  664. });
  665. this.$store.dispatch("optiontypeselect", "connection").then((res) => {
  666. this.connection = res.data;
  667. console.log(this.connection, "连接方式");
  668. });
  669. this.$store.dispatch("optiontypeselect", "bodymaterial").then((res) => {
  670. this.bodymaterial = res.data;
  671. console.log(this.bodymaterial, "阀体材质");
  672. });
  673. this.$store.dispatch("optiontypeselect", "stemmaterial").then((res) => {
  674. this.stemmaterial = res.data;
  675. console.log(this.stemmaterial, "阀杆材质");
  676. });
  677. this.$store.dispatch("optiontypeselect", "plinthmaterial").then((res) => {
  678. this.plinthmaterial = res.data;
  679. console.log(this.plinthmaterial, "阀座材质");
  680. });
  681. this.drivetype = [{remarks:'电动',value:'电动'},{remarks:'气动',value:'气动'}];
  682. console.log(this.drivetype, "驱动方式");
  683. this.$store.dispatch("optiontypeselect", "lectotypebrand").then((res) => {
  684. this.actuatorbrand = res.data;
  685. console.log(this.actuatorbrand, "执行器品牌");
  686. });
  687. this.$store.dispatch("optiontypeselect", "actuatordrivetype").then((res) => {
  688. this.actuatordrivetype = res.data;
  689. console.log(this.actuatordrivetype, "执行器驱动方式");
  690. });
  691. this.$store.dispatch("optiontypeselect", "bodystructure").then((res) => {
  692. this.bodystructure = res.data;
  693. console.log(this.bodystructure, "结构");
  694. });
  695. this.$store.dispatch("optiontypeselect", "func").then((res) => {
  696. this.func = res.data;
  697. console.log(this.func, "功能");
  698. });
  699. }
  700. },
  701. created () {
  702. this.optionsList()
  703. },
  704. mounted () {
  705. this.calcTableHieght('guangtouRef')
  706. }
  707. }
  708. </script>
  709. <style scoped>
  710. /deep/.ant-steps-item-finish > .ant-steps-item-container > .ant-steps-item-content > .ant-steps-item-title::after {
  711. background: #3874F6 !important;
  712. }
  713. /deep/.ant-steps-item-finish .ant-steps-item-icon {
  714. background: none !important;
  715. }
  716. /deep/.ant-steps-item-icon {
  717. background: #3874F6;
  718. height: 32px !important;
  719. }
  720. /deep/.ant-steps-item-wait .ant-steps-item-icon {
  721. background: none !important;
  722. }
  723. /deep/.ant-steps-item-active .ant-steps-item-title {
  724. color:#3874F6 !important;
  725. font-weight: bold;
  726. }
  727. /deep/.fixed__btn__panel {
  728. padding-left: 240px !important;
  729. }
  730. .scroll {
  731. height: calc(100vh - 60px);
  732. overflow-y: scroll;
  733. }
  734. ::-webkit-scrollbar {
  735. display: none;
  736. }
  737. .select-info {
  738. background: #F5F6FA;
  739. font-family: Microsoft YaHei, Microsoft YaHei;
  740. width: 240px;
  741. border-right: 1px #999999 solid;
  742. z-index: 301;
  743. flex-shrink: 0;
  744. word-wrap: break-word;
  745. }
  746. .select-info .info-title {
  747. font-weight: bold;
  748. font-size: 20px;
  749. color: #333333;
  750. padding: 10px 20px;
  751. border-bottom: 1px solid #D9D9D9;
  752. }
  753. .select-info .product-wrapper {
  754. padding: 0 20px;
  755. }
  756. .select-info .product-wrapper .product {
  757. padding-bottom:20px;
  758. border-bottom: #D9D9D9 1px solid;
  759. }
  760. .select-info .product-wrapper .product:last-child {
  761. border-bottom: none !important;
  762. }
  763. .select-info .product-wrapper .product .product-header {
  764. display: flex;
  765. align-items: center;
  766. align-content: center;
  767. padding: 10px 0;
  768. }
  769. .select-info .product-wrapper .product .product-header span:last-child {
  770. color: #3874F6;
  771. margin-left: 18px;
  772. cursor: pointer;
  773. }
  774. .select-info .product-wrapper .product .product-header .title {
  775. font-weight: bold;
  776. font-size: 14px;
  777. color: #333333;
  778. }
  779. .select-info .product-wrapper .product .product-header img {
  780. width: 12px;
  781. height: 12px;
  782. }
  783. .select-info .product-wrapper .product .product-name {
  784. font-weight: 400;
  785. font-size: 14px;
  786. color: #555555;
  787. }
  788. .select-info .product-wrapper .product .attrite {
  789. display: flex;
  790. justify-content: space-between;
  791. align-items: center;
  792. font-weight: 400;
  793. font-size: 12px;
  794. color: #999999;
  795. padding-top: 10px;
  796. }
  797. .select-info .product-wrapper .product .attrite .attrite-title {
  798. color: #555555;
  799. }
  800. .select-info .product-wrapper .product .attrite .attrite-value {
  801. }
  802. .select-info .product-wrapper .product .attrite2 {
  803. display: flex;
  804. flex-direction: column;
  805. font-weight: 400;
  806. font-size: 12px;
  807. color: #999999;
  808. padding-top: 10px;
  809. }
  810. .select-info .product-wrapper .product .attrite2 .attrite-title {
  811. color: #555555;
  812. margin-bottom: 5px;
  813. }
  814. .select-info .product-wrapper .product .attrite2 .attrite-value {
  815. }
  816. .select-info .product-wrapper .product {
  817. display: flex;
  818. flex-direction: column;
  819. }
  820. .drawer__panel {
  821. font-family: Source Han Sans SC, Source Han Sans SC;
  822. padding: 10px 40px !important;
  823. flex: 1;
  824. overflow: hidden;
  825. }
  826. .my-steps {
  827. padding: 0px 68px;
  828. }
  829. .product-info {
  830. padding: 10px 20px;
  831. border: 1px solid #3874F6;
  832. background: rgba(56, 116, 246, 0.08);
  833. margin-top: 5px;
  834. border-radius: 2px;
  835. }
  836. .product-info .title {
  837. margin-bottom: 16px;
  838. font-weight: bold;
  839. color: #333333;
  840. font-size: 16px !important;
  841. }
  842. .product-info .info-content {
  843. display: flex;
  844. flex-wrap: wrap;
  845. }
  846. .product-info .info-content .info-item {
  847. display: flex;
  848. flex-direction: column;
  849. }
  850. .product-info .info-content .info-item .info-title {
  851. margin-bottom: 4px;
  852. display: flex;
  853. align-content: center;
  854. align-items: center;
  855. }
  856. .product-info .info-content .info-item .info-title .title {
  857. margin-bottom: 0px !important;
  858. }
  859. .product-info .info-content .info-item .info-title div {
  860. margin-right: 20px;
  861. font-size: 14px !important;
  862. }
  863. .product-info .info-content .info-item .info-title span {
  864. font-size: 14px;
  865. color: #3874F6 !important;
  866. cursor: pointer;
  867. display: inline-block;
  868. display: flex;
  869. align-items: center;
  870. align-content: center;
  871. }
  872. .product-info .info-content .info-item .info-title span img {
  873. width: 12px;
  874. height: 12px;
  875. margin-right: 4px;
  876. }
  877. .product-info .info-content .info-item .name {
  878. font-weight: 400;
  879. font-size: 14px;
  880. color: #555555;
  881. }
  882. .product-info .info-content .info-item .names {
  883. font-weight: 400;
  884. font-size: 14px;
  885. color: #555555;
  886. display: flex;
  887. }
  888. .product-info .info-content .info-item .names div {
  889. margin-right: 20px;
  890. }
  891. .product-info .info-content .info-item .names div span {
  892. margin-right: 10px;
  893. }
  894. .product-content .block {
  895. margin-top: 30px;
  896. padding-left: 20px;
  897. }
  898. .product-content .block .header {
  899. display: flex;
  900. align-content: center;
  901. align-items: center;
  902. margin-bottom: 20px;
  903. }
  904. .product-content .block .header .title {
  905. font-size: 16px;
  906. font-weight: bold;
  907. margin-right: 20px;
  908. }
  909. .product-content .block .header .handle {
  910. display: flex;
  911. }
  912. .dialog-content {
  913. }
  914. .dialog-content .option-line {
  915. display: flex;
  916. margin-top: 10px;
  917. }
  918. .dialog-content .option-line .item {
  919. display: flex;
  920. align-items: center;
  921. font-size: 14px;
  922. font-weight: 500px;
  923. margin-right: 20px;
  924. }
  925. .dialog-content .option-line .item .label {
  926. width: 70px;
  927. flex-shrink: 0;
  928. text-align-last: justify;
  929. margin-right: 15px;
  930. color: #000000 !important;
  931. }
  932. .descript {
  933. font-size:12px;
  934. color:red;
  935. }
  936. table,td,tr {
  937. border-collapse: collapse;
  938. }
  939. td {
  940. padding: 20px 20px;
  941. }
  942. table,td {
  943. border: 1px solid #DDDDDD;
  944. }
  945. .result{
  946. margin-top: 20px;
  947. }
  948. .result .title {
  949. font-family: Source Han Sans SC, Source Han Sans SC;
  950. font-weight: bold;
  951. font-size: 16px;
  952. color: #333333;
  953. padding: 20px 20px;
  954. min-width: 120px;
  955. }
  956. .custom-table {
  957. border: none;
  958. display: flex;
  959. height: 64px;
  960. align-items: center;
  961. align-content: center;
  962. }
  963. .custom-table div{
  964. border-right: 1px solid #DDDDDD;
  965. height: 100%;
  966. display: flex;
  967. align-items: center;
  968. align-content: center;
  969. padding-left: 20px;
  970. }
  971. .custom-table div:nth-child(1) {
  972. width: 120px;
  973. }
  974. .custom-table div:nth-child(2) {
  975. flex: 1;
  976. }
  977. .custom-table div:nth-child(3) {
  978. width: 120px;
  979. }
  980. .custom-table div:nth-child(4) {
  981. flex: 1;
  982. }
  983. .descript {
  984. display: flex;
  985. flex-wrap: wrap;
  986. }
  987. .descript .item {
  988. font-family: Source Han Sans SC, Source Han Sans SC;
  989. font-weight: 400;
  990. font-size: 14px;
  991. color: #333333;
  992. margin-right: 40px;
  993. margin-bottom: 5px;
  994. }
  995. .descript .item:last-child {
  996. margin-right: 0 !important;
  997. }
  998. .text1 {
  999. font-family: Source Han Sans SC, Source Han Sans SC;
  1000. font-weight: bold;
  1001. font-size: 16px;
  1002. color: #3874F6;
  1003. }
  1004. .text2 {
  1005. font-family: Source Han Sans SC, Source Han Sans SC;
  1006. font-weight: bold;
  1007. font-size: 16px;
  1008. color: #E80000;
  1009. }
  1010. </style>