|
|
@@ -74,31 +74,97 @@
|
|
|
</el-card>
|
|
|
|
|
|
<el-dialog :visible.sync="visible" title="派单" width="500px">
|
|
|
- <el-form ref="form" :model="form" :rules="rules" label-position="left" label-width="100px" >
|
|
|
- <el-form-item label="指定:" prop="singleType">
|
|
|
- <el-radio-group
|
|
|
- v-model="singleType"
|
|
|
- size="mini"
|
|
|
- >
|
|
|
+ <el-form
|
|
|
+ ref="form"
|
|
|
+ :model="form"
|
|
|
+ :rules="rules"
|
|
|
+ label-position="left"
|
|
|
+ label-width="100px"
|
|
|
+ >
|
|
|
+
|
|
|
+
|
|
|
+ <el-form-item label="报工类型:" prop="singleReport">
|
|
|
+ <el-radio-group v-model="form.singleReport">
|
|
|
+ <el-radio :label="1">单件报工</el-radio>
|
|
|
+ <el-radio :label="0">批量报工</el-radio>
|
|
|
+ </el-radio-group>
|
|
|
+ </el-form-item>
|
|
|
+
|
|
|
+ <el-form-item label="指定:" prop="assignType">
|
|
|
+ <el-radio-group v-model="form.assignType" size="mini">
|
|
|
<el-radio-button :label="1">工位</el-radio-button>
|
|
|
<el-radio-button :label="2">人员</el-radio-button>
|
|
|
</el-radio-group>
|
|
|
</el-form-item>
|
|
|
|
|
|
- <el-form-item label="报工类型:" prop="singleReport">
|
|
|
- <el-radio-group v-model="form.singleReport">
|
|
|
- <el-radio :label="1">单件报工</el-radio>
|
|
|
- <el-radio :label="0">批量报工</el-radio>
|
|
|
- </el-radio-group>
|
|
|
- </el-form-item>
|
|
|
+ <el-form-item
|
|
|
+ label="工位:"
|
|
|
+ prop="workstationIds"
|
|
|
+ v-if="form.assignType == 1"
|
|
|
+ >
|
|
|
+ <el-select
|
|
|
+ class="ele-block"
|
|
|
+ v-model="form.workstationIds"
|
|
|
+ placeholder="请选择工位"
|
|
|
+ size="mini"
|
|
|
+ multiple
|
|
|
+ filterable
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in stationList"
|
|
|
+ :key="item.id"
|
|
|
+ :label="item.name + '(' + item.code + ')'"
|
|
|
+ :value="item.id"
|
|
|
+ >
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+
|
|
|
+ <el-form-item label="班组:" prop="teamId" v-if="form.assignType == 2">
|
|
|
+ <el-select
|
|
|
+ class="ele-block"
|
|
|
+ v-model="form.teamId"
|
|
|
+ placeholder="请选择班组"
|
|
|
+ size="mini"
|
|
|
+ filterable
|
|
|
+
|
|
|
+ @change="stationChange"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in teamsList"
|
|
|
+ :key="item.id"
|
|
|
+ :label="item.name + '(' + item.code + ')'"
|
|
|
+ :value="item.id"
|
|
|
+ >
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+
|
|
|
+ <el-form-item label="人员:" prop="crewIds" v-if="form.assignType == 2">
|
|
|
+ <el-select
|
|
|
+ class="ele-block"
|
|
|
+ v-model="form.crewIds"
|
|
|
+ placeholder="请选择班组"
|
|
|
+ size="mini"
|
|
|
+ filterable
|
|
|
+ multiple
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in crewList"
|
|
|
+ :key="item.id"
|
|
|
+ :label="item.name"
|
|
|
+ :value="item.id"
|
|
|
+ >
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
|
|
|
</el-form>
|
|
|
|
|
|
-
|
|
|
<div class="footer" slot="footer">
|
|
|
- <el-button @click="visible = false">取消</el-button>
|
|
|
- <el-button type="primary" v-click-once @click="confirm">确定</el-button>
|
|
|
- </div>
|
|
|
+ <el-button @click="visible = false">取消</el-button>
|
|
|
+ <el-button type="primary" v-click-once @click="confirm">确定</el-button>
|
|
|
+ </div>
|
|
|
</el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
@@ -109,7 +175,12 @@
|
|
|
releaseWorkOrder,
|
|
|
updatePriority
|
|
|
} from '@/api/workOrder/index.js';
|
|
|
- import { teamPage } from '@/api/mainData/index.js';
|
|
|
+ import {
|
|
|
+ teamPage,
|
|
|
+ listByFirstTaskId,
|
|
|
+ listByWorkCenterId,
|
|
|
+ listUserByIds
|
|
|
+ } from '@/api/mainData/index.js';
|
|
|
import OrderSearch from './components/order-search.vue';
|
|
|
|
|
|
import { fieldModel } from '@/api/saleOrder';
|
|
|
@@ -124,12 +195,41 @@
|
|
|
visible: false,
|
|
|
loading: false,
|
|
|
|
|
|
-
|
|
|
- singleType: 1,
|
|
|
form: {
|
|
|
+ assignType: 1,
|
|
|
singleReport: 1
|
|
|
},
|
|
|
- rules: {},
|
|
|
+ rules: {
|
|
|
+ singleReport: [
|
|
|
+ {
|
|
|
+ required: true,
|
|
|
+ message: '请选择报工类型',
|
|
|
+ trigger: ['blur', 'change']
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ workstationIds: [
|
|
|
+ {
|
|
|
+ required: true,
|
|
|
+ message: '请选择工位',
|
|
|
+ trigger: ['blur', 'change']
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ teamId: [
|
|
|
+ {
|
|
|
+ required: true,
|
|
|
+ message: '请选择班组',
|
|
|
+ trigger: ['blur', 'change']
|
|
|
+ }
|
|
|
+ ],
|
|
|
+
|
|
|
+ crewIds: [
|
|
|
+ {
|
|
|
+ required: true,
|
|
|
+ message: '请选择人员',
|
|
|
+ trigger: ['blur', 'change']
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ },
|
|
|
|
|
|
teamList: [],
|
|
|
|
|
|
@@ -141,6 +241,10 @@
|
|
|
|
|
|
newColumns: [],
|
|
|
|
|
|
+ stationList: [],
|
|
|
+ teamsList: [],
|
|
|
+ crewList: [],
|
|
|
+
|
|
|
current: null
|
|
|
};
|
|
|
},
|
|
|
@@ -171,25 +275,25 @@
|
|
|
prop: 'productionPlanCode',
|
|
|
label: '计划编号',
|
|
|
align: 'center',
|
|
|
- minWidth: 110,
|
|
|
+ minWidth: 110
|
|
|
},
|
|
|
{
|
|
|
prop: 'produceRoutingName',
|
|
|
label: '工艺路线',
|
|
|
align: 'center',
|
|
|
- minWidth: 110,
|
|
|
+ minWidth: 110
|
|
|
},
|
|
|
{
|
|
|
prop: 'productCode',
|
|
|
label: '产品编码',
|
|
|
align: 'center',
|
|
|
- minWidth: 110,
|
|
|
+ minWidth: 110
|
|
|
},
|
|
|
{
|
|
|
prop: 'productName',
|
|
|
label: '产品名称',
|
|
|
align: 'center',
|
|
|
- minWidth: 110,
|
|
|
+ minWidth: 110
|
|
|
},
|
|
|
{
|
|
|
prop: 'brandNo',
|
|
|
@@ -210,19 +314,6 @@
|
|
|
align: 'center'
|
|
|
},
|
|
|
|
|
|
- {
|
|
|
- prop: '',
|
|
|
- label: '工作中心',
|
|
|
- align: 'center'
|
|
|
- },
|
|
|
-
|
|
|
- {
|
|
|
- prop: '',
|
|
|
- label: '首工序',
|
|
|
- align: 'center'
|
|
|
- },
|
|
|
-
|
|
|
-
|
|
|
{
|
|
|
prop: 'priority',
|
|
|
label: '优先级',
|
|
|
@@ -263,6 +354,18 @@
|
|
|
minWidth: 110
|
|
|
},
|
|
|
|
|
|
+ {
|
|
|
+ prop: 'workCenterName',
|
|
|
+ label: '工作中心',
|
|
|
+ align: 'center'
|
|
|
+ },
|
|
|
+
|
|
|
+ {
|
|
|
+ prop: 'firstTaskName',
|
|
|
+ label: '首工序',
|
|
|
+ align: 'center'
|
|
|
+ },
|
|
|
+
|
|
|
{
|
|
|
prop: 'createTime',
|
|
|
label: '创建时间',
|
|
|
@@ -353,15 +456,18 @@
|
|
|
toRelease(row) {
|
|
|
this.current = row;
|
|
|
this.visible = true;
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ this.FirstTaskIdFn();
|
|
|
+ this.WorkCenterIdFn();
|
|
|
},
|
|
|
// 下达
|
|
|
confirm() {
|
|
|
- console.log(111)
|
|
|
- return false;
|
|
|
const loading = this.$loading({ text: '加载中...' });
|
|
|
releaseWorkOrder({
|
|
|
id: this.current.id,
|
|
|
- singleReport: this.singleReport
|
|
|
+ ...this.form
|
|
|
})
|
|
|
.then((res) => {
|
|
|
if (res) {
|
|
|
@@ -402,6 +508,26 @@
|
|
|
this.priorityChange(row);
|
|
|
},
|
|
|
|
|
|
+ FirstTaskIdFn() {
|
|
|
+ listByFirstTaskId(this.current.firstTaskId).then((res) => {
|
|
|
+ this.stationList = res;
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
+ WorkCenterIdFn() {
|
|
|
+ listByWorkCenterId(this.current.workCenterId).then((res) => {
|
|
|
+ this.teamsList = res;
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
+ stationChange() {
|
|
|
+ this.crewList = []
|
|
|
+ this.crewIds = []
|
|
|
+ listUserByIds([this.form.teamId]).then((res) => {
|
|
|
+ this.crewList = res;
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
priorityChange(row) {
|
|
|
if (row.priority > 10) {
|
|
|
row.priority = 10; // 如果大于 10,则设置为 10
|