|
|
|
@ -72,7 +72,8 @@
|
|
|
|
|
size="mini"
|
|
|
|
|
@click="handleAdd"
|
|
|
|
|
v-hasPermi="['base:orderInfo:add']"
|
|
|
|
|
>新增</el-button>
|
|
|
|
|
>新增
|
|
|
|
|
</el-button>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="1.5">
|
|
|
|
|
<el-button
|
|
|
|
@ -83,7 +84,8 @@
|
|
|
|
|
:disabled="single"
|
|
|
|
|
@click="handleUpdate"
|
|
|
|
|
v-hasPermi="['base:orderInfo:edit']"
|
|
|
|
|
>修改</el-button>
|
|
|
|
|
>修改
|
|
|
|
|
</el-button>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="1.5">
|
|
|
|
|
<el-button
|
|
|
|
@ -94,7 +96,8 @@
|
|
|
|
|
:disabled="multiple"
|
|
|
|
|
@click="handleDelete"
|
|
|
|
|
v-hasPermi="['base:orderInfo:remove']"
|
|
|
|
|
>删除</el-button>
|
|
|
|
|
>删除
|
|
|
|
|
</el-button>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="1.5">
|
|
|
|
|
<el-button
|
|
|
|
@ -104,7 +107,18 @@
|
|
|
|
|
size="mini"
|
|
|
|
|
@click="handleExport"
|
|
|
|
|
v-hasPermi="['base:orderInfo:export']"
|
|
|
|
|
>导出</el-button>
|
|
|
|
|
>导出
|
|
|
|
|
</el-button>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="1.5">
|
|
|
|
|
<el-button
|
|
|
|
|
type="primary"
|
|
|
|
|
plain
|
|
|
|
|
icon="el-icon-plus"
|
|
|
|
|
size="mini"
|
|
|
|
|
@click="sapForm"
|
|
|
|
|
>同步SAP周计划
|
|
|
|
|
</el-button>
|
|
|
|
|
</el-col>
|
|
|
|
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList" :columns="columns"></right-toolbar>
|
|
|
|
|
</el-row>
|
|
|
|
@ -123,7 +137,9 @@
|
|
|
|
|
<dict-tag :options="dict.type.order_type" :value="scope.row.orderType"/>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="工单状态" align="center" prop="orderStatus" v-if="columns[10].visible" :show-overflow-tooltip="true">
|
|
|
|
|
<el-table-column label="工单状态" align="center" prop="orderStatus" v-if="columns[10].visible"
|
|
|
|
|
:show-overflow-tooltip="true"
|
|
|
|
|
>
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<dict-tag :options="dict.type.order_status" :value="scope.row.orderStatus"/>
|
|
|
|
|
</template>
|
|
|
|
@ -177,14 +193,16 @@
|
|
|
|
|
type="text"
|
|
|
|
|
icon="el-icon-bottom"
|
|
|
|
|
@click="handleReleasePlan(scope.row)"
|
|
|
|
|
>下达计划</el-button>
|
|
|
|
|
>下达计划
|
|
|
|
|
</el-button>
|
|
|
|
|
<el-button
|
|
|
|
|
size="mini"
|
|
|
|
|
type="text"
|
|
|
|
|
icon="el-icon-edit"
|
|
|
|
|
@click="handleUpdate(scope.row)"
|
|
|
|
|
v-hasPermi="['base:orderInfo:edit']"
|
|
|
|
|
>修改工单</el-button>
|
|
|
|
|
>修改工单
|
|
|
|
|
</el-button>
|
|
|
|
|
<!-- <el-button-->
|
|
|
|
|
<!-- size="mini"-->
|
|
|
|
|
<!-- type="text"-->
|
|
|
|
@ -249,7 +267,8 @@
|
|
|
|
|
v-model="form.beginDate"
|
|
|
|
|
type="date"
|
|
|
|
|
value-format="yyyy-MM-dd"
|
|
|
|
|
placeholder="请选择计划开始日期">
|
|
|
|
|
placeholder="请选择计划开始日期"
|
|
|
|
|
>
|
|
|
|
|
</el-date-picker>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="计划结束日期" prop="endDate">
|
|
|
|
@ -257,7 +276,8 @@
|
|
|
|
|
v-model="form.endDate"
|
|
|
|
|
type="date"
|
|
|
|
|
value-format="yyyy-MM-dd"
|
|
|
|
|
placeholder="请选择计划结束日期">
|
|
|
|
|
placeholder="请选择计划结束日期"
|
|
|
|
|
>
|
|
|
|
|
</el-date-picker>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="工厂编码" prop="factoryCode">
|
|
|
|
@ -268,7 +288,8 @@
|
|
|
|
|
v-model="form.completeDate"
|
|
|
|
|
type="date"
|
|
|
|
|
value-format="yyyy-MM-dd"
|
|
|
|
|
placeholder="请选择完成日期">
|
|
|
|
|
placeholder="请选择完成日期"
|
|
|
|
|
>
|
|
|
|
|
</el-date-picker>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-form>
|
|
|
|
@ -290,9 +311,10 @@ import {
|
|
|
|
|
releaseOrderPlan
|
|
|
|
|
} from '@/api/base/orderInfo'
|
|
|
|
|
import { findProductLineList } from '@//api/base/productLine'
|
|
|
|
|
import { addSAPCalendar } from '@//api/production/calendarInfo'
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
|
name: "OrderInfo",
|
|
|
|
|
name: 'OrderInfo',
|
|
|
|
|
dicts: ['order_status', 'order_type', 'is_flag', 'is_release'],
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
@ -311,7 +333,7 @@ export default {
|
|
|
|
|
// 工单信息表格数据
|
|
|
|
|
orderInfoList: [],
|
|
|
|
|
// 弹出层标题
|
|
|
|
|
title: "",
|
|
|
|
|
title: '',
|
|
|
|
|
// 是否显示弹出层
|
|
|
|
|
open: false,
|
|
|
|
|
// 查询参数
|
|
|
|
@ -342,8 +364,7 @@ export default {
|
|
|
|
|
// 表单参数
|
|
|
|
|
form: {},
|
|
|
|
|
// 表单校验
|
|
|
|
|
rules: {
|
|
|
|
|
},
|
|
|
|
|
rules: {},
|
|
|
|
|
columns: [
|
|
|
|
|
{ key: 0, label: `主键标识`, visible: false },
|
|
|
|
|
{ key: 1, label: `SAP计划编号`, visible: true },
|
|
|
|
@ -366,32 +387,32 @@ export default {
|
|
|
|
|
{ key: 18, label: `更新时间`, visible: false },
|
|
|
|
|
{ key: 19, label: `完成日期`, visible: true },
|
|
|
|
|
{ key: 20, label: `是否已下达生产计划`, visible: true },
|
|
|
|
|
{ key: 21, label: `工作中心编号`, visible: true },
|
|
|
|
|
{ key: 21, label: `工作中心编号`, visible: true }
|
|
|
|
|
],
|
|
|
|
|
// 产线选项
|
|
|
|
|
productLineList: [],
|
|
|
|
|
};
|
|
|
|
|
productLineList: []
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
created() {
|
|
|
|
|
this.getList();
|
|
|
|
|
this.getList()
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
/** 查询工单信息列表 */
|
|
|
|
|
getList() {
|
|
|
|
|
this.loading = true;
|
|
|
|
|
this.loading = true
|
|
|
|
|
listOrderInfo(this.queryParams).then(response => {
|
|
|
|
|
this.orderInfoList = response.rows;
|
|
|
|
|
this.total = response.total;
|
|
|
|
|
this.loading = false;
|
|
|
|
|
});
|
|
|
|
|
this.orderInfoList = response.rows
|
|
|
|
|
this.total = response.total
|
|
|
|
|
this.loading = false
|
|
|
|
|
})
|
|
|
|
|
findProductLineList({ productLineType: 1 }).then(response => {
|
|
|
|
|
this.productLineList = response.data;
|
|
|
|
|
});
|
|
|
|
|
this.productLineList = response.data
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
// 取消按钮
|
|
|
|
|
cancel() {
|
|
|
|
|
this.open = false;
|
|
|
|
|
this.reset();
|
|
|
|
|
this.open = false
|
|
|
|
|
this.reset()
|
|
|
|
|
},
|
|
|
|
|
// 表单重置
|
|
|
|
|
reset() {
|
|
|
|
@ -417,18 +438,18 @@ export default {
|
|
|
|
|
updatedBy: null,
|
|
|
|
|
updatedTime: null,
|
|
|
|
|
completeDate: null
|
|
|
|
|
};
|
|
|
|
|
this.resetForm("form");
|
|
|
|
|
}
|
|
|
|
|
this.resetForm('form')
|
|
|
|
|
},
|
|
|
|
|
/** 搜索按钮操作 */
|
|
|
|
|
handleQuery() {
|
|
|
|
|
this.queryParams.pageNum = 1;
|
|
|
|
|
this.getList();
|
|
|
|
|
this.queryParams.pageNum = 1
|
|
|
|
|
this.getList()
|
|
|
|
|
},
|
|
|
|
|
/** 重置按钮操作 */
|
|
|
|
|
resetQuery() {
|
|
|
|
|
this.resetForm("queryForm");
|
|
|
|
|
this.handleQuery();
|
|
|
|
|
this.resetForm('queryForm')
|
|
|
|
|
this.handleQuery()
|
|
|
|
|
},
|
|
|
|
|
// 多选框选中数据
|
|
|
|
|
handleSelectionChange(selection) {
|
|
|
|
@ -438,65 +459,79 @@ export default {
|
|
|
|
|
},
|
|
|
|
|
/** 新增按钮操作 */
|
|
|
|
|
handleAdd() {
|
|
|
|
|
this.reset();
|
|
|
|
|
this.open = true;
|
|
|
|
|
this.title = "添加工单信息";
|
|
|
|
|
this.reset()
|
|
|
|
|
this.open = true
|
|
|
|
|
this.title = '添加工单信息'
|
|
|
|
|
},
|
|
|
|
|
/** 修改按钮操作 */
|
|
|
|
|
handleUpdate(row) {
|
|
|
|
|
this.reset();
|
|
|
|
|
this.reset()
|
|
|
|
|
const objId = row.objId || this.ids
|
|
|
|
|
getOrderInfo(objId).then(response => {
|
|
|
|
|
this.form = response.data;
|
|
|
|
|
this.open = true;
|
|
|
|
|
this.title = "修改工单信息";
|
|
|
|
|
});
|
|
|
|
|
this.form = response.data
|
|
|
|
|
this.open = true
|
|
|
|
|
this.title = '修改工单信息'
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
/** 下达计划 */
|
|
|
|
|
handleReleasePlan(row) {
|
|
|
|
|
if (row.isRelease === 0) {
|
|
|
|
|
this.$modal.msgWarning("该工单已下达计划!");
|
|
|
|
|
return;
|
|
|
|
|
this.$modal.msgWarning('该工单已下达计划!')
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
this.$modal.confirm('是否下达SAP计划编号为:"' + row.orderCode + '"的计划?').then(function() {
|
|
|
|
|
return releaseOrderPlan(row);
|
|
|
|
|
return releaseOrderPlan(row)
|
|
|
|
|
}).then(() => {
|
|
|
|
|
this.getList();
|
|
|
|
|
this.$modal.msgSuccess("下达工单计划成功");
|
|
|
|
|
this.getList()
|
|
|
|
|
this.$modal.msgSuccess('下达工单计划成功')
|
|
|
|
|
}).catch((e) => {
|
|
|
|
|
console.log("下达计划错误信息:",e);
|
|
|
|
|
});
|
|
|
|
|
console.log('下达计划错误信息:', e)
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
sapForm() {
|
|
|
|
|
let planStartDate = null
|
|
|
|
|
let planEndDate = null
|
|
|
|
|
let currentDate = new Date()
|
|
|
|
|
currentDate.setMonth(currentDate.getMonth() - 1)
|
|
|
|
|
planStartDate = currentDate.toISOString().slice(0, 10)
|
|
|
|
|
currentDate.setMonth(currentDate.getMonth() + 2)
|
|
|
|
|
planEndDate = currentDate.toISOString().slice(0, 10)
|
|
|
|
|
addSAPCalendar({ planStartDate: planStartDate, planEndDate: planEndDate }).then(response => {
|
|
|
|
|
this.$modal.msgSuccess('同步成功')
|
|
|
|
|
this.sapOpen = false
|
|
|
|
|
this.getList()
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
/** 提交按钮 */
|
|
|
|
|
submitForm() {
|
|
|
|
|
this.$refs["form"].validate(valid => {
|
|
|
|
|
this.$refs['form'].validate(valid => {
|
|
|
|
|
if (valid) {
|
|
|
|
|
if (this.form.objId != null) {
|
|
|
|
|
updateOrderInfo(this.form).then(response => {
|
|
|
|
|
this.$modal.msgSuccess("修改成功");
|
|
|
|
|
this.open = false;
|
|
|
|
|
this.getList();
|
|
|
|
|
});
|
|
|
|
|
this.$modal.msgSuccess('修改成功')
|
|
|
|
|
this.open = false
|
|
|
|
|
this.getList()
|
|
|
|
|
})
|
|
|
|
|
} else {
|
|
|
|
|
addOrderInfo(this.form).then(response => {
|
|
|
|
|
this.$modal.msgSuccess("新增成功");
|
|
|
|
|
this.open = false;
|
|
|
|
|
this.getList();
|
|
|
|
|
});
|
|
|
|
|
this.$modal.msgSuccess('新增成功')
|
|
|
|
|
this.open = false
|
|
|
|
|
this.getList()
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
/** 删除按钮操作 */
|
|
|
|
|
handleDelete(row) {
|
|
|
|
|
const objIds = row.objId || this.ids;
|
|
|
|
|
const objIds = row.objId || this.ids
|
|
|
|
|
this.$modal.confirm('是否确认删除工单信息编号为"' + objIds + '"的数据项?').then(function() {
|
|
|
|
|
return delOrderInfo(objIds);
|
|
|
|
|
return delOrderInfo(objIds)
|
|
|
|
|
}).then(() => {
|
|
|
|
|
this.getList();
|
|
|
|
|
this.$modal.msgSuccess("删除成功");
|
|
|
|
|
}).catch(() => {});
|
|
|
|
|
this.getList()
|
|
|
|
|
this.$modal.msgSuccess('删除成功')
|
|
|
|
|
}).catch(() => {
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
/** 导出按钮操作 */
|
|
|
|
|
handleExport() {
|
|
|
|
@ -505,5 +540,5 @@ export default {
|
|
|
|
|
}, `orderInfo_${new Date().getTime()}.xlsx`)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|