Dispatching.vue 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829
  1. <template>
  2. <div>
  3. <Toptitle title="派工">
  4. <Button @click="goBack" type="primary" ghost style="margin-right:10px;"
  5. >返回</Button
  6. >
  7. <Button
  8. @click="handleGoPage"
  9. type="primary"
  10. ghost
  11. style="margin-right:10px;"
  12. >派工单查询</Button
  13. >
  14. <Button
  15. @click="handleDispatchConfirm"
  16. type="primary"
  17. style="margin-right:10px;"
  18. >确认派工</Button
  19. >
  20. </Toptitle>
  21. <div class="main">
  22. <Form style='display:flex;margin:15px 0;flex-wrap:wrap' :label-width='100'>
  23. <FormItem label='订单编号:' >
  24. <Select style="width:200px" v-model="searchData.order_no" filterable @on-change='orderNoChange' clearable>
  25. <Option :value="item" :label="item" v-for="(item,index) in orderList" :key="index"></Option>
  26. </Select>
  27. </FormItem>
  28. <FormItem label='项目名称:' >
  29. <Select style="width:200px" v-model="searchData.residential_name" filterable @on-change='residentialNameChange' clearable>
  30. <Option :value="item" :label="item" v-for="(item,index) in projectList" :key="index"></Option>
  31. </Select>
  32. </FormItem>
  33. <FormItem label='图号:'>
  34. <Tooltip placement='top' max-width='600' transfer>
  35. <Select style="width:200px" v-model="searchData.url_number" multiple filterable :disabled='show' :max-tag-count='1' >
  36. <Option value='全部' label="全部" @click.native="total_choose"></Option>
  37. <Option :value="item" :label="item" v-for="(item,index) in urlNumberList" :key="index"></Option>
  38. </Select>
  39. <div slot="content">
  40. {{searchData.url_number.toString()}}
  41. </div>
  42. </Tooltip>
  43. </FormItem>
  44. <FormItem>
  45. <Button type="primary" @click="initDataSearch">搜索</Button>
  46. </FormItem>
  47. </Form>
  48. <div class="header">
  49. <Tabs v-model="currencyTag" @on-click="handleProcedureChange">
  50. <TabPane
  51. v-for="item in basicsProcedureList"
  52. :key="item.id"
  53. :label="item.title"
  54. :name="item.id + ''"
  55. />
  56. <div slot="extra" style="width:250px;line-height:40px;font-size:12px">
  57. <label style="width:130px">批量设置班组:</label>
  58. <Select v-model="group" size='small' style="z-index:99;position: fixed;width:150px;margin-top: 6px;margin-left:10px" @on-change='change_NK' clearable> <Option :value="_item.id" :label="_item.nickname" v-for="_item in groupList" :key="_item.id">
  59. </Option> </Select>
  60. </div>
  61. </Tabs>
  62. </div>
  63. <div class="content">
  64. <Table
  65. :columns="tableColumns"
  66. border
  67. max-height="700"
  68. @on-selection-change="handleSelectionChange"
  69. :data="tableData"
  70. ref="y_table"
  71. >
  72. <template slot="slotGroup" slot-scope="{ row, index }">
  73. <Select
  74. v-model="row.employee_id"
  75. size="small"
  76. @on-change="
  77. (e) =>
  78. handleGroupSelect(
  79. e,
  80. tableData[index],
  81. index,
  82. tableData[index].employee_id
  83. )
  84. "
  85. clearable
  86. style="width: 150px"
  87. >
  88. <Option
  89. v-for="sitem in row.employee_list"
  90. :key="sitem.id"
  91. :label="sitem.nickname"
  92. :value="sitem.id"
  93. >
  94. </Option>
  95. </Select>
  96. </template>
  97. <template slot="slotSet" slot-scope="{ row, index }">
  98. <a style="margin:0 5px" @click="handleSet(row, index)">详情</a>
  99. <!-- <a style="margin:0 5px" @click="handleDispatchConfirm(row, index)"
  100. >派工</a
  101. > -->
  102. </template>
  103. </Table>
  104. </div>
  105. </div>
  106. <div class="pageSlotStyle">
  107. <Page :page-size-opts="[10, 20, 30, 40,100,1000]"
  108. @on-page-size-change='changeSize'
  109. @on-change='changePage'
  110. :current='page_index'
  111. show-total
  112. :total="total"
  113. show-sizer
  114. :page-size='page_size' />
  115. </div>
  116. <Modal v-model="showModal" title="确认派工">
  117. <Form :label-width="85" ref="forms" :model="dispatchInfo">
  118. <FormItem label="选择时间">
  119. <DatePicker
  120. :options="options"
  121. style="width:100%;"
  122. v-model="dispatchTime"
  123. clearable
  124. type="daterange"
  125. split-panels
  126. placeholder="请选择日期"
  127. ></DatePicker>
  128. </FormItem>
  129. <FormItem label="点工单形式">
  130. <RadioGroup v-model="dispatchInfo.work_type">
  131. <Radio :label="1">是</Radio>
  132. <Radio :label="0">否</Radio>
  133. </RadioGroup>
  134. </FormItem>
  135. <FormItem label="日薪" v-if="dispatchInfo.work_type == 1">
  136. <Input v-model="dispatchInfo.user_salary">
  137. <span slot="append">元</span>
  138. </Input>
  139. </FormItem>
  140. </Form>
  141. <div slot="footer">
  142. <Button @click="showModal = false">取消</Button>
  143. <Button type="primary" @click="handleDispatch(subArr, subUrl)"
  144. >确认</Button
  145. >
  146. </div>
  147. </Modal>
  148. <Modal v-model="showModalAll" title="全部派工">
  149. <Table
  150. :columns="modalTableColumns"
  151. border
  152. max-height="700"
  153. :data="modalTableData"
  154. >
  155. <template slot="slotGroup" slot-scope="{ row, index }">
  156. <Select
  157. v-model="row.employee_id"
  158. size="small"
  159. @on-change="
  160. (e) =>
  161. handleGroupSelect(
  162. e,
  163. modalTableData[index],
  164. index,
  165. modalTableData[index].employee_id
  166. )
  167. "
  168. clearable
  169. style="width: 120px"
  170. >
  171. <Option
  172. v-for="sitem in row.employee_list"
  173. :key="sitem.id"
  174. :label="sitem.nickname"
  175. :value="sitem.id"
  176. >
  177. </Option>
  178. </Select>
  179. </template>
  180. </Table>
  181. <div slot="footer">
  182. <Button @click="showModalAll = false">取消</Button>
  183. <Button type="primary" @click="handleDispatchAllConfirm">确认</Button>
  184. </div>
  185. </Modal>
  186. </div>
  187. </template>
  188. <script>
  189. // 这里可以导入其他文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等)
  190. // 例如:import 《组件名称》 from '《组件路径》';
  191. export default {
  192. name: "",
  193. components: {},
  194. props: {},
  195. // import引入的组件需要注入到对象中才能使用
  196. data() {
  197. // 这里存放数据
  198. return {
  199. show:true,
  200. orderList:[],
  201. urlNumberList:[],
  202. projectList:[],
  203. tableColumns: [
  204. { title: '全选', type: 'selection', align: 'center', minWidth: 60 },
  205. { title: "工序", align: "center", key: "title", minWidth: 150 },
  206. { title: "图号", align: "center", key: "url_number", minWidth: 150 ,ellipsis:'true',tooltip:'true' },
  207. { title: "部件总数", align: "center", key: "num", minWidth: 150 },
  208. {
  209. title: "班组",
  210. align: "center",
  211. key: "",
  212. minWidth: 150,
  213. slot: "slotGroup",
  214. },
  215. {
  216. title: "操作",
  217. align: "center",
  218. key: "",
  219. minWidth: 100,
  220. slot: "slotSet",
  221. },
  222. ],
  223. modalTableColumns: [
  224. { title: "工序", align: "center", key: "title", minWidth: 150 },
  225. { title: "部件总数", align: "center", key: "num", minWidth: 150 },
  226. {
  227. title: "班组",
  228. align: "center",
  229. key: "",
  230. minWidth: 150,
  231. slot: "slotGroup",
  232. },
  233. ],
  234. modalTableData: [{}],
  235. tableData: [{}],
  236. page_index: 1,
  237. page_size: 10,
  238. total: 0,
  239. group:'',
  240. basicsProcedureList: [],
  241. groupList: [],
  242. currencyTag: "1",
  243. dispatchTime: [],
  244. wood_select:[],
  245. wood_group:'',
  246. paint_select:[],
  247. paint_group:'',
  248. packing_select:[],
  249. packing_group:'',
  250. transit_select:[],
  251. transit_group:'',
  252. install_select:[],
  253. install_group:'',
  254. selected: [],
  255. searchData:{
  256. order_no:'',
  257. url_number:[],
  258. residential_name:''
  259. },
  260. showModal: false,
  261. showModalAll: false,
  262. options: {
  263. disabledDate(date) {
  264. return date && date.valueOf() < Date.now() - 86400000;
  265. },
  266. },
  267. dispatchInfo: {},
  268. subArr: [],
  269. subUrl: "",
  270. show_type:true,
  271. url_number_type:true,
  272. };
  273. },
  274. // 生命周期 - 创建完成(可以访问当前this实例)
  275. created() {
  276. // 获取工序分类列表
  277. this.axios({ method: "get", url: "/api/basics_procedure_index" })
  278. .then((res) => {
  279. (this.basicsProcedureList = res.data.data),
  280. (this.currencyTag =
  281. localStorage.getItem("dispatchTag") || this.currencyTag + "");
  282. })
  283. .catch((err) => {});
  284. //获取班组列表
  285. this.axios("/api/employee_list").then(
  286. (res) => (this.groupList = res.data)
  287. );
  288. },
  289. // 生命周期 - 挂载完成(可以访问DOM元素)
  290. mounted() {
  291. this.initData();
  292. this.axios({
  293. method: "post",
  294. url: "/api/order_produce_list",
  295. data: {
  296. basics_procedure_id:
  297. localStorage.getItem("dispatchTag") || this.currencyTag,
  298. page_index:this.page_index,
  299. page_size:this.page_size,
  300. },
  301. }).then(res=>{
  302. this.orderList = res.data.order_no;
  303. this.projectList = res.data.residential_name;
  304. })
  305. },
  306. methods: {
  307. total_choose(){
  308. console.log(this.urlNumberList)
  309. if(this.searchData.url_number.indexOf('全部')>=0){
  310. this.searchData.url_number = JSON.parse(JSON.stringify(this.urlNumberList))
  311. this.searchData.url_number.unshift('全部')
  312. }else{
  313. this.searchData.url_number = [];
  314. }
  315. },
  316. initDataSearch(){
  317. if(this.searchData.residential_name&&this.searchData.order_no){
  318. this.url_number_type = false;
  319. this.initData();
  320. }else{
  321. this.url_number_type = true;
  322. this.initData();
  323. }
  324. },
  325. async residentialNameChange(val){
  326. await this.axios.get('/api/order_produce_order_no',{params:{residential_name:val}}).then(res=>{
  327. this.searchData.order_no = res.data.order_no
  328. })
  329. if(this.searchData.residential_name&&this.searchData.order_no){
  330. this.show = false;
  331. this.axios.get('/api/order_produce_url_number',{params:{...this.searchData,type_id:this.currencyTag}}).then(res=>{
  332. this.urlNumberList = res.data;
  333. this.searchData.url_number = [];
  334. this.wood_select=[]
  335. this.paint_select=[]
  336. this.packing_select=[]
  337. this.transit_select=[]
  338. this.install_select=[]
  339. })
  340. }else{
  341. this.show = true;
  342. if(this.show){
  343. this.searchData.url_number = []
  344. }
  345. }
  346. },
  347. async orderNoChange(val){
  348. await this.axios.get('/api/order_produce_order_no',{params:{order_no:val}}).then(res=>{
  349. this.searchData.residential_name = res.data.residential_name
  350. })
  351. if(this.searchData.residential_name&&this.searchData.order_no){
  352. this.show = false;
  353. this.axios.get('/api/order_produce_url_number',{params:{...this.searchData,type_id:this.currencyTag}}).then(res=>{
  354. this.urlNumberList = res.data;
  355. this.searchData.url_number = [];
  356. this.wood_select=[]
  357. this.paint_select=[]
  358. this.packing_select=[]
  359. this.transit_select=[]
  360. this.install_select=[]
  361. })
  362. }else{
  363. this.show =true;
  364. if(this.show){
  365. this.searchData.url_number = [];
  366. }
  367. }
  368. },
  369. change_NK(row){
  370. if(row == null){
  371. return
  372. }else{
  373. if(this.currencyTag == 1){
  374. if(this.wood_select.length == 0){
  375. this.$Message.warning('请先选择工序!');
  376. setTimeout(()=>{
  377. this.group = '';
  378. })
  379. }else{
  380. this.tableData.forEach(item=>{
  381. this.wood_select.forEach(_item=>{
  382. if(_item.id == item.id){
  383. item.employee_id = row;
  384. item._checked = true;
  385. _item.employee_id = row;
  386. }
  387. })
  388. })
  389. }
  390. }
  391. if(this.currencyTag == 2){
  392. if(this.paint_select.length == 0){
  393. this.$Message.warning('请先选择工序!');
  394. setTimeout(()=>{
  395. this.group = '';
  396. })
  397. }else{
  398. this.tableData.forEach(item=>{
  399. this.paint_select.forEach(_item=>{
  400. if(_item.id == item.id){
  401. item.employee_id = row;
  402. item._checked = true;
  403. _item.employee_id = row;
  404. }
  405. })
  406. })
  407. }
  408. }
  409. if(this.currencyTag == 3){
  410. if(this.packing_select.length == 0){
  411. this.$Message.warning('请先选择工序!');
  412. setTimeout(()=>{
  413. this.group = '';
  414. })
  415. }else{
  416. this.tableData.forEach(item=>{
  417. this.packing_select.forEach(_item=>{
  418. if(_item.id == item.id){
  419. item.employee_id = row;
  420. item._checked = true;
  421. _item.employee_id = row;
  422. }
  423. })
  424. })
  425. }
  426. }
  427. if(this.currencyTag == 4){
  428. if(this.transit_select.length == 0){
  429. this.$Message.warning('请先选择工序!');
  430. setTimeout(()=>{
  431. this.group = '';
  432. })
  433. }else{
  434. this.tableData.forEach(item=>{
  435. this.transit_select.forEach(_item=>{
  436. if(_item.id == item.id){
  437. item.employee_id = row;
  438. item._checked = true;
  439. _item.employee_id = row;
  440. }
  441. })
  442. })
  443. }
  444. }
  445. if(this.currencyTag == 5){
  446. if(this.install_select.length == 0){
  447. this.$Message.warning('请先选择工序!');
  448. setTimeout(()=>{
  449. this.group = '';
  450. })
  451. }else{
  452. this.tableData.forEach(item=>{
  453. this.install_select.forEach(_item=>{
  454. if(_item.id == item.id){
  455. item.employee_id = row;
  456. item._checked = true;
  457. _item.employee_id = row;
  458. }
  459. })
  460. })
  461. }
  462. }
  463. }
  464. },
  465. initData() {
  466. this.axios({
  467. method: "post",
  468. url: "/api/order_produce_list",
  469. data:{
  470. basics_procedure_id:
  471. localStorage.getItem("dispatchTag") || this.currencyTag,
  472. page_index:this.page_index,
  473. page_size:this.page_size,
  474. ...this.searchData
  475. },
  476. })
  477. .then((res) => {
  478. this.group = '';
  479. this.total = res.data.total;
  480. this.tableData = res.data.data;
  481. this.tableData.forEach((element) => {
  482. if(this.url_number_type){
  483. element.url_number = '';
  484. }
  485. element.produce_id = element.id;
  486. element.employee_id ? "" : (element.employee_id = "");
  487. if(this.currencyTag == 1 ){
  488. this.wood_select.forEach(_item=>{
  489. if(_item.id == element.id){
  490. element._checked = true;
  491. element.employee_id = _item.employee_id;
  492. }
  493. })
  494. }
  495. if(this.currencyTag == 2 ){
  496. this.paint_select.forEach(_item=>{
  497. if(_item.id == element.id){
  498. element._checked = true;
  499. element.employee_id = _item.employee_id;
  500. }
  501. })
  502. }
  503. if(this.currencyTag == 3 ){
  504. this.packing_select.forEach(_item=>{
  505. if(_item.id == element.id){
  506. element._checked = true;
  507. element.employee_id = _item.employee_id;
  508. }
  509. })
  510. }
  511. if(this.currencyTag == 4 ){
  512. this.transit_select.forEach(_item=>{
  513. if(_item.id == element.id){
  514. element._checked = true;
  515. element.employee_id = _item.employee_id;
  516. }
  517. })
  518. }
  519. if(this.currencyTag == 5 ){
  520. this.install_select.forEach(_item=>{
  521. if(_item.id == element.id){
  522. element._checked = true;
  523. element.employee_id = _item.employee_id;
  524. }
  525. })
  526. }
  527. });
  528. this.$forceUpdate();
  529. })
  530. .catch((err) => {});
  531. },
  532. goBack() {
  533. this.$router.go(-1);
  534. },
  535. handleGoPage() {
  536. this.$router.push({ path: "/cms/Dispatching/DispatchedList" });
  537. },
  538. handleSet(row, index) {
  539. this.$router.push({
  540. path: "/cms/Dispatching/DispatchingDetail",
  541. query: {
  542. produce_id: row.id,
  543. },
  544. });
  545. },
  546. // handleDispatchConfirm(row, index) {
  547. // if (row.employee_id) {
  548. // this.selected = [row];
  549. // this.showModal = true;
  550. // this.subArr = JSON.parse(JSON.stringify(this.selected));
  551. // this.subUrl = "/api/order_produce_pull_all";
  552. // } else {
  553. // this.$Message.warning("请选择班组");
  554. // }
  555. // },
  556. handleDispatchConfirm() {
  557. if (this.wood_select.length!=0||this.paint_select.length!=0||this.packing_select.length!=0||this.transit_select.length!=0||this.install_select.length!=0) {
  558. this.show_type = true;
  559. this.subArr =[...this.wood_select,...this.paint_select,...this.packing_select,...this.transit_select,...this.install_select];
  560. console.log(this.subArr);
  561. this.subUrl = "/api/order_produce_pull_all";
  562. try{this.subArr.forEach(v=>{
  563. if(!v.employee_id){
  564. this.show_type = false;
  565. throw new Error();
  566. }
  567. })} catch(e){
  568. this.$Message.warning('请设置班组');
  569. };
  570. this.showModal = this.show_type;
  571. } else {
  572. this.$Message.warning("请选择工序");
  573. }
  574. },
  575. handleDispatch(target, url) {
  576. if (!this.dispatchTime[0]) {
  577. this.$Message.warning("请选择时间");
  578. } else {
  579. this.dispatchInfo.start_time = new Date(this.dispatchTime[0])
  580. .toLocaleDateString()
  581. .replace(/\//g, "-");
  582. this.dispatchInfo.end_time = new Date(this.dispatchTime[1])
  583. .toLocaleDateString()
  584. .replace(/\//g, "-");
  585. target.forEach((element) => {
  586. element.start_time = this.dispatchInfo.start_time;
  587. element.end_time = this.dispatchInfo.end_time;
  588. element.work_type = this.dispatchInfo.work_type;
  589. element.user_salary = this.dispatchInfo.user_salary || "";
  590. // element.order_no = this.searchData.order_no;
  591. // element.url_number = this.searchData.url_number;
  592. // element.residential_name = this.searchData.residential_name;
  593. });
  594. console.log(target);
  595. this.axios({
  596. method: "post",
  597. url,
  598. data: {
  599. ...target,
  600. ...this.searchData
  601. },
  602. })
  603. .then((res) => {
  604. if (res.code == 200) {
  605. this.showModal = false;
  606. this.$Message.success(res.msg || "操作成功");
  607. this.initData();
  608. this.dispatchInfo = {};
  609. this.dispatchTime = [];
  610. }
  611. })
  612. .catch((err) => {});
  613. }
  614. },
  615. handleDispatchAllConfirm() {
  616. let flag = true;
  617. this.modalTableData.forEach((element) => {
  618. if (!element.employee_id || element.employee_id <= 0) {
  619. flag = false;
  620. }
  621. });
  622. if (flag) {
  623. (this.showModalAll = false), (this.showModal = true);
  624. this.subArr = JSON.parse(JSON.stringify(this.modalTableData));
  625. this.subUrl = "/api/all_order_produce_pull";
  626. } else {
  627. this.$Message.warning("请选择班组");
  628. }
  629. },
  630. handleDispatchAllOpen() {
  631. this.axios
  632. .get("/api/get_all_order_produce", {
  633. params: {
  634. basics_procedure_id:
  635. localStorage.getItem("dispatchTag") | this.currencyTag,
  636. },
  637. })
  638. .then((res) => {
  639. if (res.code == 200) {
  640. this.modalTableData = res.data;
  641. this.modalTableData.forEach((element) => {
  642. element.produce_id = element.id;
  643. });
  644. this.showModalAll = true;
  645. }
  646. });
  647. },
  648. changePage(e) {
  649. this.page_index = e;
  650. this.initData();
  651. },
  652. changeSize(e) {
  653. this.page_size = e;
  654. this.initData();
  655. },
  656. handleProcedureChange(val) {
  657. this.selected = [];
  658. this.currencyTag = val;
  659. localStorage.setItem("dispatchTag", val);
  660. this.axios.get('/api/order_produce_url_number',{params:{...this.searchData,type_id:this.currencyTag}}).then(res=>{
  661. this.searchData.url_number =[];
  662. this.urlNumberList = res.data;});
  663. this.initData();
  664. this.page_index = 1;
  665. this.page_size = 10;
  666. },
  667. handleSelectionChange(selection) {
  668. try{
  669. if(this.currencyTag == 1){
  670. this.wood_select = selection;
  671. this.wood_select.forEach((item,index)=>{
  672. if(this.wood_select[index].id!=this.tableData[index].id){
  673. this.$Message.error('请按流程选择工序!');
  674. throw new Error();
  675. }
  676. })
  677. }
  678. if(this.currencyTag == 2){
  679. this.paint_select =selection;
  680. this.paint_select.forEach((item,index)=>{
  681. if(this.paint_select[index].id!=this.tableData[index].id){
  682. this.$Message.error('请按流程选择工序!');
  683. throw new Error();
  684. }
  685. })
  686. }
  687. if(this.currencyTag == 3){
  688. this.packing_select =selection;
  689. this.packing_select.forEach((item,index)=>{
  690. if(this.packing_select[index].id!=this.tableData[index].id){
  691. this.$Message.error('请按流程选择工序!');
  692. throw new Error();
  693. }
  694. })
  695. }
  696. if(this.currencyTag == 4){
  697. this.transit_select = selection;
  698. this.transit_select.forEach((item,index)=>{
  699. if(this.transit_select[index].id!=this.tableData[index].id){
  700. this.$Message.error('请按流程选择工序!');
  701. throw new Error();
  702. }
  703. })
  704. }
  705. if(this.currencyTag == 5){
  706. this.install_select = selection;
  707. this.install_select.forEach((item,index)=>{
  708. if(this.install_select[index].id!=this.tableData[index].id){
  709. this.$Message.error('请按流程选择工序!');
  710. throw new Error();
  711. }
  712. })
  713. }
  714. }catch(e){
  715. }
  716. },
  717. handleGroupSelect(e, row, index, value) {
  718. // if (this.selected.length > 0) {
  719. // this.selected.forEach(element => {
  720. // if (element.id == row.id) {
  721. // element.employee_id = value
  722. // }
  723. // });
  724. // }
  725. row.employee_id = e;
  726. if(this.currencyTag == 1){
  727. this.tableData.forEach(item=>{
  728. this.wood_select.forEach(_item=>{
  729. if(item.id == _item.id){
  730. item._checked = true;
  731. _item.employee_id = item.employee_id;
  732. }
  733. })
  734. })
  735. }
  736. if(this.currencyTag == 2){
  737. this.tableData.forEach(item=>{
  738. this.paint_select.forEach(_item=>{
  739. if(item.id == _item.id){
  740. item._checked = true;
  741. _item.employee_id = item.employee_id;
  742. }
  743. })
  744. })
  745. }
  746. if(this.currencyTag == 3){
  747. this.tableData.forEach(item=>{
  748. this.packing_select.forEach(_item=>{
  749. if(item.id == _item.id){
  750. item._checked = true;
  751. _item.employee_id = item.employee_id;
  752. }
  753. })
  754. })
  755. }
  756. if(this.currencyTag == 4){
  757. this.tableData.forEach(item=>{
  758. this.transit_select.forEach(_item=>{
  759. if(item.id == _item.id){
  760. item._checked = true;
  761. _item.employee_id = item.employee_id;
  762. }
  763. })
  764. })
  765. }
  766. if(this.currencyTag == 5){
  767. this.tableData.forEach(item=>{
  768. this.install_select.forEach(_item=>{
  769. if(item.id == _item.id){
  770. item._checked = true;
  771. _item.employee_id = item.employee_id;
  772. }
  773. })
  774. })
  775. }
  776. },
  777. },
  778. // 监听属性 类似于data概念
  779. computed: {},
  780. // 监控data中的数据变化
  781. watch: {},
  782. beforeCreate() {}, // 生命周期 - 创建之前
  783. beforeMount() {}, // 生命周期 - 挂载之前
  784. beforeUpdate() {}, // 生命周期 - 更新之前
  785. updated() {}, // 生命周期 - 更新之后
  786. beforeDestroy() {}, // 生命周期 - 销毁之前
  787. destroyed() {}, // 生命周期 - 销毁完成
  788. activated() {}, // 如果页面有keep-alive缓存功能,这个函数会触发
  789. };
  790. </script>
  791. <style lang="scss" scoped>
  792. .pageSlotStyle {
  793. display: flex;
  794. justify-content: center;
  795. margin-top: 50px;
  796. }
  797. /deep/ .ivu-table-wrapper {
  798. overflow: visible;
  799. }
  800. .main{
  801. height:600px;
  802. }
  803. </style>