This commit is contained in:
helloDy
2023-11-15 17:46:54 +08:00
parent aef062b4c9
commit e5966c27a3
10 changed files with 750 additions and 43 deletions

View File

@@ -39,24 +39,25 @@
v-if="materialVisible"
ref="material"
@refreshDataList="closeDetail"></add-or-update>
<!-- 查看详情 -->
<!-- <detail
v-if="detailVisible"
ref="detail"
@refreshDataList="closeDetail"></detail> -->
<!-- 分配产量 -->
<allocation
v-if="allocationVisible"
ref="allocation"
@refreshDataList="getDataList" />
</div>
</template>
<script>
import AddOrUpdate from './add-or-updata';
import AddWorkOrder from './addWorkOrder'
// import Detail from './detail.vue';
import Allocation from './allocation.vue';
import basicPage from '../../core/mixins/basic-page';
import { parseTime } from '../../core/mixins/code-filter';
import {
getCoreWOPage,
deleteCoreWO,
statusChange
statusChange,
getConOrderList
} from '@/api/base/coreWorkOrder';
@@ -112,7 +113,8 @@ export default {
mixins: [basicPage],
components: {
AddWorkOrder,
AddOrUpdate
AddOrUpdate,
Allocation
},
data() {
return {
@@ -122,6 +124,7 @@ export default {
},
detailVisible: false,
materialVisible: false,
allocationVisible: false,
tableProps,
tableBtn: [
this.$auth.hasPermi(`base:core-work-order:update`)
@@ -359,18 +362,22 @@ export default {
}
console.log('22',val)
this.$confirm(`确定对${'[工单名称=' + val.data.name + ']'}进行${val.type}操作?`, "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
statusChange(param).then(({ data }) => {
this.$message({
message: '暂停成功!',
message: '操作成功!',
type: 'success',
duration: 1500,
onClose: () => {
this.getDataList();
// 分配产量
if (param.status === 4) {
this.allocationOrder(param);
}
},
});
});
@@ -378,6 +385,28 @@ export default {
.catch(() => { });
}
},
allocationOrder(val) {
// 获取订单列表
getConOrderList({
workOrderId: val.id,
}).then((response) => {
if (response.data.length > 0) {
this.$confirm('工单结束,可分配产量', "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
this.allocationVisible = true;
this.$nextTick(() => {
this.$refs.allocation.init(val.id, true);
});
})
.catch(() => { });
}
// this.listQuery.total = response.data.total;
});
},
buttonClick(val) {
switch (val.btnName) {
case 'search':