hdy
2023-12-25 f2a092218ece0821351440331c90064c8cbd5241
提交 | 用户 | 时间
4dbe17 1 <template>
2   <div class="app-container">
5d5153 3     <el-card class="box-card">
4dbe17 4     <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
5d5153 5       <el-form-item label-width="80" label="生产工单号" prop="workOrderNo">
4dbe17 6         <el-input
7           v-model="queryParams.workOrderNo"
8           placeholder="请输入生产工单号"
9           clearable
10           @keyup.enter.native="handleQuery"
11         />
12       </el-form-item>
13       <el-form-item label="产品名称" prop="productName">
14         <el-input
15           v-model="queryParams.productName"
16           placeholder="请输入产品名称"
5d5153 17           clearable
18           @keyup.enter.native="handleQuery"
19         />
20       </el-form-item>
21       <el-form-item label="工单状态" prop="orderStatus">
22         <el-select v-model="queryParams.orderStatus" placeholder="请选择工单状态" clearable>
23           <el-option
24             v-for="dict in dict.type.order_state"
25             :key="dict.value"
26             :label="dict.label"
27             :value="dict.value"
28           />
29         </el-select>
30       </el-form-item>
31       <el-form-item style="float: right">
32         <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
33         <el-button type="warning" icon="el-icon-copy-document" size="mini" @click="advancedQuery">高级查询</el-button>
34         <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
35       </el-form-item>
36     </el-form>
37     <el-form :model="queryParams" ref="queryParams" size="small" :inline="true" v-show="advancedShowSearch" label-width="68px">
38       <el-form-item style="margin-left: 14px" label="产品编号" prop="productCode">
39         <el-input
40           v-model="queryParams.productCode"
41           placeholder="请输入产品编号"
42           clearable
43           @keyup.enter.native="handleQuery"
44         />
45       </el-form-item>
46       <el-form-item label="订单编号" prop="salesOrderCode">
47         <el-input
48           v-model="queryParams.salesOrderCode"
49           placeholder="请输入订单编号"
4dbe17 50           clearable
51           @keyup.enter.native="handleQuery"
52         />
53       </el-form-item>
54       <el-form-item label="车间编号" prop="workshopCode">
55         <el-input
56           v-model="queryParams.workshopCode"
57           placeholder="请输入车间编号"
58           clearable
59           @keyup.enter.native="handleQuery"
60         />
61       </el-form-item>
62       <el-form-item label="产线编号" prop="lineCode">
63         <el-input
64           v-model="queryParams.lineCode"
65           placeholder="请输入产线编号"
66           clearable
67           @keyup.enter.native="handleQuery"
68         />
69       </el-form-item>
5d5153 70       <el-form-item style="margin-left: 7px" label-width="80" label="产品BOM" prop="bomCode">
71         <el-input
72           v-model="queryParams.bomCode"
73           placeholder="请输入产品BOM"
74           clearable
75           @keyup.enter.native="handleQuery"
76         />
77       </el-form-item>
4dbe17 78       <el-form-item label="工艺流程" prop="routeCode">
79         <el-input
80           v-model="queryParams.routeCode"
81           placeholder="请输入工艺流程"
82           clearable
83           @keyup.enter.native="handleQuery"
84         />
85       </el-form-item>
5d5153 86
4dbe17 87       <el-form-item label="工艺配方" prop="recipeCode">
88         <el-input
89           v-model="queryParams.recipeCode"
90           placeholder="请输入工艺配方"
91           clearable
92           @keyup.enter.native="handleQuery"
93         />
94       </el-form-item>
95     </el-form>
5d5153 96     </el-card>
4dbe17 97
5d5153 98     <el-card style="margin-top: 10px" class="box-card">
4dbe17 99     <el-row :gutter="10" class="mb8">
100       <el-col :span="1.5">
101         <el-button
102           type="primary"
103           plain
104           icon="el-icon-plus"
105           size="mini"
106           @click="handleAdd"
107           v-hasPermi="['om:productionOrde:add']"
108         >新增</el-button>
109       </el-col>
110       <el-col :span="1.5">
111         <el-button
112           type="success"
113           plain
114           icon="el-icon-edit"
115           size="mini"
116           :disabled="single"
117           @click="handleUpdate"
118           v-hasPermi="['om:productionOrde:edit']"
119         >修改</el-button>
120       </el-col>
121       <el-col :span="1.5">
122         <el-button
123           type="danger"
124           plain
125           icon="el-icon-delete"
126           size="mini"
127           :disabled="multiple"
128           @click="handleDelete"
129           v-hasPermi="['om:productionOrde:remove']"
130         >删除</el-button>
131       </el-col>
132       <el-col :span="1.5">
133         <el-button
134           type="warning"
135           plain
136           icon="el-icon-download"
137           size="mini"
138           @click="handleExport"
139           v-hasPermi="['om:productionOrde:export']"
140         >导出</el-button>
141       </el-col>
53b67e 142       <el-col :span="1.5">
143         <el-button
144           type="warning"
145           plain
875966 146           icon="el-icon-upload2"
53b67e 147           :disabled="move"
148           size="mini"
149           @click="moveUp"
150         >上移</el-button>
151       </el-col>
152       <el-col :span="1.5">
153         <el-button
154           type="warning"
155           plain
156           icon="el-icon-download"
157           size="mini"
158           :disabled="move"
159           @click="down"
160         >下移</el-button>
161       </el-col>
4dbe17 162       <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
163     </el-row>
164
03bb7a 165       <el-table border v-loading="loading" :data="productionOrdeList" @selection-change="handleSelectionChange">
5d5153 166         <el-table-column type="selection" width="55" align="center" />
b800e7 167         <el-table-column label="生产工单号" width="160" align="center">
168           <template slot-scope="scope">
169             <router-link :to="{path: '/main/workReport-data/index/', query: {workOrderNo: scope.row.workOrderNo} }" class="link-type">
170               <span>{{ scope.row.workOrderNo }}</span>
171             </router-link>
172           </template>
173         </el-table-column>
174         <el-table-column label="订单编号" width="140" align="center" prop="salesOrderCode">
175         </el-table-column>
176         <el-table-column label="产品编号" width="140" align="center" prop="productCode">
177         </el-table-column>
178         <el-table-column label="产品名称" width="160" align="center" prop="productName">
179         </el-table-column>
180         <el-table-column label="工单状态" align="center" prop="orderStatus">
181           <template slot-scope="scope">
182             <dict-tag :options="dict.type.order_state" :value="scope.row.orderStatus"/>
183           </template>
184         </el-table-column>
185         <el-table-column label="车间编号" align="center" prop="workshopCode">
186         </el-table-column>
187         <el-table-column label="产线编号" align="center" prop="lineCode">
188         </el-table-column>
189         <el-table-column label="工艺流程" width="140" align="center" prop="routeCode">
190         </el-table-column>
191         <el-table-column label="产品BOM" width="140" align="center" prop="bomCode">
192         </el-table-column>
193         <el-table-column label="工艺配方" width="140" align="center" prop="recipeCode">
194         </el-table-column>
195         <el-table-column label="计划数量" align="center" prop="planQty">
196         </el-table-column>
197         <el-table-column label="实际数量" align="center" prop="actualQty">
198         </el-table-column>
199         <el-table-column label="实际上线数量" width="100" align="center" prop="actualOnlineQty">
200         </el-table-column>
201         <el-table-column label="需求日期" align="center" prop="demandDate" width="180">
202         </el-table-column>
203         <el-table-column label="计划开始时间" width="160" align="center" prop="planStartTime">
204         </el-table-column>
205         <el-table-column label="计划结束时间" width="160" align="center" prop="planEndTime">
206         </el-table-column>
207         <el-table-column label="实际开始时间" width="160" align="center" prop="actualStartTime">
208         </el-table-column>
209         <el-table-column label="实际结束时间" width="160" align="center" prop="actualEndTime">
210         </el-table-column>
211         <el-table-column width="160" label="创建时间" align="center" prop="createTime">
212         </el-table-column>
213         <el-table-column width="160" label="更新时间" align="center" prop="updateTime">
214         </el-table-column>
215         <el-table-column label="创建人" width="80" align="center" prop="createUser">
216         </el-table-column>
217         <el-table-column label="修改人" width="80" align="center" prop="updateUser">
218         </el-table-column>
219         <el-table-column label="备注" width="100" align="center" prop="remarks">
220         </el-table-column>
221         <el-table-column label="流水号" align="center" prop="streamNumber">
222         </el-table-column>
223         <el-table-column label="客户" width="80" align="center" prop="custom">
224         </el-table-column>
53b67e 225         <el-table-column fixed="right" width="350" label="操作" align="center" class-name="small-padding fixed-width">
5d5153 226           <template slot-scope="scope">
227             <!--  工单状态(1创建、2已发布、3生产中、4已冻结、5已完工、6已关闭) -->
03bb7a 228             <el-button type="success" :disabled="scope.row.orderStatus !== '1'"  style="width: 72px" plain @click="handleCommand('3',scope.row.id)" size="mini">开始</el-button>
229             <el-button style="width: 72px" :disabled="scope.row.orderStatus !== '2' && scope.row.orderStatus !== '3'" v-if="scope.row.orderStatus !== '2'&&  scope.row.orderStatus !== '4'" plain @click="handleCommand('4',scope.row.id)" type="warning" size="mini">冻结</el-button>
230             <el-button style="width: 72px" :disabled="scope.row.orderStatus !== '4'" v-if="scope.row.orderStatus === '4'" plain @click="handleCommand('3',scope.row.id)" type="warning" size="mini">解冻</el-button>
231             <el-button style="width: 72px" :disabled="scope.row.orderStatus !== '1'" plain @click="handleCommand('6',scope.row.id)" v-if="scope.row.orderStatus === '1'||scope.row.orderStatus === '3'||scope.row.orderStatus === '4'||scope.row.orderStatus === '5'" type="danger" size="mini">关闭</el-button>
232             <el-button style="width: 72px" :disabled="scope.row.orderStatus !== '6'" plain @click="handleCommand('1',scope.row.id)" v-if="scope.row.orderStatus === '6' " type="success" size="mini">启用</el-button>
53b67e 233 <!--            <el-button-->
234 <!--              :disabled="scope.row.orderStatus !== '1'"-->
235 <!--              size="mini"-->
236 <!--              type="success"-->
237 <!--              style="width: 72px"-->
238 <!--              icon="el-icon-edit"-->
239 <!--              @click="handleUpdate(scope.row)"-->
240 <!--              v-hasPermi="['om:productionOrde:edit']"-->
241 <!--            >修改</el-button>-->
242 <!--            <el-button-->
243 <!--              :disabled="scope.row.orderStatus !== '1'"-->
244 <!--              size="mini"-->
245 <!--              type="warning"-->
246 <!--              style="width: 72px"-->
247 <!--              icon="el-icon-delete"-->
248 <!--              @click="handleDelete(scope.row)"-->
249 <!--              v-hasPermi="['om:productionOrde:remove']"-->
250 <!--            >删除</el-button>-->
03bb7a 251             <el-button style="width: 72px" :disabled="scope.row.orderStatus === '4'||scope.row.orderStatus === '6'" v-if="scope.row.orderStatus !== '5'" @click="handleCommand('5',scope.row.id)" type="success" size="mini">完成</el-button>
53b67e 252             <el-button style="width: 72px" :disabled="scope.row.orderStatus === '5'" v-if="scope.row.orderStatus === '5'" type="success" size="mini">已完工</el-button>            <el-button style="width: 72px" :disabled="scope.row.orderStatus !== '6'" plain @click="handleCommand('1',scope.row.id)" v-if="scope.row.orderStatus === '6' " type="success" size="mini">启用</el-button>
5d5153 253           </template>
254         </el-table-column>
255       </el-table>
256     </el-card>
257
4dbe17 258
259     <pagination
260       v-show="total>0"
261       :total="total"
262       :page.sync="queryParams.pageNum"
263       :limit.sync="queryParams.pageSize"
264       @pagination="getList"
265     />
266
267     <!-- 添加或修改生产工单对话框 -->
45a2ee 268     <el-dialog v-dialogpop-up :title="title" :visible.sync="open" width="1000px" append-to-body>
b800e7 269        <span slot="title">
270         <i class="el-icon-s-order"></i>
271         {{titleName}}
272       </span>
5d5153 273       <el-form ref="form" inline :model="form" :rules="rules" label-width="80px">
274         <el-form-item label="工单号" prop="workOrderNo">
4dbe17 275           <el-input v-model="form.workOrderNo" placeholder="请输入生产工单号" />
276         </el-form-item>
277         <el-form-item label="订单编号" prop="salesOrderCode">
278           <el-input v-model="form.salesOrderCode" placeholder="请输入订单编号" />
279         </el-form-item>
280         <el-form-item label="产品编号" prop="productCode">
5d5153 281           <el-input v-model="form.productCode" placeholder="请选择产品" >
282             <el-button slot="append" @click="handleSelectProduct" icon="el-icon-search"></el-button>
283           </el-input>
284           <ItemSelect ref="itemSelect" @onSelected="onItemSelected" > </ItemSelect>
4dbe17 285         </el-form-item>
286         <el-form-item label="产品名称" prop="productName">
5d5153 287           <el-input v-model="form.productName" disabled placeholder="请输入产品名称" />
4dbe17 288         </el-form-item>
289         <el-form-item label="车间编号" prop="workshopCode">
03bb7a 290           <el-select style="width: 93%" @change="handleSelectChange(form.processesCode)" v-model="form.workshopCode" placeholder="请选择车间编号">
b800e7 291             <el-option
292               v-for="item in options"
293               :key="item.workshopCode"
294               :label="item.workshopName"
295               :value="item.workshopCode">
296             </el-option>
297           </el-select>
4dbe17 298         </el-form-item>
b800e7 299         <el-form-item style="margin-left: -15px" label="产线编号" prop="lineCode">
300           <el-select style="width: 93%" v-model="form.lineCode" placeholder="请选择产线编号">
301             <el-option
302               v-for="item in lineOptions"
303               :key="item.lineCode"
304               :label="item.lineName"
305               :value="item.lineCode">
306             </el-option>
307           </el-select>
4dbe17 308         </el-form-item>
b800e7 309         <el-form-item label="工艺流程" prop="routeCode">
310           <el-input v-model="form.routeCode" disabled placeholder="请输入工艺流程" />
4dbe17 311         </el-form-item>
b800e7 312         <el-form-item label="产品BOM" prop="bomCode">
313           <el-input v-model="form.bomCode" disabled placeholder="请输入产品BOM" />
4dbe17 314         </el-form-item>
315         <el-form-item label="工艺配方" prop="recipeCode">
316           <el-input v-model="form.recipeCode" placeholder="请输入工艺配方" />
317         </el-form-item>
318         <el-form-item label="计划数量" prop="planQty">
319           <el-input v-model="form.planQty" placeholder="请输入计划数量" />
320         </el-form-item>
b800e7 321 <!--        <el-form-item label="实际数量" prop="actualQty">-->
322 <!--          <el-input v-model="form.actualQty" placeholder="请输入实际数量" />-->
323 <!--        </el-form-item>-->
4dbe17 324         <el-form-item label="需求日期" prop="demandDate">
b800e7 325           <el-date-picker style="width: 88%" clearable
4dbe17 326             v-model="form.demandDate"
327             type="date"
328             value-format="yyyy-MM-dd"
329             placeholder="请选择需求日期">
330           </el-date-picker>
331         </el-form-item>
b800e7 332 <!--        <el-form-item style="margin-left: -30px" label="流水号" prop="streamNumber">-->
333 <!--          <el-input v-model="form.streamNumber" placeholder="请输入流水号" />-->
334 <!--        </el-form-item>-->
335         <el-form-item style="margin-left: -30px" label="备注" prop="remarks">
4dbe17 336           <el-input v-model="form.remarks" placeholder="请输入备注" />
337         </el-form-item>
b800e7 338
339 <!--        <el-form-item label="客户" prop="custom">-->
340 <!--          <el-input v-model="form.custom" placeholder="请输入客户" />-->
341 <!--        </el-form-item>-->
342         <el-row>
343           <el-col :span="12">
344             <el-form-item style="margin-left: 10px" label-width="120" label="计划开始时间" prop="planStartTime">
345               <el-date-picker clearable
346                               v-model="form.planStartTime"
347                               type="date"
348                               value-format="yyyy-MM-dd"
349                               placeholder="请选择计划开始时间">
350               </el-date-picker>
351             </el-form-item>
352           </el-col>
353           <el-col :span="12">
354             <el-form-item style="margin-left: 76px" label-width="120" label="计划结束时间" prop="planEndTime">
355               <el-date-picker clearable
356                               v-model="form.planEndTime"
357                               type="date"
358                               value-format="yyyy-MM-dd"
359                               placeholder="请选择计划结束时间">
360               </el-date-picker>
361             </el-form-item>
362           </el-col>
363
364         </el-row>
4dbe17 365       </el-form>
366       <div slot="footer" class="dialog-footer">
367         <el-button type="primary" @click="submitForm">确 定</el-button>
368         <el-button @click="cancel">取 消</el-button>
369       </div>
370     </el-dialog>
5d5153 371
4dbe17 372   </div>
373 </template>
374
375 <script>
b800e7 376 import { listLineInfo } from "@/api/main/bs/lineInfo/lineInfo";
377 import { listWorkshop } from "@/api/main/bs/workshop/workshop";
5d5153 378 import { listProductBom } from "@/api/main/bs/ProductBom/ProductBom";
379 import { listTechnologyRoute} from "@/api/main/bs/technologyRoute/technologyRoute";
380 import ItemSelect  from "@/components/itemSelect/single.vue";
875966 381 import { upDownMove, listProductionOrde, getProductionOrde, delProductionOrde, addProductionOrde, updateProductionOrde } from "@/api/main/om/productionOrde/productionOrde";
4dbe17 382
383 export default {
384   name: "ProductionOrde",
3b1976 385   dicts: ['order_state'],
5d5153 386   components: {
387     ItemSelect ,
388   },
4dbe17 389   data() {
390     return {
b800e7 391       titleName: '',
392       options: [],
393       lineOptions: [],
5d5153 394       showFlag:false,
395       advancedShowSearch: false,
7ccca2 396       workOrder: {
397         status: 'ss'
398       },
4dbe17 399       // 遮罩层
400       loading: true,
401       // 选中数组
402       ids: [],
403       // 非单个禁用
404       single: true,
405       // 非多个禁用
406       multiple: true,
53b67e 407       move: true,
408       selectedRowIndex: -1, // 存储选中行的索引
4dbe17 409       // 显示搜索条件
410       showSearch: true,
411       // 总条数
412       total: 0,
413       // 生产工单表格数据
414       productionOrdeList: [],
415       // 弹出层标题
416       title: "",
417       // 是否显示弹出层
418       open: false,
419       // 查询参数
420       queryParams: {
421         pageNum: 1,
422         pageSize: 10,
423         workOrderNo: null,
424         salesOrderCode: null,
425         productCode: null,
426         productName: null,
427         workshopCode: null,
428         lineCode: null,
429         routeCode: null,
430         bomCode: null,
431         recipeCode: null,
432         orderStatus: null,
433         custom: null,
434         marketAreaCode: null,
435         softwareVersionCode: null,
436         productCompanyCode: null,
875966 437         frontEndId: 0,
438         idNums: null,
439         flag: null,
440
4dbe17 441       },
442       // 表单参数
443       form: {},
7ccca2 444       updateStatusParameter: {
445         id: null,
446         orderStatus: null
447       },
4dbe17 448       // 表单校验
449       rules: {
450         id: [
451           { required: true, message: "ID不能为空", trigger: "blur" }
452         ],
453       }
454     };
455   },
456   created() {
457     this.getList();
b800e7 458     this.initWorkshop();
4dbe17 459   },
460   methods: {
875966 461     moveUp(row){
462       const ids = row.id || this.ids
463       let str = JSON.stringify(ids);
464       let num = BigInt(str.replace(/[\[\]]/g, ''));
465       this.queryParams.frontEndId = num
466       this.queryParams.idNums = ids
467       this.queryParams.flag = 'up'
468       upDownMove(this.queryParams).then(response => {
345956 469         this.$modal.msgSuccess("移动成功");
875966 470         this.getList();
471       });
53b67e 472     },
875966 473     down(row){
474       const ids = row.id || this.ids
475       let str = JSON.stringify(ids);
476       let num = BigInt(str.replace(/[\[\]]/g, ''));
477       this.queryParams.frontEndId = num
478       this.queryParams.idNums = ids
479       this.queryParams.flag = 'down'
480       upDownMove(this.queryParams).then(response => {
345956 481         this.$modal.msgSuccess("移动成功");
875966 482         this.getList();
483       });
53b67e 484     },
b800e7 485     initWorkshop(){
486       listWorkshop(this.queryParams).then(response => {
487         this.options = response.rows;
488       });
489     },
490     // 在这里编写处理选中事件的逻辑
491     handleSelectChange(selectedOption) {
492       this.queryParams.workshopCode = selectedOption;
493       listLineInfo(this.queryParams).then(response => {
494         this.lineOptions = response.rows;
495       });
496     },
5d5153 497     //物料选择弹出框
498     onItemSelected(obj){
499       if(obj !== undefined && obj !== null){
500         let productCode = obj.materialCode;
501         this.form.productCode = productCode;
502         this.form.productName = obj.materialName;
503         this.queryParams.productCode = productCode
504         listTechnologyRoute(this.queryParams).then(response => {
b800e7 505           this.form.routeCode = response.rows[0].routeCode;
5d5153 506         });
507         listProductBom(this.queryParams).then(response => {
b800e7 508           this.form.bomCode = response.rows[0].bomCode;
5d5153 509         });
510       }
511     },
512     handleSelectProduct(){
513       this.$refs.itemSelect.showFlag = true;
514     },
515     advancedQuery(){
516       this.advancedShowSearch = (this.advancedShowSearch) ? this.advancedShowSearch = false : this.advancedShowSearch = true;
517     },
7ccca2 518     handleCommand(status,id) {
03bb7a 519       console.log(status)
7ccca2 520       this.updateStatusParameter.id = id;
521       this.updateStatusParameter.orderStatus = status;
522       updateProductionOrde(this.updateStatusParameter).then(response => {
523         this.$modal.msgSuccess("修改成功");
524         this.open = false;
525         this.getList();
526       });
527     },
4dbe17 528     /** 查询生产工单列表 */
529     getList() {
530       this.loading = true;
531       listProductionOrde(this.queryParams).then(response => {
532         this.productionOrdeList = response.rows;
533         this.total = response.total;
534         this.loading = false;
535       });
536     },
537     // 取消按钮
538     cancel() {
539       this.open = false;
540       this.reset();
541     },
542     // 表单重置
543     reset() {
544       this.form = {
545         id: null,
546         workOrderNo: null,
547         salesOrderCode: null,
548         productCode: null,
549         productName: null,
550         workshopCode: null,
551         lineCode: null,
552         routeCode: null,
553         bomCode: null,
554         recipeCode: null,
555         planQty: null,
556         actualQty: null,
557         badQty: null,
558         scrapQty: null,
559         repairQty: null,
560         actualOnlineQty: null,
561         onlineCompletionMark: null,
562         demandDate: null,
563         planStartTime: null,
564         planEndTime: null,
565         actualStartTime: null,
566         actualEndTime: null,
567         serialNumber: null,
568         orderStatus: null,
569         createTime: null,
570         updateTime: null,
571         createUser: null,
572         updateUser: null,
573         remarks: null,
574         streamNumber: null,
575         custom: null,
576         marketAreaCode: null,
577         softwareVersionCode: null,
578         productCompanyCode: null,
579         spareField1: null,
580         spareField2: null,
581         spareField3: null,
582         spareField4: null
583       };
584       this.resetForm("form");
585     },
586     /** 搜索按钮操作 */
587     handleQuery() {
588       this.queryParams.pageNum = 1;
589       this.getList();
590     },
591     /** 重置按钮操作 */
592     resetQuery() {
593       this.resetForm("queryForm");
594       this.handleQuery();
595     },
596     // 多选框选中数据
597     handleSelectionChange(selection) {
345956 598       // this.ids = selection.map(item => item.id)
599       // const statusSize = selection.map(item => item.orderStatus)
600       // const intArr = statusSize.map(str => parseInt(str));
601       // const sum = intArr.reduce((a, b) => a + b, 0);
602       // this.single = selection.length!==1
603       // this.multiple = !selection.length
604       // if(selection[0].orderStatus!== '1'||sum!==selection.length){
605       //   this.single = true
606       //   this.multiple = true
607       // }
608       // if(selection.length > 1){
609       //   this.move = true
610       // }else {
611       //   this.move = false
612       // }
613
4dbe17 614       this.ids = selection.map(item => item.id)
345956 615       // this.single = selection.length!==1
616       // this.multiple = !selection.length
617       this.move = selection.length!==1
618       if(!selection.length){
53b67e 619         this.single = true
620         this.multiple = true
c8a732 621       }else {
622         if(selection[0].orderStatus === '1' && selection.length === 1){
623           this.single = false
624           this.multiple = false
625         }
53b67e 626       }
c8a732 627
4dbe17 628     },
629     /** 新增按钮操作 */
630     handleAdd() {
631       this.reset();
632       this.open = true;
b800e7 633       this.titleName = "添加生产工单";
4dbe17 634     },
635     /** 修改按钮操作 */
636     handleUpdate(row) {
637       this.reset();
638       const id = row.id || this.ids
639       getProductionOrde(id).then(response => {
03bb7a 640         console.log(response.data)
4dbe17 641         this.form = response.data;
642         this.open = true;
b800e7 643         this.titleName = "修改生产工单";
4dbe17 644       });
645     },
646     /** 提交按钮 */
647     submitForm() {
648       this.$refs["form"].validate(valid => {
649         if (valid) {
650           if (this.form.id != null) {
651             updateProductionOrde(this.form).then(response => {
652               this.$modal.msgSuccess("修改成功");
653               this.open = false;
654               this.getList();
655             });
656           } else {
657             addProductionOrde(this.form).then(response => {
658               this.$modal.msgSuccess("新增成功");
659               this.open = false;
660               this.getList();
661             });
662           }
663         }
664       });
665     },
666     /** 删除按钮操作 */
667     handleDelete(row) {
668       const ids = row.id || this.ids;
669       this.$modal.confirm('是否确认删除生产工单编号为"' + ids + '"的数据项?').then(function() {
670         return delProductionOrde(ids);
671       }).then(() => {
672         this.getList();
673         this.$modal.msgSuccess("删除成功");
674       }).catch(() => {});
675     },
676     /** 导出按钮操作 */
677     handleExport() {
678       this.download('om/productionOrde/export', {
679         ...this.queryParams
680       }, `productionOrde_${new Date().getTime()}.xlsx`)
681     }
682   }
683 };
684 </script>
74df87 685 <style lang="scss" scoped>
686 //::v-deep .el-dialog__header{
687 //  /*background-color: #f8f8f8;*/
688 //  background-color: #f8f8f9;
689 //}
b800e7 690 </style>