programRulesDialog.vue 46 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500
  1. <template>
  2. <ele-modal
  3. :title="title"
  4. :visible.sync="visible"
  5. :close-on-click-modal="false"
  6. @close="handleClose"
  7. resizable
  8. maxable
  9. width="80%"
  10. >
  11. <header-title title="基本信息"></header-title>
  12. <el-form
  13. ref="formRef"
  14. :model="addForm"
  15. :rules="rules"
  16. label-width="120px"
  17. :disabled="type === 'detail'"
  18. v-loading="loading"
  19. >
  20. <el-row>
  21. <el-col :span="8">
  22. <el-form-item label="计划配置单号" prop="code">
  23. <el-input
  24. v-model="addForm.code"
  25. size="small"
  26. placeholder="自动带出"
  27. disabled
  28. ></el-input>
  29. </el-form-item>
  30. </el-col>
  31. <el-col :span="8">
  32. <el-form-item label="计划配置名称" prop="name">
  33. <el-input
  34. v-model="addForm.name"
  35. size="small"
  36. placeholder="请输入"
  37. ></el-input>
  38. </el-form-item>
  39. </el-col>
  40. <el-col :span="8">
  41. <el-form-item label="记录计划分类" prop="planType">
  42. <el-select
  43. v-model="addForm.planType"
  44. size="small"
  45. style="width: 100%"
  46. >
  47. <el-option :value="1" label="车间检查记录"></el-option>
  48. <el-option :value="2" label="生产记录"></el-option>
  49. <el-option :value="3" label="注汽检查记录"></el-option>
  50. <el-option :value="4" label="固废记录"></el-option>
  51. <el-option :value="5" label="蒸汽质量检查记录"></el-option>
  52. </el-select>
  53. </el-form-item>
  54. </el-col>
  55. <el-col :span="8">
  56. <el-form-item label="自动派单" prop="autoOrder">
  57. <el-select
  58. v-model="addForm.autoOrder"
  59. size="small"
  60. style="width: 100%"
  61. >
  62. <el-option :value="1" label="是"></el-option>
  63. <el-option :value="0" label="否"></el-option>
  64. </el-select>
  65. </el-form-item>
  66. </el-col>
  67. <el-col :span="8">
  68. <el-form-item label="计划完成时长" prop="duration">
  69. <div style="display: flex">
  70. <el-input
  71. type="number"
  72. v-model="addForm.duration"
  73. size="small"
  74. placeholder="请输入"
  75. @input="formDataDurationTime"
  76. >
  77. <template #suffix>分钟</template>
  78. </el-input>
  79. </div>
  80. </el-form-item>
  81. </el-col>
  82. <el-col :span="8">
  83. <el-form-item label="类型" prop="autoOrder">
  84. <el-select
  85. v-model="addForm.type"
  86. size="small"
  87. @change="typeChange"
  88. style="width: 100%"
  89. >
  90. <el-option :value="1" label="班组"></el-option>
  91. <el-option :value="0" label="个人"></el-option>
  92. </el-select>
  93. </el-form-item>
  94. </el-col>
  95. <el-col :span="8" v-if="addForm.autoOrder && addForm.type == 1">
  96. <el-form-item label="班组" prop="teamId">
  97. <el-select
  98. v-model="addForm.teamId"
  99. size="small"
  100. @change="teamChange"
  101. style="width: 100%"
  102. >
  103. <el-option
  104. :value="i.id"
  105. :label="i.name"
  106. v-for="i in teamAllList"
  107. :key="i.id"
  108. ></el-option>
  109. </el-select>
  110. </el-form-item>
  111. </el-col>
  112. <el-col :span="8" v-if="addForm.autoOrder && addForm.type == 0">
  113. <el-form-item label="部门" prop="groupId">
  114. <deptSelect
  115. v-model="addForm.groupId"
  116. @changeGroup="searchDeptNodeClick"
  117. />
  118. </el-form-item>
  119. </el-col>
  120. <el-col :span="8" v-if="addForm.autoOrder && addForm.type == 0">
  121. <el-form-item label="负责人" prop="executeIdList">
  122. <el-select
  123. v-model="addForm.executeIdList"
  124. size="small"
  125. style="width: 100%"
  126. multiple
  127. filterable
  128. @change="executeIdListChange"
  129. >
  130. <el-option
  131. v-for="item in executorList"
  132. :key="item.id"
  133. :value="item.id"
  134. :label="item.name"
  135. ></el-option>
  136. </el-select>
  137. </el-form-item>
  138. </el-col>
  139. <el-col :span="8">
  140. <el-form-item label="审核人" prop="approvalUserId">
  141. <el-select
  142. v-model="addForm.approvalUserId"
  143. size="small"
  144. clearable
  145. style="width: 100%"
  146. filterable
  147. >
  148. <el-option
  149. v-for="item in uerList"
  150. :key="item.id"
  151. :value="item.id"
  152. :label="item.name"
  153. ></el-option>
  154. </el-select>
  155. </el-form-item>
  156. </el-col>
  157. <el-col :span="8">
  158. <el-form-item label="紧急程度" prop="urgent">
  159. <DictSelection
  160. dictName="紧急程度"
  161. clearable
  162. v-model="addForm.urgent"
  163. >
  164. </DictSelection>
  165. </el-form-item>
  166. </el-col>
  167. <el-col :span="8">
  168. <el-form-item label="关联对象" prop="associatedObject">
  169. <el-select
  170. v-model="addForm.associatedObject"
  171. size="small"
  172. style="width: 100%"
  173. >
  174. <el-option :value="1" label="车间"></el-option>
  175. <el-option :value="2" label="设备"></el-option>
  176. </el-select>
  177. </el-form-item>
  178. </el-col>
  179. <el-col :span="8">
  180. <el-form-item label="状态" prop="status">
  181. <el-switch
  182. v-model="addForm.status"
  183. active-text="开"
  184. inactive-text="关"
  185. :active-value="1"
  186. :inactive-value="0"
  187. />
  188. </el-form-item>
  189. </el-col>
  190. <el-col :span="16">
  191. <el-form-item label="备注" prop="remark">
  192. <el-input
  193. type="textarea"
  194. resize="none"
  195. v-model="addForm.remark"
  196. :rows="2"
  197. placeholder="请详细说明"
  198. size="small"
  199. ></el-input>
  200. </el-form-item>
  201. </el-col>
  202. </el-row>
  203. <el-button
  204. type="primary"
  205. size="small"
  206. style="margin-bottom: 10px"
  207. @click="handleAddTab"
  208. >添加规则</el-button
  209. >
  210. <el-tabs
  211. v-model="tabsValue"
  212. type="card"
  213. :closable="type != 'detail'"
  214. @tab-click="handleTab"
  215. @tab-remove="removeTab"
  216. >
  217. <el-tab-pane
  218. v-for="item in addForm.children"
  219. :key="item.ruleId"
  220. :label="item.ruleName"
  221. :name="item.ruleId"
  222. >
  223. <header-title
  224. title="车间区域"
  225. style="margin-top: 20px"
  226. v-if="addForm.associatedObject == 1"
  227. >
  228. <el-button
  229. type="primary"
  230. size="mini"
  231. icon="el-icon-plus"
  232. @click="openWorkShops(1)"
  233. >新增</el-button
  234. >
  235. </header-title>
  236. <ele-pro-table
  237. ref="table"
  238. v-if="addForm.associatedObject == 1"
  239. :columns="workshopsColumns"
  240. :datasource="item.workshops"
  241. :need-page="false"
  242. >
  243. <template v-slot:action="{ row }">
  244. <el-link
  245. v-if="type != 'detail'"
  246. type="danger"
  247. :underline="false"
  248. icon="el-icon-delete"
  249. @click="item.workshops.splice(item.workshops.indexOf(row), 1)"
  250. >
  251. 删除
  252. </el-link>
  253. </template>
  254. </ele-pro-table>
  255. <header-title
  256. title="设备"
  257. style="margin-top: 20px"
  258. v-if="addForm.associatedObject == 2"
  259. >
  260. <el-button
  261. type="primary"
  262. size="mini"
  263. icon="el-icon-plus"
  264. @click="openWorkShops(2)"
  265. >新增</el-button
  266. >
  267. </header-title>
  268. <ele-pro-table
  269. ref="table"
  270. v-if="addForm.associatedObject == 2"
  271. :columns="equipmentColumns"
  272. :datasource="item.deviceInfo"
  273. :need-page="false"
  274. >
  275. <template v-slot:action="{ row }">
  276. <el-link
  277. v-if="type != 'detail'"
  278. type="danger"
  279. :underline="false"
  280. icon="el-icon-delete"
  281. @click="
  282. item.deviceInfo.splice(item.deviceInfo.indexOf(row), 1)
  283. "
  284. >
  285. 删除
  286. </el-link>
  287. </template>
  288. </ele-pro-table>
  289. <header-title title="规则明细" style="margin-top: 20px">
  290. </header-title>
  291. <el-tabs
  292. v-if="item.recordTemplateStyle == '4'"
  293. v-model="statisticsType"
  294. type="card"
  295. >
  296. <el-tab-pane
  297. v-for="i in statisticsTypeList"
  298. :label="i.label"
  299. :name="i.value"
  300. :key="i.value"
  301. >
  302. </el-tab-pane>
  303. </el-tabs>
  304. <ele-pro-table
  305. ref="table"
  306. :columns="bankColumns"
  307. :datasource="detialsDatasource(item)"
  308. :need-page="false"
  309. row-key="id"
  310. class="table_list"
  311. cache-key="workshop-record-plan-details-item-2511201537"
  312. >
  313. <template v-slot:toolbar>
  314. <div style="display: flex; align-items: center; gap: 10px">
  315. <el-button
  316. type="primary"
  317. icon="el-icon-plus"
  318. class="ele-btn-icon"
  319. @click="addRow(item)"
  320. >
  321. 新建
  322. </el-button>
  323. </div>
  324. </template>
  325. <template v-slot:sortNum="{ row }">
  326. <el-input-number
  327. style="width: 80px"
  328. v-model.number="row.sortNum"
  329. placeholder="请输入排序"
  330. size="mini"
  331. type="number"
  332. :min="1"
  333. controls-position="right"
  334. ></el-input-number>
  335. </template>
  336. <template v-slot:paramType="{ row }">
  337. <el-select
  338. v-model="row.paramType"
  339. placeholder="请选择参数类型"
  340. size="mini"
  341. @change="paramTypeChange(row)"
  342. >
  343. <el-option label="数值" :value="1" />
  344. <el-option label="选择" :value="2" />
  345. <el-option label="上下限" :value="3" />
  346. <el-option label="规格" :value="4" />
  347. <el-option label="时间" :value="5" />
  348. <el-option label="范围" :value="6" />
  349. <el-option label="文本" :value="7" />
  350. <!-- <el-option label="枚举" :value="8" /> -->
  351. <el-option label="计算" :value="9" />
  352. </el-select>
  353. </template>
  354. <template v-slot:paramValue="{ row }">
  355. <!-- 根据参数类型渲染不同的输入组件 -->
  356. <el-link
  357. v-if="item.recordTemplateStyle == '3'"
  358. :underline="false"
  359. style="cursor: pointer"
  360. >
  361. <div class="ele-cell">
  362. <div @click="selectChooseModalProduct(row)">
  363. {{ row.productName ? row.productName : '请选择产品' }}
  364. </div>
  365. <i
  366. v-if="row.tools.length == 0"
  367. class="el-icon-arrow-down"
  368. @click="selectChooseModalProduct(row)"
  369. ></i>
  370. <i
  371. v-else
  372. class="el-icon-close"
  373. @click="clearProduct(row)"
  374. ></i>
  375. </div>
  376. </el-link>
  377. <el-input
  378. v-else
  379. v-model="row.paramValue"
  380. placeholder="请输入参数内容"
  381. size="mini"
  382. type="textarea"
  383. rows="1"
  384. autosize
  385. ></el-input>
  386. </template>
  387. <template v-slot:formula="{ row }">
  388. <div v-if="row.paramType == 9" class="formula-builder">
  389. <div class="formula-builder__selects">
  390. <!-- 选择参数:从已填的非计算参数内容里取 -->
  391. <el-select
  392. v-model="row._paramSelect"
  393. placeholder="选择参数"
  394. size="mini"
  395. style="width: 100px; margin-right: 8px; flex-shrink: 0"
  396. @change="paramSelectChange($event, row)"
  397. >
  398. <el-option
  399. v-for="item in getSelectOptionsByDetails(
  400. row.statisticsType,
  401. item
  402. )"
  403. :key="item.value"
  404. :label="item.label"
  405. :value="item.value"
  406. />
  407. </el-select>
  408. <!-- 选择运算符 -->
  409. <el-select
  410. v-model="row._opSelect"
  411. :key="row._opSelect + '_opSelect'"
  412. placeholder="选择符号"
  413. size="mini"
  414. style="width: 100px; flex-shrink: 0"
  415. @change="opSelectChange($event, row)"
  416. >
  417. <el-option
  418. v-for="op in opSelectOptions"
  419. :key="op"
  420. :label="op"
  421. :value="op"
  422. />
  423. </el-select>
  424. <!-- 替换或者追加 -->
  425. <el-select
  426. v-if="row.activeIndex != undefined"
  427. v-model="row._replaceOrAppend"
  428. :key="row._replaceOrAppend + 'row._replaceOrAppend'"
  429. placeholder="选择"
  430. size="mini"
  431. style="width: 80px; margin-left: 8px; flex-shrink: 0"
  432. >
  433. <el-option key="append" label="追加" value="append" />
  434. <el-option key="replace" label="替换" value="replace" />
  435. </el-select>
  436. </div>
  437. <!-- 已组装公式标签展示 -->
  438. <div
  439. v-if="row.formulaParts && row.formulaParts.length"
  440. style="display: inline-flex; flex-wrap: wrap; max-width: 100%"
  441. >
  442. <el-tag
  443. v-for="(p, index) in row.formulaParts"
  444. :key="index"
  445. size="mini"
  446. closable
  447. :type="row.activeIndex === index ? 'primary' : 'info'"
  448. @click="formulaPartsTagClick(index, row)"
  449. @close="tagItemDelete(index, row)"
  450. >
  451. {{ p }}
  452. </el-tag>
  453. </div>
  454. <!-- 公式字符串展示(只读) -->
  455. <el-input
  456. v-if="row.formulaParts && row.formulaParts.length"
  457. :value="row.formulaParts.join('')"
  458. size="mini"
  459. type="textarea"
  460. disabled
  461. placeholder="公式"
  462. style="margin-top: 6px"
  463. />
  464. </div>
  465. </template>
  466. <template v-slot:defaultValue="{ row }">
  467. <el-row>
  468. <el-col :span="12">
  469. <!-- <el-select
  470. v-if="row.paramType != 7"
  471. v-model="row.symbol"
  472. placeholder="请选择"
  473. size="mini"
  474. >
  475. <el-option label=">" value=">"> </el-option>
  476. <el-option label="<" value="<"> </el-option>
  477. <el-option label="!=" value="!="> </el-option>
  478. <el-option label=">=" value=">="> </el-option>
  479. <el-option label="<=" value="<="> </el-option>
  480. <el-option label="~~" value="~~"> </el-option>
  481. <el-option label="+-" value="+-"> </el-option>
  482. <el-option label="......" value="......"> </el-option>
  483. </el-select> -->
  484. <DictSelection
  485. v-if="row.paramType != 7"
  486. clearable
  487. dictName="数学字符"
  488. v-model="row.symbol"
  489. placeholder="请选择逻辑"
  490. size="mini"
  491. ></DictSelection>
  492. </el-col>
  493. <el-col :span="row.paramType != 7 ? 12 : 24">
  494. <el-input
  495. v-model="row.defaultValue"
  496. placeholder="请输入默认值"
  497. size="mini"
  498. ></el-input>
  499. </el-col>
  500. </el-row>
  501. </template>
  502. <template v-slot:maxValue="{ row }">
  503. <el-input
  504. v-if="row.paramType == 3 || row.paramType == 6"
  505. v-model="row.maxValue"
  506. placeholder="请输入参数上限"
  507. size="mini"
  508. ></el-input>
  509. </template>
  510. <template v-slot:minValue="{ row }">
  511. <el-input
  512. v-if="row.paramType == 3 || row.paramType == 6"
  513. v-model="row.minValue"
  514. placeholder="请输入参数下限"
  515. size="mini"
  516. ></el-input>
  517. </template>
  518. <template v-slot:unitName="{ row }">
  519. <!-- <el-input
  520. v-model="row.unitName"
  521. placeholder="请输入参数单位"
  522. size="mini"
  523. ></el-input> -->
  524. <DictSelection
  525. v-if="row.paramType != 7"
  526. dictName="工艺参数单位"
  527. clearable
  528. filterable
  529. v-model="row.unitName"
  530. size="mini"
  531. >
  532. </DictSelection>
  533. </template>
  534. <template v-slot:toolName="{ row }">
  535. <el-link :underline="false" style="cursor: pointer">
  536. <div class="ele-cell">
  537. <div @click="handleAdd(row)">
  538. {{
  539. row.tools && row.tools.length > 0
  540. ? row.tools.map((i) => i.toolName).join(',')
  541. : '请选择'
  542. }}
  543. </div>
  544. <i
  545. v-if="row.tools.length == 0"
  546. class="el-icon-arrow-down"
  547. @click="handleAdd(row)"
  548. ></i>
  549. <i v-else class="el-icon-close" @click="clearTool(row)"></i>
  550. </div>
  551. </el-link>
  552. </template>
  553. <template v-slot:toolCodes="{ row }">
  554. <el-input
  555. :value="
  556. row.tools && row.tools.length > 0
  557. ? row.tools.map((i) => i.toolCode).join(',')
  558. : ''
  559. "
  560. placeholder="工具自动带出"
  561. disabled
  562. size="mini"
  563. ></el-input>
  564. </template>
  565. <template v-slot:remark="{ row }">
  566. <el-input
  567. v-model="row.remark"
  568. placeholder="请输入"
  569. size="mini"
  570. ></el-input>
  571. </template>
  572. <template v-slot:action="{ row }">
  573. <el-link
  574. v-if="type != 'detail'"
  575. type="danger"
  576. :underline="false"
  577. icon="el-icon-delete"
  578. @click="deleteRow(item, row)"
  579. >
  580. 删除
  581. </el-link>
  582. </template>
  583. </ele-pro-table>
  584. </el-tab-pane>
  585. </el-tabs>
  586. </el-form>
  587. <template v-slot:footer>
  588. <el-button
  589. v-if="type != 'detail'"
  590. type="primary"
  591. @click="submit"
  592. :loading="butLoading"
  593. >保存</el-button
  594. >
  595. <el-button @click="handleClose">取消</el-button>
  596. </template>
  597. <selectReleaseRules
  598. ref="selectReleaseRulesRef"
  599. @chooseRules="chooseRules"
  600. :businessType="1"
  601. ></selectReleaseRules>
  602. <selectWorkshop
  603. ref="selectWorkshopRef"
  604. multiple
  605. @confirm="confirmWorkshops"
  606. ></selectWorkshop>
  607. <toolModal
  608. ref="toolModalTowRef"
  609. @chooseModal="chooseModalProduct"
  610. :multiple="false"
  611. />
  612. <toolModal ref="toolModalRef" @chooseModal="chooseModal" />
  613. <!-- 新增设备 -->
  614. <MaterialAdd ref="productRefs" @chooseEquipment="chooseEquipment">
  615. </MaterialAdd>
  616. </ele-modal>
  617. </template>
  618. <script>
  619. import dictMixins from '@/mixins/dictMixins';
  620. import tableColumnsMixin from '@/mixins/tableColumnsMixin';
  621. import { getUserPage } from '@/api/system/organization';
  622. import deptSelect from '@/components/CommomSelect/dept-select.vue';
  623. import { getCode } from '@/api/ruleManagement/matter';
  624. import selectReleaseRules from '@/components/selectReleaseRules/select-release-rules.vue';
  625. import selectWorkshop from '@/components/selectWorkshop/selectWorkshop.vue';
  626. import {
  627. recordrulesGetById,
  628. recordrulesPlanConfigGetById,
  629. recordrulesPlanConfigSaveOrUpdate
  630. } from '@/api/recordrules/index';
  631. import toolModal from '@/views/rulesManagement/releaseRules/components/toolModal.vue';
  632. import MaterialAdd from '@/views/rulesManagement/components/MaterialAdd.vue';
  633. import { getteampage } from '@/api/workforceManagement/team';
  634. export default {
  635. mixins: [dictMixins, tableColumnsMixin],
  636. components: {
  637. deptSelect,
  638. selectReleaseRules,
  639. selectWorkshop,
  640. toolModal,
  641. MaterialAdd
  642. },
  643. data() {
  644. const formBaseData = {
  645. approvalUserId: null,
  646. approvalUserName: '',
  647. autoOrder: 1,
  648. code: '',
  649. configType: 1,
  650. createUserName: '',
  651. duration: null,
  652. associatedObject: 1,
  653. planType: 1,
  654. executeUsers: [
  655. // {
  656. // groupId: 0,
  657. // groupName: '',
  658. // teamId: 0,
  659. // teamName: '',
  660. // userId: 0,
  661. // userName: ''
  662. // }
  663. ],
  664. executeIdList: [],
  665. children: [],
  666. details: [],
  667. id: null,
  668. name: '',
  669. nextExecuteTime: '',
  670. remark: '',
  671. ruleId: null,
  672. ruleName: '',
  673. status: 1,
  674. type: 0,
  675. updateUserName: '',
  676. urgent: '1',
  677. groupId: '', // 部门id
  678. teamId: '', // 班组id
  679. lastExecuteTime: ''
  680. };
  681. return {
  682. visible: false,
  683. title: '新增记录计划配置',
  684. formBaseData,
  685. addForm: JSON.parse(JSON.stringify(formBaseData)),
  686. rules: {
  687. name: [
  688. { required: true, message: '请输入计划配置名称', trigger: 'blur' }
  689. ],
  690. autoOrder: [
  691. { required: true, message: '请选择是否自动派单', trigger: 'change' }
  692. ],
  693. ruleId: [
  694. { required: true, message: '请选择规则名称', trigger: 'change' }
  695. ],
  696. duration: [
  697. { required: true, message: '请输入计划完成时长', trigger: 'blur' }
  698. ],
  699. categoryLevelId: [
  700. { required: true, message: '请选择设备分类', trigger: 'change' }
  701. ],
  702. categoryId: [
  703. { required: true, message: '请选择设备类别', trigger: 'change' }
  704. ],
  705. groupId: [
  706. { required: true, message: '请选择部门', trigger: 'change' }
  707. ],
  708. teamId: [
  709. { required: true, message: '请选择班组', trigger: 'change' }
  710. ],
  711. executeIdList: [
  712. { required: true, message: '请选择人员', trigger: 'change' }
  713. ],
  714. urgent: [
  715. { required: true, message: '请选择紧急程度', trigger: 'change' }
  716. ]
  717. },
  718. executorList: [],
  719. uerList: [],
  720. tabsValue: '',
  721. // 执行方式列表
  722. executeMethodList: [],
  723. // 1-成品统计,2-物料统计,3-工序统计"
  724. statisticsType: '1',
  725. statisticsTypeList: [
  726. { label: '成品统计', value: '1' },
  727. { label: '物料统计', value: '2' },
  728. { label: '工序统计', value: '3' }
  729. ],
  730. opSelectOptions: ['+', '-', '*', '/', '%', '(', ')'],
  731. butLoading: false,
  732. teamAllList: [],
  733. loading: false,
  734. type: 'add' // 弹窗类型 add-新增 edit-编辑 detail-查看
  735. };
  736. },
  737. computed: {
  738. // 当前用户信息
  739. loginUser() {
  740. return this.$store.state.user?.info;
  741. },
  742. equipmentColumns() {
  743. return [
  744. {
  745. width: 45,
  746. type: 'index',
  747. columnKey: 'index',
  748. align: 'center'
  749. },
  750. {
  751. prop: 'name',
  752. label: '设备名称'
  753. },
  754. {
  755. label: '设备编号',
  756. prop: 'codeNumber'
  757. },
  758. {
  759. label: '固资编码',
  760. prop: 'fixCode'
  761. },
  762. {
  763. columnKey: 'action',
  764. label: '操作',
  765. width: 110,
  766. align: 'center',
  767. resizable: false,
  768. slot: 'action',
  769. fixed: 'right'
  770. }
  771. ];
  772. },
  773. workshopsColumns() {
  774. return [
  775. {
  776. width: 45,
  777. type: 'index',
  778. columnKey: 'index',
  779. align: 'center'
  780. },
  781. {
  782. prop: 'workshopCode',
  783. label: '车间编码'
  784. },
  785. {
  786. label: '车间名称',
  787. prop: 'workshopName'
  788. },
  789. {
  790. label: '所属工厂',
  791. prop: 'factoryName'
  792. },
  793. {
  794. label: '所属厂房',
  795. prop: 'workshopPlanName',
  796. slot: 'factory'
  797. },
  798. {
  799. label: '所属区域',
  800. prop: 'areaName'
  801. },
  802. {
  803. label: '详细地址',
  804. prop: 'address'
  805. },
  806. {
  807. columnKey: 'action',
  808. label: '操作',
  809. width: 110,
  810. align: 'center',
  811. resizable: false,
  812. slot: 'action',
  813. fixed: 'right'
  814. }
  815. ];
  816. },
  817. bankColumns() {
  818. const list = [
  819. {
  820. width: 110,
  821. type: 'index',
  822. columnKey: 'index',
  823. align: 'center',
  824. label: '序号'
  825. },
  826. {
  827. prop: 'sortNum',
  828. label: '排序',
  829. align: 'center',
  830. slot: 'sortNum',
  831. minWidth: 110
  832. },
  833. {
  834. prop: 'paramType',
  835. label: '参数类型',
  836. align: 'center',
  837. slot: 'paramType',
  838. minWidth: 110
  839. },
  840. {
  841. prop: 'paramValue',
  842. label: '参数内容',
  843. align: 'center',
  844. slot: 'paramValue',
  845. minWidth: 261
  846. },
  847. {
  848. prop: 'formula',
  849. label: '计算公式',
  850. align: 'center',
  851. slot: 'formula',
  852. minWidth: 300
  853. },
  854. {
  855. prop: 'defaultValue',
  856. label: '默认值',
  857. align: 'center',
  858. slot: 'defaultValue',
  859. minWidth: 150
  860. },
  861. {
  862. prop: 'maxValue',
  863. label: '参数上限',
  864. align: 'center',
  865. slot: 'maxValue',
  866. minWidth: 110
  867. },
  868. {
  869. prop: 'minValue',
  870. label: '参数下限',
  871. align: 'center',
  872. slot: 'minValue',
  873. minWidth: 110
  874. },
  875. {
  876. prop: 'unitName',
  877. label: '参数单位',
  878. align: 'center',
  879. slot: 'unitName',
  880. minWidth: 110
  881. },
  882. {
  883. prop: 'toolName',
  884. label: '工具名称',
  885. align: 'center',
  886. slot: 'toolName',
  887. minWidth: 110
  888. },
  889. {
  890. prop: 'toolCodes',
  891. label: '工具编码',
  892. align: 'center',
  893. slot: 'toolCodes',
  894. minWidth: 110
  895. },
  896. {
  897. prop: 'remark',
  898. label: '备注',
  899. align: 'center',
  900. slot: 'remark',
  901. minWidth: 110
  902. },
  903. {
  904. columnKey: 'action',
  905. label: '操作',
  906. width: 110,
  907. align: 'center',
  908. resizable: false,
  909. slot: 'action',
  910. fixed: 'right'
  911. }
  912. ];
  913. const current = this.addForm.children.find(
  914. (item) => item.ruleId === this.tabsValue
  915. );
  916. if (current && current.recordTemplateStyle != '4') {
  917. // 过滤掉 计算公式 列
  918. return list.filter((i) => i.prop != 'formula');
  919. }
  920. return list;
  921. }
  922. },
  923. created() {
  924. // 获取审核人列表、巡点检人员
  925. this.getUserList();
  926. // 获取所有班组
  927. this.getAllTeamList();
  928. },
  929. methods: {
  930. // 外部调用,打开弹窗
  931. open(type, data) {
  932. console.log('type data', type, data);
  933. this.type = type;
  934. if (type == 'add') {
  935. this.title = '新增记录计划配置';
  936. this.getOrderCode();
  937. } else if (type == 'edit') {
  938. this.title = '修改记录计划配置';
  939. this.getDetail(data.id);
  940. } else {
  941. this.title = '查看记录计划配置';
  942. this.getDetail(data.id);
  943. }
  944. this.visible = true;
  945. this.$nextTick(() => {
  946. this.$refs.formRef.clearValidate();
  947. });
  948. },
  949. // 查询详情
  950. async getDetail(id) {
  951. this.loading = true;
  952. const data = await recordrulesPlanConfigGetById(id);
  953. console.log('记录计划配置详情', data);
  954. this.$util.assignObject(this.addForm, data);
  955. this.addForm.urgent = this.addForm.urgent + '';
  956. // 处理回显数据
  957. if (this.addForm.type === 0) {
  958. // 个人
  959. this.addForm.executeIdList = this.addForm.executeUsers.map(
  960. (item) => item.userId
  961. );
  962. let groupIds = this.addForm.executeUsers
  963. .map((i) => i.groupId)
  964. .filter((i) => i);
  965. groupIds = Array.from(new Set(groupIds));
  966. if (groupIds.includes('1')) {
  967. // 包含全部部门,置空
  968. this.addForm.groupId = '1';
  969. } else {
  970. this.addForm.groupId = this.addForm.executeUsers[0]?.groupId || '1';
  971. }
  972. groupIds.map((item) => {
  973. this.searchDeptNodeClick(item);
  974. });
  975. } else {
  976. // 班组
  977. this.addForm.teamId = this.addForm.executeUsers[0]?.teamId || '';
  978. }
  979. this.tabsValue = this.addForm.children[0]?.ruleId || '';
  980. this.loading = false;
  981. console.log('this.addForm', this.addForm);
  982. },
  983. // 关闭时清理表单
  984. handleClose() {
  985. this.addForm = JSON.parse(JSON.stringify(this.formBaseData));
  986. this.$nextTick(() => {
  987. this.$refs.formRef.clearValidate();
  988. this.visible = false;
  989. });
  990. },
  991. // 构建数据
  992. formMateBody() {
  993. // 通过校验,构建数据
  994. const body = JSON.parse(JSON.stringify(this.addForm));
  995. body.ruleName = body.children.map((item) => item.ruleName).join(',');
  996. body.children.forEach((rule) => {
  997. // 父级字段赋值
  998. rule.approvalUserId = body.approvalUserId;
  999. rule.approvalUserName = body.approvalUserName;
  1000. rule.autoOrder = body.autoOrder;
  1001. rule.code = body.code;
  1002. rule.configType = body.configType;
  1003. rule.createUserName = body.createUserName;
  1004. rule.duration = body.duration;
  1005. rule.executeUsers = body.executeUsers;
  1006. rule.name = body.name;
  1007. rule.nextExecuteTime = body.nextExecuteTime;
  1008. rule.remark = body.remark;
  1009. rule.status = body.status;
  1010. rule.type = body.type;
  1011. rule.updateUserName = body.updateUserName;
  1012. rule.urgent = body.urgent;
  1013. rule.lastExecuteTime = body.lastExecuteTime;
  1014. });
  1015. return body;
  1016. },
  1017. // 提交
  1018. submit() {
  1019. console.log('this.addForm', this.addForm);
  1020. this.$refs.formRef.validate(async (valid) => {
  1021. if (valid) {
  1022. // 判断 children
  1023. if (this.addForm.children.length == 0) {
  1024. this.$message.warning('请至少添加一个记录规则');
  1025. return;
  1026. }
  1027. // 判断 每个规则的车间区域
  1028. for (const rule of this.addForm.children) {
  1029. if (
  1030. rule.workshops.length == 0 &&
  1031. this.addForm.associatedObject == '1'
  1032. ) {
  1033. this.$message.warning(
  1034. `规则【${rule.ruleName}】请至少添加一个车间区域`
  1035. );
  1036. return;
  1037. }
  1038. if (
  1039. rule.deviceInfo.length == 0 &&
  1040. this.addForm.associatedObject == '2'
  1041. ) {
  1042. this.$message.warning(
  1043. `规则【${rule.ruleName}】请至少添加一个设备`
  1044. );
  1045. return;
  1046. }
  1047. }
  1048. this.butLoading = true;
  1049. try {
  1050. // 赋值创建人和更新人
  1051. if (this.addForm.id) {
  1052. this.addForm.updateUserName = this.loginUser?.name || '';
  1053. } else {
  1054. this.addForm.createUserName = this.loginUser?.name || '';
  1055. }
  1056. const body = this.formMateBody();
  1057. console.log('body', body);
  1058. await recordrulesPlanConfigSaveOrUpdate(body);
  1059. this.butLoading = false;
  1060. this.$message.success('保存成功');
  1061. this.$emit('reload');
  1062. this.handleClose();
  1063. } catch (error) {
  1064. this.butLoading = false;
  1065. }
  1066. }
  1067. });
  1068. },
  1069. // 过滤计划完成时长
  1070. formDataDurationTime(value) {
  1071. if (value > 0) {
  1072. this.addForm.duration = value.replace(/^[0]+/, '');
  1073. } else {
  1074. this.addForm.duration = 0;
  1075. }
  1076. },
  1077. typeChange() {
  1078. this.addForm.groupId = '';
  1079. this.addForm.executeIdList = [];
  1080. },
  1081. //选择部门(搜索)
  1082. async searchDeptNodeClick(info, data) {
  1083. if (info) {
  1084. // 根据部门获取人员
  1085. const params = { groupId: info };
  1086. await this.getUserList(params);
  1087. } else {
  1088. this.addForm.groupId = null;
  1089. }
  1090. },
  1091. // 获取审核人列表、巡点检人员
  1092. async getUserList(params) {
  1093. try {
  1094. let data = { pageNum: 1, size: -1 };
  1095. // 如果传了参数就是获取部门人员数据
  1096. if (params) {
  1097. data = Object.assign(data, params);
  1098. }
  1099. const res = await getUserPage(data);
  1100. if (params) {
  1101. this.executorList = res.list;
  1102. } else {
  1103. this.uerList = res.list;
  1104. }
  1105. } catch (error) {}
  1106. },
  1107. // 获取自动生成的单号
  1108. async getOrderCode() {
  1109. const data = await getCode('record_rules_plan_config_code');
  1110. this.addForm.code = data;
  1111. },
  1112. handleTab(e) {
  1113. this.ruleIndex = e.index;
  1114. },
  1115. removeTab(targetName) {
  1116. this.$confirm('是否删除当前记录规则?', '提示', {
  1117. confirmButtonText: '确定',
  1118. cancelButtonText: '取消',
  1119. type: 'warning'
  1120. })
  1121. .then(() => {
  1122. // 删除tab
  1123. this.addForm.children = this.addForm.children.filter(
  1124. (item) => item.ruleId !== targetName
  1125. );
  1126. })
  1127. .catch(() => {});
  1128. },
  1129. // 选择记录规则
  1130. handleAddTab() {
  1131. // 添加tab
  1132. this.$refs.selectReleaseRulesRef.open(
  1133. '',
  1134. '',
  1135. this.addForm.children.map((i) => i.ruleId)
  1136. );
  1137. },
  1138. async chooseRules(rules) {
  1139. console.log('选择的规则', rules);
  1140. // 查询规则明细,回显规则明细数据
  1141. const data = await recordrulesGetById(rules.id);
  1142. // 处理详情的 公式 字段
  1143. data.details.forEach((item) => {
  1144. if (item.paramType == 9 && item.formula) {
  1145. // formula格式为[A][+][b][*][C] 拆分 -> ['A','+','b','*','C']
  1146. if (item.formula) {
  1147. const matches = item.formula.match(/\[([^\]]+)\]/g);
  1148. if (matches) {
  1149. this.$set(
  1150. item,
  1151. 'formulaParts',
  1152. matches.map((m) => m.slice(1, -1)).filter(Boolean)
  1153. );
  1154. }
  1155. } else {
  1156. this.$set(item, 'formulaParts', []);
  1157. }
  1158. this.$set(item, '_paramSelect', null);
  1159. this.$set(item, '_opSelect', null);
  1160. this.$set(item, '_replaceOrAppend', '');
  1161. }
  1162. });
  1163. console.log('规则明细数据', data.details);
  1164. this.addForm.children.push({
  1165. ruleId: rules.id,
  1166. ruleName: rules.name,
  1167. details: data.details,
  1168. children: [],
  1169. workshops: [],
  1170. deviceInfo: [],
  1171. classify: rules.classify,
  1172. recordTemplateStyle: rules.recordTemplateStyle,
  1173. reportWorkType: rules.reportWorkType
  1174. });
  1175. if (this.addForm.children.length === 1) {
  1176. this.tabsValue = this.addForm.children[0].ruleId;
  1177. }
  1178. },
  1179. // 打开选择车间弹窗
  1180. openWorkShops(type) {
  1181. if (type == 1) {
  1182. this.$refs.selectWorkshopRef.open();
  1183. } else {
  1184. this.$refs.productRefs.open([]);
  1185. }
  1186. },
  1187. chooseEquipment(data) {
  1188. const currentTab = this.addForm.children.find(
  1189. (item) => item.ruleId === this.tabsValue
  1190. );
  1191. if (currentTab) {
  1192. currentTab.deviceInfo = [...currentTab.deviceInfo, ...data];
  1193. }
  1194. },
  1195. confirmWorkshops(list) {
  1196. console.log('list', list);
  1197. // 给当前tab添加车间数据
  1198. const currentTab = this.addForm.children.find(
  1199. (item) => item.ruleId === this.tabsValue
  1200. );
  1201. if (currentTab) {
  1202. currentTab.workshops = [
  1203. ...currentTab.workshops,
  1204. ...list.map((i) => {
  1205. return {
  1206. workshopId: i.id,
  1207. workshopCode: i.code,
  1208. workshopName: i.name,
  1209. address: i.extInfo.location,
  1210. areaId: i.areaId,
  1211. areaName: i.areaName,
  1212. factoryId: i.factoryId,
  1213. factoryName: i.factoryName,
  1214. remark: i.remark,
  1215. workshopPlanId: i.workshopPlanId,
  1216. workshopPlanName: i.workshopPlanName,
  1217. createUserName: this.loginUser?.name || ''
  1218. };
  1219. })
  1220. ];
  1221. console.log('currentTab', currentTab);
  1222. }
  1223. },
  1224. // 添加
  1225. addRow(item) {
  1226. // 最大sortNum 值 +1
  1227. let sortNum = 1;
  1228. if (item.details.length > 0) {
  1229. const maxSortNum = Math.max(
  1230. ...item.details.map((i) => i.sortNum || 0)
  1231. );
  1232. sortNum = maxSortNum + 1;
  1233. }
  1234. item.details.push({
  1235. id: new Date().getTime(),
  1236. defaultValue: '',
  1237. maxValue: null,
  1238. minValue: null,
  1239. paramType: null,
  1240. paramValue: null,
  1241. remark: '',
  1242. symbol: null,
  1243. tools: [],
  1244. unitName: null,
  1245. productName: '',
  1246. productCode: '',
  1247. // 1-成品统计,2-物料统计,3-工序统计"
  1248. statisticsType:
  1249. item.recordTemplateStyle == '4' ? this.statisticsType : null,
  1250. // 公式
  1251. formula: '',
  1252. _paramSelect: null,
  1253. _opSelect: null,
  1254. _replaceOrAppend: '',
  1255. formulaParts: [],
  1256. sortNum
  1257. });
  1258. console.log('currentTab item', item);
  1259. },
  1260. // 类型变化
  1261. paramTypeChange(row) {
  1262. if (row.pageType != 9) {
  1263. // 清空
  1264. row.formulaParts = [];
  1265. row.formula = '';
  1266. }
  1267. },
  1268. // 选择物品 产品、物料等
  1269. selectChooseModalProduct(row) {
  1270. this.currentRow = row;
  1271. this.$refs.toolModalTowRef.open([], '选择物品');
  1272. },
  1273. chooseModalProduct(current) {
  1274. console.log('current', current);
  1275. this.currentRow.productName = current.name;
  1276. this.currentRow.productCode = current.code;
  1277. this.currentRow.unitName = current.weightUnit;
  1278. console.log('this.currentRow', this.currentRow);
  1279. },
  1280. // 清空产品
  1281. clearProduct(row) {
  1282. row.productName = '';
  1283. row.productCode = '';
  1284. },
  1285. // 基于详情返回selectOptions
  1286. getSelectOptionsByDetails(statisticsType, item) {
  1287. let paramTypeOptions = [];
  1288. for (const detail of item.details.filter(
  1289. (i) => i.statisticsType == statisticsType
  1290. )) {
  1291. if (detail.paramType != 9 || !detail.paramType) {
  1292. paramTypeOptions.push({
  1293. value: detail.paramValue,
  1294. label: detail.paramValue
  1295. });
  1296. }
  1297. }
  1298. // 过滤空值
  1299. paramTypeOptions = paramTypeOptions.filter((i) => i.value);
  1300. // 追加一个 (要求生产数量)
  1301. paramTypeOptions.push({
  1302. value: '要求生产数量',
  1303. label: '要求生产数量'
  1304. });
  1305. return paramTypeOptions;
  1306. },
  1307. paramSelectChange(val, row) {
  1308. if (!val) return;
  1309. row.formulaParts = row.formulaParts || [];
  1310. if (row.activeIndex != undefined) {
  1311. if (!row._replaceOrAppend || row._replaceOrAppend === 'replace') {
  1312. row.formulaParts.splice(row.activeIndex, 1, val);
  1313. } else if (row._replaceOrAppend === 'append') {
  1314. row.formulaParts.splice(row.activeIndex + 1, 0, val);
  1315. // 追加后activeIndex后移一位
  1316. this.$set(row, 'activeIndex', row.activeIndex + 1);
  1317. }
  1318. // row.activeIndex = undefined;
  1319. } else {
  1320. row.formulaParts.push(val);
  1321. }
  1322. row.formula = row.formulaParts.map((p) => `[${p}]`).join('');
  1323. row._paramSelect = null;
  1324. },
  1325. opSelectChange(val, row) {
  1326. if (!val) return;
  1327. row.formulaParts = row.formulaParts || [];
  1328. if (row.activeIndex != undefined) {
  1329. if (!row._replaceOrAppend || row._replaceOrAppend === 'replace') {
  1330. row.formulaParts.splice(row.activeIndex, 1, val);
  1331. } else if (row._replaceOrAppend === 'append') {
  1332. row.formulaParts.splice(row.activeIndex + 1, 0, val);
  1333. // 追加后activeIndex后移一位
  1334. this.$set(row, 'activeIndex', row.activeIndex + 1);
  1335. }
  1336. // row.activeIndex = undefined;
  1337. } else {
  1338. row.formulaParts.push(val);
  1339. }
  1340. row.formula = row.formulaParts.map((p) => `[${p}]`).join('');
  1341. row._opSelect = null;
  1342. },
  1343. tagItemDelete(index, row) {
  1344. if (this.type == 'detail') return;
  1345. row.formulaParts.splice(index, 1);
  1346. row.formula = row.formulaParts.map((p) => `[${p}]`).join('');
  1347. },
  1348. formulaPartsTagClick(index, row) {
  1349. if (this.type == 'detail') return;
  1350. if (!row._replaceOrAppend) {
  1351. // 默认追加
  1352. row._replaceOrAppend = 'append';
  1353. }
  1354. if (row.activeIndex && row.activeIndex === index) {
  1355. this.$set(row, 'activeIndex', undefined);
  1356. } else {
  1357. this.$set(row, 'activeIndex', index);
  1358. }
  1359. },
  1360. handleAdd(row) {
  1361. this.currentRow = row;
  1362. this.$refs.toolModalRef.open(row.toolCodes);
  1363. },
  1364. chooseModal(data) {
  1365. console.log('data', data);
  1366. this.currentRow.tools = data.map((i) => {
  1367. return {
  1368. toolCode: i.code,
  1369. toolName: i.name
  1370. };
  1371. });
  1372. },
  1373. // 清空工具
  1374. clearTool(row) {
  1375. row.tools = [];
  1376. },
  1377. deleteRow(time, row) {
  1378. const index = time.details.findIndex((item) => item.id === row.id);
  1379. if (index !== -1) {
  1380. time.details.splice(index, 1);
  1381. }
  1382. },
  1383. // 过滤明细数据源
  1384. detialsDatasource(item) {
  1385. // 如果是模板样式4,过滤统计类型
  1386. if (item.recordTemplateStyle == '4') {
  1387. return item.details.filter(
  1388. (i) => i.statisticsType == this.statisticsType
  1389. );
  1390. }
  1391. return item.details;
  1392. },
  1393. // 负责人变更 同步执行人列表
  1394. executeIdListChange() {
  1395. this.addForm.executeUsers = this.addForm.executeIdList.map((userId) => {
  1396. const user = this.executorList.find((u) => u.id === userId);
  1397. return {
  1398. userId: user.id,
  1399. userName: user.name,
  1400. groupId: user.groupId,
  1401. groupName: user.groupName
  1402. };
  1403. });
  1404. console.log('this.addForm.executeUsers', this.addForm.executeUsers);
  1405. },
  1406. async getAllTeamList() {
  1407. const { list } = await getteampage({
  1408. pageNum: 1,
  1409. size: -1
  1410. });
  1411. console.log('teamAllList 班组', list);
  1412. this.teamAllList = list;
  1413. },
  1414. teamChange() {
  1415. console.log('this.addForm.teamId', this.addForm.teamId);
  1416. // 当前班组
  1417. const currentTeam = this.teamAllList.find(
  1418. (item) => item.id === this.addForm.teamId
  1419. );
  1420. if (currentTeam) {
  1421. // 同步执行人
  1422. this.addForm.executeUsers = [
  1423. {
  1424. teamId: currentTeam.id,
  1425. teamName: currentTeam.name
  1426. }
  1427. ];
  1428. }
  1429. }
  1430. }
  1431. };
  1432. </script>
  1433. <style scoped lang="scss">
  1434. :deep(.el-form) {
  1435. .el-form-item:last-child {
  1436. margin-bottom: 22px !important;
  1437. }
  1438. }
  1439. ::v-deep .el-row {
  1440. display: flex;
  1441. flex-wrap: wrap;
  1442. }
  1443. </style>