1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
| <template>
| <el-dialog
| width="60%"
| :visible.sync="innerVisible" append-to-body @close="$emit('update:currshowlist', false)" :show="currshowlist" >
| <div slot="title" class="dialog-title">
| <div>制造订单 <span style="color:red">({{sceneName}})</span></div>
| </div>
| <ttable
| :table="table"
| @handleSelectionChange="handleSelectionChange"
| :uploadInfo="uploadInfo"
| :prelang="prelang"
| :options="options"
| :ajaxFun="ajaxFun"
| ref="manufacturingOrderTable"
| :bottomOffset="255"
| >
| <template #toolbar></template>
| </ttable>
| <el-dialog
| width="40%"
| :visible.sync="orderVisible"
| append-to-body>
| <div slot="title" class="dialog-title">
| <div>设置优先级 <span style="color:red">(拖动<i class="icon-jiantou-tuodong darkClass"></i>)</span></div>
| </div>
| <sortable :orders="orders"></sortable>
| <div slot="footer" class="dialog-footer">
| <el-button @click="orderVisible=false">取 消</el-button>
| <el-button type="success" @click="saveSelectRow">排 产</el-button>
| </div>
| </el-dialog>
| <div slot="footer" class="dialog-footer">
| <el-button @click="innerVisible=false">取 消</el-button>
| <el-button type="primary" @click="setOrderPriority">优先级</el-button>
| </div>
| </el-dialog>
| </template>
| <style>
| .tb-edit .el-input {
| display: none
| }
| .tb-edit .current-row .el-input {
| display: block
| }
| .tb-edit .current-row .el-input+span {
| display: none
| }
| .scheduleTransfer .el-transfer-panel{
| width: 50%;
| }
| .darkClass{
| color: #606266;
| }
| </style>
| <script>
| import {fetchListManufacturingOrderForAps} from '@/api/plan/manufacturingorder';
| import sortable from './sortable.vue';
| import ttable from '@/views/common/ztt-table.vue'
|
| export default {
| components: {
| sortable,
| ttable
| },
| props: {
| currshowlist: {
| type: Boolean,
| default: false
| },
| //场景
| sceneName:{
| type: String
| }
| },
| data() {
| return {
| ajaxFun:fetchListManufacturingOrderForAps,
| states: [{value: "01planned", label: "已计划"}, {value: "02issued", label: "已下达"}, {
| value: "03completed", label: "已完成"}, {value: "04canceled", label: "已取消"}],
| orderVisible:false,
| innerVisible:false,
| currentRow: null,
| listLoading: true,
| tableKey: 0,
| dataList: [],
| pageIndex: 1,
| pageSize: 20,
| totalPage: 0,
| multipleSelection: [],
| orders:[],
| isShowQuery: false,
| uploadInfo: {//是否展示上传EXCEL以及对应的url
| isShow: false,
| url: ''
| },
| dateTimeFilters: {},
| prelang: "operation",
| options: {
| height: 300,//默认高度-为了表头固定
| stripe: true, // 是否为斑马纹 table
| highlightCurrentRow: false, // 是否要高亮当前行
| border: true,//是否有纵向边框
| lazy: false,//是否需要懒加载
| fit: true,//列的宽度是否自撑开
| multiSelect: true,//
| seqNo: true,
| isRefresh: true,//是否显示刷新按钮
| isShowHide: true,//是否显示显影按钮
| isSearch: false,//高级查询按钮
| defaultOrderBy:{column:'createTime',direction:'desc'}
| },
| table: {
| total: 0,
| currentPage: 1,
| pageSize: 20,
| data: [],
| // 标题
| column: [
| {minWidth:'100',prop:"factoryName",label:"工厂",sort: true,isTrue:true,isSearch:true,searchInfoType:'text',handleClick: this.searchForm},
| {minWidth:'120',prop: "moNo",label:"制造订单号",sort: true,isTrue:true,isSearch:true,searchInfoType:'text',handleClick: this.searchForm},
| {minWidth:'120',prop: "partNo",label:"零件号",sort: true,isTrue:true,isSearch:true,searchInfoType:'text',handleClick: this.searchForm},
| {minWidth:'120',prop: "partName",label:"零件",sort: true,isTrue:true,isSearch:true,searchInfoType:'text',handleClick: this.searchForm},
| {minWidth:'120',prop: "qtyRequired",label:"需求数量",sort: true,isTrue:true,isSearch:true,searchInfoType:'text',handleClick: this.searchForm},
| {minWidth:'120',prop: "quantityCompletion",label:"完成数量",sort: true,isTrue:true,isSearch:true,searchInfoType:'text',handleClick: this.searchForm},
| {minWidth:'140',width:'220',prop: "requiredDate",label:"需求日期",sort: true,isTrue:true,isSearch:true,searchInfoType:'datetimerange',handleClick: this.searchForm},
| {minWidth:'140',prop: "state",label:"状态",sort: true,isTrue:true,formatter:this.formatState,isSearch:true,searchInfoType:'select',optList:() => {return this.states},handleClick: this.searchForm},
| {minWidth:'200',prop: "remark",label:"备注",sort: true,isTrue:true,isSearch:true,searchInfoType:'text',handleClick: this.searchForm},
| {minWidth:'140',width:'220',prop: "createTime",label:"创建时间",sort: true,isTrue:true,isSearch:true,searchInfoType:'datetimerange',handleClick: this.searchForm},
| ],
| },
| }
| },
| methods: {
| setOrderPriority(){
| if(typeof(this.multipleSelection)!="undefined") {
| if(this.multipleSelection.length>0){
| this.orders=[];
| var order;
| for(var i=0;i<this.multipleSelection.length;i++){
| order={};
| order.id=this.multipleSelection[i].id;
| order.orderName=this.multipleSelection[i].moNo;
| order.factoryName=this.multipleSelection[i].factoryName;
| order.partName=this.multipleSelection[i].partName;
| this.orders.push(order);
| }
| this.orderVisible = true;
| }else{
| this.$message.warning('请选择制造订单!');
| }
|
| }
| },
| saveSelectRow(){
| this.$confirm('此操作将对<span style="color:#ff0000">'+this.sceneName+'</span>进行排产, 是否继续?', '提示', {
| confirmButtonText: '确定',
| cancelButtonText: '取消',
| closeOnClickModal:false,
| type: 'warning',
| dangerouslyUseHTMLString:true
| }).then(() => {
| this.$emit("listenToManufacturingOrderEvent", this.orders);
| this.orderVisible = false;
| this.innerVisible = false;
| }).catch(() => {
| this.$message({
| type: 'info',
| message: '已取消排产'
| });
| });
|
| },
| handleSelectionChange(val) {
| this.multipleSelection = val;
| },
| getData() {
| this.$refs.manufacturingOrderTable.getDataList();
| },
| // 表格字段格式化
| formatState(row, column, cellValue) {
| for (let i = 0, len = this.states.length; i < len; i++) {
| if (cellValue == this.states[i].value) {
| return this.states[i].label
| }
| }
| },
| },
| watch: {
| currshowlist() {
| this.innerVisible = this.currshowlist;
| if(this.currshowlist){
| this.getData();
| }
| }
| },
| }
| </script>
|
|