edit.vue 50 KB

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