index.vue 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903
  1. <template>
  2. <div class="mainContentBox">
  3. <avue-crud
  4. ref="crudRef"
  5. v-model:search="search"
  6. v-model="form"
  7. :data="data"
  8. :option="option"
  9. v-model:page="page"
  10. @row-save="createRow"
  11. @row-update="updateRow"
  12. @search-change="searchChange"
  13. @search-reset="resetChange"
  14. @size-change="dataList"
  15. @current-change="dataList"
  16. @selection-change="selectionChange"
  17. >
  18. <template #usable="{ row }">
  19. <el-tag v-if="row.usable == '1'" type="success">已绑定</el-tag>
  20. <el-tag v-else type="info">未绑定</el-tag>
  21. </template>
  22. <template #productManager-form="{ row }">
  23. <!-- <el-select
  24. v-model="form.productManager"
  25. placeholder="产品负责人"
  26. filterable
  27. >
  28. <el-option
  29. v-for="item in userList"
  30. :key="item.userName"
  31. :label="item.userName"
  32. :value="item.userName"
  33. />
  34. </el-select>-->
  35. <el-tree-select
  36. v-model="form.productManager"
  37. :data="userList"
  38. filterable
  39. />
  40. </template>
  41. <!-- :disabled="row.usable == '1' ? false : true" -->
  42. <!--<template #menu-right="{}">
  43. <el-dropdown split-button
  44. >导入
  45. <template #dropdown>
  46. <el-dropdown-menu>
  47. <el-dropdown-item
  48. @click="downloadTemplate('/api/v1/op/route/template')"
  49. >
  50. <i-ep-download />下载模板
  51. </el-dropdown-item>
  52. <el-dropdown-item @click="importExcelData">
  53. <i-ep-top />导入数据
  54. </el-dropdown-item>
  55. </el-dropdown-menu>
  56. </template>
  57. </el-dropdown>
  58. </template>-->
  59. <template #menu="{ row }">
  60. <el-button
  61. link
  62. type="primary"
  63. icon="el-icon-edit"
  64. v-if="
  65. row.usable === 0 &&
  66. (row.flowState === '0' ||
  67. row.flowState == '2' ||
  68. row.flowState == '-1')
  69. "
  70. @click="doEdit(row, index)"
  71. >编辑</el-button
  72. >
  73. <el-button
  74. link
  75. type="primary"
  76. icon="el-icon-edit"
  77. v-else
  78. @click="showProductManager(row, index)"
  79. >编辑</el-button
  80. >
  81. <el-button
  82. link
  83. type="danger"
  84. icon="el-icon-edit"
  85. v-if="
  86. row.usable === 0 &&
  87. (row.flowState === '0' ||
  88. row.flowState == '2' ||
  89. row.flowState == '-1')
  90. "
  91. @click="deleteRow(row, index)"
  92. >删除</el-button
  93. >
  94. <el-button
  95. link
  96. type="primary"
  97. v-if="row.upgradeVersion === '1'"
  98. icon="el-icon-notification"
  99. @click="changeLog(row)"
  100. >修改记录</el-button
  101. >
  102. <el-button
  103. link
  104. type="primary"
  105. v-if="row.isMain === '0'"
  106. icon="el-icon-setting"
  107. @click="setMain(row)"
  108. >主路线</el-button
  109. >
  110. <el-button
  111. link
  112. icon="el-icon-copy-document"
  113. v-if="
  114. row.flowState == '0' ||
  115. row.flowState == '2' ||
  116. row.flowState == '-1'
  117. "
  118. @click="openCheckView(row)"
  119. >提审</el-button
  120. >
  121. <el-button
  122. link
  123. v-if="row.flowState !== '0'"
  124. icon="el-icon-copy-document"
  125. @click="showFlowSteps(row)"
  126. >流程</el-button
  127. >
  128. <el-button
  129. link
  130. icon="el-icon-copy-document"
  131. v-if="row.flowState == '3'"
  132. @click="onCancelFlow(row)"
  133. >撤销</el-button
  134. >
  135. <el-button
  136. link
  137. icon="el-icon-copy-document"
  138. :disabled="false"
  139. v-if="row.flowState === '1'"
  140. @click="copyRow(row)"
  141. >升版</el-button
  142. >
  143. <el-button
  144. link
  145. icon="el-icon-copy-document"
  146. @click="bindProcessPop(row)"
  147. v-if="row.flowState != '3'"
  148. >绑定</el-button
  149. >
  150. </template>
  151. </avue-crud>
  152. <CommonTable
  153. ref="ctableRef"
  154. tableTitle="添加产品"
  155. tableType="MARTERIAL"
  156. @selected-sure="onSelectedFinish"
  157. />
  158. <CommonTable
  159. ref="commonRef"
  160. tableTitle="选择通用工艺"
  161. tableType="ROUTE_COMMON"
  162. @selected-sure="onCommonFinish"
  163. />
  164. <ExcelUpload ref="uploadRef" @finished="uploadFinished" />
  165. <el-dialog
  166. v-model="centerDialogVisible"
  167. title="重命名"
  168. width="500"
  169. align-center
  170. >
  171. <el-form :model="tmpForm" label-width="auto" style="max-width: 800px">
  172. <el-row>
  173. <el-col :span="12">
  174. <el-form-item label="工艺路线编号">
  175. <el-input v-model="tmpForm.processRouteCode" />
  176. </el-form-item>
  177. </el-col>
  178. <el-col :span="12">
  179. <el-form-item label="工艺路线名称">
  180. <el-input v-model="tmpForm.processRouteName" />
  181. </el-form-item>
  182. </el-col>
  183. </el-row>
  184. </el-form>
  185. <template #footer>
  186. <div class="dialog-footer">
  187. <el-button @click="centerDialogVisible = false">取消</el-button>
  188. <el-button type="primary" @click="renameRoute()"> 确定 </el-button>
  189. </div>
  190. </template>
  191. </el-dialog>
  192. <el-dialog
  193. v-model="productManagerVisible"
  194. title="编辑产品负责人"
  195. width="500"
  196. align-center
  197. >
  198. <el-form
  199. :model="form"
  200. label-width="auto"
  201. style="max-width: 800px"
  202. :rules="rules"
  203. >
  204. <el-form-item label="产品负责人" prop="productManager">
  205. <!-- <el-select
  206. v-model="form.productManager"
  207. placeholder="产品负责人"
  208. filterable
  209. >
  210. <el-option
  211. v-for="item in userList"
  212. :key="item.userName"
  213. :label="item.userName"
  214. :value="item.userName"
  215. />
  216. </el-select>-->
  217. <el-tree-select
  218. v-model="form.productManager"
  219. :data="userList"
  220. filterable
  221. />
  222. </el-form-item>
  223. </el-form>
  224. <template #footer>
  225. <div class="dialog-footer">
  226. <el-button @click="sureCancelProductManager">取消</el-button>
  227. <el-button type="primary" @click="sureToEditProductManager">
  228. 确定
  229. </el-button>
  230. </div>
  231. </template>
  232. </el-dialog>
  233. <el-dialog
  234. v-model="dialog1.visible"
  235. :title="dialog1.title"
  236. width="900px"
  237. @close="dialog1.visible = false"
  238. :destroy-on-close="true"
  239. >
  240. <RouteChangeLog :targetRouteId="routeDeatil.id" />
  241. </el-dialog>
  242. <el-dialog
  243. v-model="dialog2.visible"
  244. :title="dialog2.title"
  245. width="900px"
  246. @close="dialog2.visible = false"
  247. :destroy-on-close="true"
  248. >
  249. <el-table
  250. :data="tableData"
  251. style="width: 100%"
  252. ref="singleTableRef"
  253. highlight-current-row
  254. @current-change="handleCurrentChange"
  255. >
  256. <el-table-column type="index" width="50" />
  257. <el-table-column prop="id" label="id" width="180" v-if="false" />
  258. <el-table-column
  259. prop="processRouteName"
  260. label="工艺路线名称"
  261. width="180"
  262. />
  263. <el-table-column
  264. prop="processRouteCode"
  265. label="工艺路线编码"
  266. width="180"
  267. />
  268. <el-table-column prop="processRouteVersion" label="版本" />
  269. <el-table-column prop="prodtName" label="产品名称" />
  270. <el-table-column prop="prodtModel" label="产品规格" width="180" />
  271. </el-table>
  272. <template #footer>
  273. <div class="footer">
  274. <el-button type="primary" @click="copyProcess()" :loading="isLoading"
  275. >复制</el-button
  276. >
  277. <el-button
  278. type="primary"
  279. @click="bindProcess(rowDetail)"
  280. :loading="loading"
  281. >自定义</el-button
  282. >
  283. <el-button @click="dialog2.visible = false">取消</el-button>
  284. </div>
  285. </template>
  286. </el-dialog>
  287. <LookFlowStep ref="LookFlowStepRef"></LookFlowStep>
  288. <work-flow-check
  289. ref="workFlowCheckRef"
  290. @sureToSave="onWFSave"
  291. ></work-flow-check>
  292. </div>
  293. </template>
  294. <script setup>
  295. import { ref, getCurrentInstance } from "vue";
  296. import { useCrud } from "@/hooks/userCrud";
  297. import dictDataUtil from "@/common/configs/dictDataUtil";
  298. import { useDictionaryStore } from "@/store";
  299. import {
  300. copyList,
  301. copyProductRoute,
  302. copyRoute,
  303. editRouteWith,
  304. getMaxRouteVersion,
  305. updateMain,
  306. } from "@/api/craft/route/index";
  307. import { getUserTree } from "@/api/system/user/index";
  308. import RouteChangeLog from "@/views/base/craftManagement/route/components/routeChangeLog.vue";
  309. import { ElMessageBox } from "element-plus";
  310. import WorkFlowCheck from "@/components/WorkFlows/workFlowCheck.vue";
  311. import LookFlowStep from "@/views/flow/common/LookFlowStep.vue";
  312. import { cancelFlow, submitFlow } from "@/api/flow";
  313. const isLoading = ref(false);
  314. const loading = ref(false);
  315. // 数据字典相关
  316. const { dicts } = useDictionaryStore();
  317. const sureCancelProductManager = () => {
  318. productManagerVisible.value = false;
  319. dataList();
  320. form.value = {};
  321. };
  322. const tableData = ref([]);
  323. const currentRow = ref();
  324. const singleTableRef = ref(null);
  325. const handleCurrentChange = (val) => {
  326. currentRow.value = val;
  327. };
  328. const setMain = (row) => {
  329. ElMessageBox.confirm("是否将该工艺路线设置为主路线?", "提示", {
  330. confirmButtonText: "确定",
  331. cancelButtonText: "取消",
  332. type: "warning",
  333. }).then(async () => {
  334. updateMain(row).then((data) => {
  335. ElMessage.success(data.msg);
  336. dataList();
  337. });
  338. });
  339. };
  340. const dialog1 = ref({
  341. title: "修改记录",
  342. visible: false,
  343. });
  344. const dialog2 = ref({
  345. title: "绑定",
  346. visible: false,
  347. });
  348. const routeData = ref({});
  349. // 传入一个url,后面不带/
  350. const { form, data, option, search, page, toDeleteIds, Methords, Utils } =
  351. useCrud({
  352. src: "/api/v1/op/route",
  353. afterAdd: (routeData) => {
  354. if (routeData.sourceRouteId) {
  355. router.push({
  356. path: `/base/craftManagement/bindProcess/${routeData.id}/${routeData.prodtCode}`,
  357. });
  358. }
  359. },
  360. });
  361. const { dataList, createRow, updateRow, deleteRow, searchChange, resetChange } =
  362. Methords; //增删改查
  363. const { selectionChange, multipleDelete } = Methords; //选中和批量删除事件
  364. const { checkBtnPerm, downloadTemplate, exportData } = Utils; //按钮权限等工具
  365. // checkBtnPerm(ButtonPermKeys.PLAN.BTNS.order_add) :permission="permission"
  366. // const permission = reactive({
  367. // delBtn: checkPerm(buttonPermission.PLAN.BTNS.order_del),
  368. // addBtn: checkPerm(buttonPermission.PLAN.BTNS.order_add),
  369. // editBtn: checkPerm(buttonPermission.PLAN.BTNS.order_edit),
  370. // menu: true,
  371. // });
  372. const rowDetail = ref({});
  373. let centerDialogVisible = ref(false);
  374. const crudRef = ref(null); //crudRef.value 获取avue-crud对象
  375. const tmpForm = ref({});
  376. // 产品负责人相关
  377. const userList = ref([]);
  378. const currentPMRow = ref({});
  379. const productManagerVisible = ref(false);
  380. const showProductManager = (row, index) => {
  381. productManagerVisible.value = true;
  382. currentPMRow.value = row;
  383. form.value = row;
  384. };
  385. const rules = reactive({
  386. productManager: [
  387. { required: true, message: "产品管理员不能为空", trigger: "blur" },
  388. ],
  389. });
  390. const sureToEditProductManager = () => {
  391. editRouteWith(currentPMRow.value).then(() => {
  392. dataList();
  393. productManagerVisible.value = false;
  394. form.value = {};
  395. });
  396. };
  397. const copyProductProject = ref({});
  398. const copyProcess = () => {
  399. if (!currentRow.value) {
  400. ElMessage.error("未选择要复制工艺路线!");
  401. return;
  402. }
  403. isLoading.value = true;
  404. loading.value = true;
  405. copyProductProject.value.sourceId = currentRow.value.id;
  406. copyProductProject.value.targetId = rowDetail.value.id;
  407. copyProductRoute(copyProductProject.value)
  408. .then((data) => {
  409. if (data.code === "200") {
  410. isLoading.value = false;
  411. loading.value = false;
  412. dialog2.value.visible = false;
  413. dataList();
  414. ElMessage.success(data.msg);
  415. }
  416. })
  417. .finally(() => {
  418. isLoading.value = false;
  419. loading.value = false;
  420. });
  421. };
  422. onMounted(() => {
  423. // console.log("crudRef", crudRef)
  424. dataList();
  425. getUserTree().then((data) => {
  426. userList.value = data.data;
  427. });
  428. });
  429. /**
  430. * 上传excel相关
  431. */
  432. const uploadRef = ref(null);
  433. const uploadFinished = () => {
  434. // 上传完成后的刷新操作
  435. page.currentPage = 1;
  436. dataList();
  437. };
  438. const routeDeatil = ref({});
  439. const changeLog = (row) => {
  440. routeDeatil.value = row;
  441. dialog1.value.visible = true;
  442. };
  443. const doEdit = (row, index) => {
  444. row.prodtName1 = row.prodtName;
  445. crudRef.value && crudRef.value.rowEdit(row, index);
  446. };
  447. const importExcelData = () => {
  448. if (uploadRef.value) {
  449. uploadRef.value.show("/api/v1/op/route/import");
  450. }
  451. };
  452. // 选择产品相关
  453. const ctableRef = ref(null);
  454. const commonRef = ref(null);
  455. const onSelectedFinish = (selectedValue) => {
  456. // search.value.prodtName = selectedValue.materialName;
  457. form.value.prodtName = selectedValue.materialName;
  458. form.value.prodtName1 = selectedValue.materialName;
  459. form.value.prodtCode = selectedValue.materialCode;
  460. form.value.prodtModel = selectedValue.spec;
  461. };
  462. const onCommonFinish = (selectedValue) => {
  463. form.value.commonRouteId = selectedValue.id;
  464. form.value.commonRouteName = selectedValue.processRouteName;
  465. form.value.commonRouteCode = selectedValue.processRouteCode;
  466. };
  467. const startChooseProduct = () => {
  468. if (ctableRef.value) {
  469. ctableRef.value.startSelect();
  470. }
  471. };
  472. const startChooseRoute = () => {
  473. if (ctableRef.value) {
  474. commonRef.value.startSelect();
  475. }
  476. };
  477. // 已经绑定了工序的可以复制,跟后端HT商量只传id即可。
  478. const copyRow = (row) => {
  479. option.value.column.forEach((item) => {
  480. if (item.prop === "commonRouteCode" || item.prop === "commonRouteName") {
  481. item.display = false;
  482. }
  483. });
  484. if (row.usable == 0) {
  485. ElMessage.error("该路线未被绑定!");
  486. return;
  487. }
  488. getMaxRouteVersion(row.prodtCode).then((data) => {
  489. if (data.code === "200") {
  490. form.value = Object.assign(form.value, row);
  491. form.value.processRouteVersion = "";
  492. if (data.data) {
  493. form.value.processRouteVersion = (parseFloat(data.data) + 1).toFixed(1);
  494. }
  495. form.value.prodtName1 = row.prodtName;
  496. crudRef.value.rowAdd();
  497. }
  498. });
  499. };
  500. // 工作流相关 start
  501. const workFlowCheckRef = ref(null);
  502. const openCheckView = (row) => {
  503. row.businessId = row.id;
  504. workFlowCheckRef.value &&
  505. workFlowCheckRef.value.openDialog(row, "routeFlowService");
  506. };
  507. const LookFlowStepRef = ref(null);
  508. const showFlowSteps = (row) => {
  509. LookFlowStepRef.value &&
  510. LookFlowStepRef.value.openFlowStepDrawer(row.flowIns);
  511. };
  512. const onCancelFlow = (row) => {
  513. console.log(row);
  514. cancelFlow({
  515. businessId: row.id,
  516. flowIns: row.flowIns,
  517. }).then(() => {
  518. ElMessage.success("撤销成功");
  519. dataList();
  520. });
  521. };
  522. const onWFSave = (flowForm) => {
  523. submitFlow(flowForm).then(() => {
  524. ElMessage.success("提交成功");
  525. workFlowCheckRef.value && workFlowCheckRef.value.close();
  526. dataList();
  527. });
  528. };
  529. // 工作流相关 end
  530. const renameRoute = () => {
  531. tmpForm.value.id;
  532. tmpForm.value.processRouteCode;
  533. tmpForm.value.processRouteName;
  534. copyRoute(tmpForm.value).then(() => {
  535. tmpForm.value.id = undefined;
  536. tmpForm.value.processRouteCode = undefined;
  537. tmpForm.value.processRouteName = undefined;
  538. page.currentPage = 1;
  539. dataList();
  540. });
  541. centerDialogVisible.value = false;
  542. };
  543. const router = useRouter();
  544. // 绑定工序
  545. const bindProcess = (row) => {
  546. router.push({
  547. path: `/base/craftManagement/bindProcess/${row.id}/${row.prodtCode}`,
  548. });
  549. };
  550. const bindProcessPop = (row) => {
  551. if (row.routeData) {
  552. router.push({
  553. path: `/base/craftManagement/bindProcess/${row.id}/${row.prodtCode}/${row.usable}`,
  554. });
  555. return;
  556. }
  557. copyList(row).then((data) => {
  558. tableData.value = data.data;
  559. console.log(tableData.value);
  560. if (!tableData.value || tableData.value.length == 0) {
  561. router.push({
  562. path: `/base/craftManagement/bindProcess/${row.id}/${row.prodtCode}/${row.usable}`,
  563. });
  564. return;
  565. }
  566. rowDetail.value = row;
  567. dialog2.value.visible = true;
  568. });
  569. };
  570. // 设置表格列或者其他自定义的option
  571. option.value = Object.assign(option.value, {
  572. searchEnter: true,
  573. selection: true,
  574. labelWidth: 150,
  575. menuWidth: 250,
  576. delBtn: false,
  577. searchLabelWidth: 110,
  578. editBtn: false,
  579. rowParentKey: "mainCode",
  580. column: [
  581. {
  582. label: "工艺路线名称",
  583. prop: "processRouteName",
  584. width: 150,
  585. search: true,
  586. overHidden: true,
  587. rules: [
  588. {
  589. required: true,
  590. message: "工艺路线名称不能为空",
  591. trigger: "blur",
  592. },
  593. ],
  594. },
  595. {
  596. label: "工艺路线编号",
  597. prop: "processRouteCode",
  598. search: true,
  599. width: 150,
  600. addDisplay: true,
  601. editDisabled: true,
  602. overHidden: true,
  603. display: false,
  604. },
  605. {
  606. label: "工艺路线类型",
  607. prop: "processRouteType",
  608. minWidth: 120,
  609. search: true,
  610. overHidden: true,
  611. rules: [
  612. {
  613. required: true,
  614. message: "工艺路线类型不能为空",
  615. trigger: "change",
  616. },
  617. ],
  618. type: "select",
  619. dicUrl: dictDataUtil.request_url + dictDataUtil.TYPE_CODE.routing_type,
  620. props: {
  621. label: "dictLabel",
  622. value: "dictValue",
  623. },
  624. },
  625. {
  626. label: "通用工艺id",
  627. prop: "commonRouteId",
  628. addDisplay: false,
  629. editDisplay: false,
  630. hide: true,
  631. width: 150,
  632. overHidden: true,
  633. },
  634. {
  635. label: "通用工艺名称",
  636. prop: "commonRouteName",
  637. editDisplay: false,
  638. width: 150,
  639. overHidden: true,
  640. click: () => {
  641. startChooseRoute();
  642. },
  643. },
  644. {
  645. label: "通用工艺编码",
  646. prop: "commonRouteCode",
  647. disabled: true,
  648. editDisplay: false,
  649. width: 150,
  650. overHidden: true,
  651. },
  652. {
  653. label: "执行文件和标准",
  654. prop: "executeFileStd",
  655. width: 180,
  656. addDisplay: true,
  657. editDisabled: false,
  658. overHidden: true,
  659. rules: [
  660. {
  661. required: true,
  662. message: "执行文件和标准不能为空",
  663. trigger: "blur",
  664. },
  665. ],
  666. },
  667. {
  668. label: "是否查看产品文档",
  669. prop: "documentShow",
  670. hide: true,
  671. type: "select",
  672. display: true,
  673. rules: [
  674. {
  675. required: true,
  676. trigger: "blur",
  677. },
  678. ],
  679. dicData: [
  680. {
  681. label: "是",
  682. value: 1,
  683. },
  684. {
  685. label: "否",
  686. value: 0,
  687. },
  688. ],
  689. value: 0,
  690. },
  691. {
  692. label: "产品名称",
  693. prop: "prodtName",
  694. overHidden: true,
  695. width: 150,
  696. search: true,
  697. editDisplay: false,
  698. addDisplay: false,
  699. rules: [
  700. {
  701. required: true,
  702. message: "请选择产品",
  703. trigger: "blur",
  704. },
  705. ],
  706. },
  707. {
  708. label: "产品名称",
  709. prop: "prodtName1",
  710. overHidden: true,
  711. hide: true,
  712. viewDisplay: false,
  713. width: 150,
  714. rules: [
  715. {
  716. required: true,
  717. message: "请选择产品",
  718. trigger: "blur",
  719. },
  720. ],
  721. readOnly: true,
  722. click: () => {
  723. startChooseProduct();
  724. },
  725. change: ({ value, column }) => {
  726. if (value != form.value.prodtName1) {
  727. startChooseProduct();
  728. }
  729. },
  730. },
  731. {
  732. label: "产品编号",
  733. prop: "prodtCode",
  734. overHidden: true,
  735. search: true,
  736. width: 150,
  737. disabled: true,
  738. },
  739. {
  740. label: "产品负责人",
  741. prop: "productManager",
  742. width: 120,
  743. slot: true,
  744. rules: [
  745. {
  746. required: true,
  747. message: "工艺路线类型不能为空",
  748. trigger: "change",
  749. },
  750. ],
  751. },
  752. {
  753. label: "产品型号",
  754. prop: "prodtModel",
  755. overHidden: true,
  756. search: true,
  757. minWidth: 200,
  758. disabled: true,
  759. },
  760. // 在产品那边绑定了工艺路线才是已绑定
  761. {
  762. label: "路线状态",
  763. prop: "usable",
  764. addDisplay: false,
  765. editDisplay: false,
  766. slot: true,
  767. width: 100,
  768. type: "radio",
  769. dicData: [
  770. {
  771. label: "已绑定",
  772. value: 1,
  773. },
  774. {
  775. label: "未绑定",
  776. value: 0,
  777. },
  778. ],
  779. },
  780. {
  781. label: "启用状态",
  782. prop: "enabled",
  783. addDisplay: false,
  784. editDisplay: false,
  785. slot: true,
  786. width: 100,
  787. type: "radio",
  788. dicData: [
  789. {
  790. label: "未启用",
  791. value: 1,
  792. },
  793. {
  794. label: "启用",
  795. value: 0,
  796. },
  797. ],
  798. value: 0,
  799. },
  800. {
  801. label: "流程状态",
  802. prop: "flowState",
  803. width: 120,
  804. search: true,
  805. addDisplay: false,
  806. editDisplay: false,
  807. overHidden: true,
  808. type: "select",
  809. dicUrl: dictDataUtil.request_url + dictDataUtil.TYPE_CODE.flow_ins_state,
  810. props: {
  811. label: "dictLabel",
  812. value: "dictValue",
  813. },
  814. },
  815. // 只有绑定了工序才可以复制。
  816. {
  817. label: "是否可复制",
  818. prop: "usable2",
  819. slot: true,
  820. width: 100,
  821. search: false,
  822. filterable: true,
  823. hide: true,
  824. addDisplay: false,
  825. editDisplay: false,
  826. type: "radio",
  827. dicData: [
  828. {
  829. label: "否",
  830. value: 0,
  831. },
  832. {
  833. label: "是",
  834. value: 1,
  835. },
  836. ],
  837. value: 0,
  838. },
  839. {
  840. label: "版本",
  841. prop: "processRouteVersion",
  842. addDisplay: true,
  843. editDisplay: true,
  844. type: "number",
  845. min: 1,
  846. value: 1.0,
  847. rules: [
  848. {
  849. required: true,
  850. message: "版本不能为空",
  851. trigger: "blur",
  852. },
  853. ],
  854. precision: 1,
  855. },
  856. {
  857. label: "来源版本",
  858. prop: "sourceVersion",
  859. display: false,
  860. },
  861. {
  862. label: "创建人",
  863. prop: "creator",
  864. addDisplay: false,
  865. editDisplay: false,
  866. overHidden: true,
  867. },
  868. {
  869. label: "创建时间",
  870. prop: "created",
  871. addDisplay: false,
  872. editDisplay: false,
  873. width: 150,
  874. overHidden: true,
  875. },
  876. {
  877. label: "主分支编码",
  878. prop: "mainCode",
  879. width: 150,
  880. hide: true,
  881. display: false,
  882. },
  883. ],
  884. });
  885. </script>