|
|
|
@ -1,114 +1,168 @@
|
|
|
|
|
<template>
|
|
|
|
|
<el-card>
|
|
|
|
|
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
|
|
|
|
|
<el-divider content-position="left"><span style="font-weight: bold; font-size: larger;">工单信息</span></el-divider>
|
|
|
|
|
<el-row :gutter="10">
|
|
|
|
|
<el-col :span="12">
|
|
|
|
|
<el-form-item label="工单号:">{{ form.orderCode }}</el-form-item>
|
|
|
|
|
<el-form-item label="成品编码:">{{ form.materialCode }}</el-form-item>
|
|
|
|
|
<el-form-item label="计划开始时间:">{{ parseTime(form.planBeginTime) }}</el-form-item>
|
|
|
|
|
<el-form-item label="计划数量/已派工数量/完成数量:" label-width="220px">
|
|
|
|
|
{{ form.planAmount }}/{{ form.dispatchAmount }}/{{ form.completeAmount }}
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="12">
|
|
|
|
|
<el-form-item label="工艺路线:">{{ form.dispatchName }}</el-form-item>
|
|
|
|
|
<el-form-item label="成品名称:">{{ form.materialName }}</el-form-item>
|
|
|
|
|
<el-form-item label="计划结束时间:">{{ parseTime(form.planEndTime) }}</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
</el-row>
|
|
|
|
|
<div>
|
|
|
|
|
<el-card>
|
|
|
|
|
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
|
|
|
|
|
<el-divider content-position="left"><span style="font-weight: bold; font-size: larger;">工单信息</span></el-divider>
|
|
|
|
|
<el-row :gutter="10">
|
|
|
|
|
<el-col :span="12">
|
|
|
|
|
<el-form-item label="工单号:">{{ form.orderCode }}</el-form-item>
|
|
|
|
|
<el-form-item label="成品编码:">{{ form.materialCode }}</el-form-item>
|
|
|
|
|
<el-form-item label="计划开始时间:">{{ parseTime(form.planBeginTime) }}</el-form-item>
|
|
|
|
|
<el-form-item label="计划数量/已派工数量/完成数量:" label-width="220px">
|
|
|
|
|
{{ form.planAmount }}/{{ form.dispatchAmount }}/{{ form.completeAmount }}
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="12">
|
|
|
|
|
<el-form-item label="工艺路线:">{{ form.dispatchName }}</el-form-item>
|
|
|
|
|
<el-form-item label="成品名称:">{{ form.materialName }}</el-form-item>
|
|
|
|
|
<el-form-item label="计划结束时间:">{{ parseTime(form.planEndTime) }}</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
</el-row>
|
|
|
|
|
|
|
|
|
|
<el-divider content-position="left"><span style="font-weight: bold; font-size: larger;">派工信息</span></el-divider>
|
|
|
|
|
<el-divider content-position="left"><span style="font-weight: bold; font-size: larger;">派工信息</span></el-divider>
|
|
|
|
|
|
|
|
|
|
<el-row :gutter="10" class="mb8">
|
|
|
|
|
<el-col :span="1.5">
|
|
|
|
|
<el-button type="primary" icon="el-icon-plus" size="mini" @click="handleAddMesProductPlan">新增
|
|
|
|
|
</el-button>
|
|
|
|
|
</el-col>
|
|
|
|
|
<!-- <el-col :span="1.5">-->
|
|
|
|
|
<!-- <el-button type="danger" icon="el-icon-delete" size="mini" @click="handleDeleteMesProductPlan">删除-->
|
|
|
|
|
<!-- </el-button>-->
|
|
|
|
|
<!-- </el-col>-->
|
|
|
|
|
</el-row>
|
|
|
|
|
<el-table :data="mesProductPlanList" :row-class-name="rowMesProductPlanIndex"
|
|
|
|
|
@selection-change="handleMesProductPlanSelectionChange" ref="mesProductPlan">
|
|
|
|
|
<el-table-column type="selection" width="50" align="center"/>
|
|
|
|
|
<el-table-column label="序号" align="center" prop="index" width="50" v-if="false"/>
|
|
|
|
|
<el-table-column label="派工单号" align="center" prop="dispatchCode" width="190">
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<el-input v-model="scope.row.dispatchCode" :disabled="true"/>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="工序" align="center" prop="processName" width="140">
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<el-input v-model="scope.row.processName" :disabled="true"/>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="步骤" align="center" prop="processOrder" >
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<el-input v-model="scope.row.processOrder" :disabled="true"/>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="工位" align="center" prop="stationName" width="140" >
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<el-input v-model="scope.row.stationName" :disabled="true"/>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="派工数量" align="center" prop="planAmount" width="100">
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<el-input v-model="scope.row.planAmount" :disabled="scope.row.oldRowFlag"/>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="派工标准工时" align="center" prop="productionTime" width="100">
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<el-input v-model="scope.row.productionTime" :disabled="scope.row.oldRowFlag"/>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="计划开始时间" align="center" prop="planBeginTime" width="230">
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<el-date-picker clearable v-model="scope.row.planBeginTime" type="datetime"
|
|
|
|
|
value-format="yyyy-MM-dd HH:mm:ss"
|
|
|
|
|
placeholder="请选择计划开始时间" :disabled="scope.row.oldRowFlag"/>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="计划完成时间" align="center" prop="planEndTime" width="230">
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<el-date-picker clearable v-model="scope.row.planEndTime" type="datetime" value-format="yyyy-MM-dd HH:mm:ss"
|
|
|
|
|
placeholder="请选择计划完成时间" :disabled="scope.row.oldRowFlag"/>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="状态" align="center" prop="planStatus" width="150">
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<el-select v-model="scope.row.planStatus" placeholder="请选择状态" :disabled="true">
|
|
|
|
|
<el-option
|
|
|
|
|
v-for="dict in dict.type.product_status"
|
|
|
|
|
:key="dict.value"
|
|
|
|
|
:label="dict.label"
|
|
|
|
|
:value="dict.value"
|
|
|
|
|
/>
|
|
|
|
|
</el-select>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="50">
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<el-button
|
|
|
|
|
type="primary"
|
|
|
|
|
icon="el-icon-search"
|
|
|
|
|
size="mini"
|
|
|
|
|
@click="handleDrawing(scope.row)"
|
|
|
|
|
>图纸
|
|
|
|
|
<el-row :gutter="10" class="mb8">
|
|
|
|
|
<el-col :span="1.5">
|
|
|
|
|
<el-button icon="el-icon-plus" size="mini" type="primary" @click="handleAddMesProductPlan">新增
|
|
|
|
|
</el-button>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
</el-table>
|
|
|
|
|
</el-form>
|
|
|
|
|
<el-form label-width="100px">
|
|
|
|
|
<el-form-item style="text-align: center;margin-left:-100px;margin-top:10px;">
|
|
|
|
|
<el-button type="primary" @click="submitForm()">提交</el-button>
|
|
|
|
|
<el-button @click="close()">返回</el-button>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-form>
|
|
|
|
|
</el-card>
|
|
|
|
|
</el-col>
|
|
|
|
|
<!-- <el-col :span="1.5">-->
|
|
|
|
|
<!-- <el-button type="danger" icon="el-icon-delete" size="mini" @click="handleDeleteMesProductPlan">删除-->
|
|
|
|
|
<!-- </el-button>-->
|
|
|
|
|
<!-- </el-col>-->
|
|
|
|
|
</el-row>
|
|
|
|
|
<el-table ref="mesProductPlan" :data="mesProductPlanList"
|
|
|
|
|
:row-class-name="rowMesProductPlanIndex" @selection-change="handleMesProductPlanSelectionChange">
|
|
|
|
|
<el-table-column align="center" type="selection" width="50"/>
|
|
|
|
|
<el-table-column v-if="false" align="center" label="序号" prop="index" width="50"/>
|
|
|
|
|
<el-table-column align="center" label="派工单号" prop="dispatchCode" width="190">
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<el-input v-model="scope.row.dispatchCode" :disabled="true"/>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column align="center" label="工序" prop="processName" width="140">
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<el-input v-model="scope.row.processName" :disabled="true"/>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column align="center" label="步骤" prop="processOrder">
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<el-input v-model="scope.row.processOrder" :disabled="true"/>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column align="center" label="工位" prop="stationName" width="140">
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<el-input v-model="scope.row.stationName" :disabled="true"/>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column align="center" label="派工数量" prop="planAmount" width="100">
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<el-input v-model="scope.row.planAmount" :disabled="scope.row.oldRowFlag"/>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column align="center" label="派工标准工时" prop="productionTime" width="100">
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<el-input v-model="scope.row.productionTime" :disabled="scope.row.oldRowFlag"/>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column align="center" label="计划开始时间" prop="planBeginTime" width="230">
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<el-date-picker v-model="scope.row.planBeginTime" :disabled="scope.row.oldRowFlag" clearable
|
|
|
|
|
placeholder="请选择计划开始时间"
|
|
|
|
|
type="datetime" value-format="yyyy-MM-dd HH:mm:ss"/>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column align="center" label="计划完成时间" prop="planEndTime" width="230">
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<el-date-picker v-model="scope.row.planEndTime" :disabled="scope.row.oldRowFlag" clearable
|
|
|
|
|
placeholder="请选择计划完成时间"
|
|
|
|
|
type="datetime" value-format="yyyy-MM-dd HH:mm:ss"/>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column align="center" label="状态" prop="planStatus" width="150">
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<el-select v-model="scope.row.planStatus" :disabled="true" placeholder="请选择状态">
|
|
|
|
|
<el-option
|
|
|
|
|
v-for="dict in dict.type.product_status"
|
|
|
|
|
:key="dict.value"
|
|
|
|
|
:label="dict.label"
|
|
|
|
|
:value="dict.value"
|
|
|
|
|
/>
|
|
|
|
|
</el-select>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column align="center" class-name="small-padding fixed-width" label="操作" width="50">
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<el-button
|
|
|
|
|
icon="el-icon-search"
|
|
|
|
|
size="mini"
|
|
|
|
|
type="primary"
|
|
|
|
|
@click="handleDrawing(scope.row)"
|
|
|
|
|
>图纸
|
|
|
|
|
</el-button>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
</el-table>
|
|
|
|
|
</el-form>
|
|
|
|
|
<el-form label-width="100px">
|
|
|
|
|
<el-form-item style="text-align: center;margin-left:-100px;margin-top:10px;">
|
|
|
|
|
<el-button type="primary" @click="submitForm()">提交</el-button>
|
|
|
|
|
<el-button @click="close()">返回</el-button>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-form>
|
|
|
|
|
</el-card>
|
|
|
|
|
<el-dialog
|
|
|
|
|
:visible.sync="blueprintModel"
|
|
|
|
|
title="上传图纸"
|
|
|
|
|
width="30%"
|
|
|
|
|
@before-close="blueprintModel = false">
|
|
|
|
|
<el-upload
|
|
|
|
|
ref="upload"
|
|
|
|
|
:auto-upload="false"
|
|
|
|
|
action="#"
|
|
|
|
|
multiple
|
|
|
|
|
list-type="picture-card">
|
|
|
|
|
<i slot="default" class="el-icon-plus"></i>
|
|
|
|
|
<div slot="file" slot-scope="{file}">
|
|
|
|
|
<img
|
|
|
|
|
v-if="isAssetTypeAnImage(file.name)"
|
|
|
|
|
:alt="file.name"
|
|
|
|
|
:src="file.url" class="el-upload-list__item-thumbnail"
|
|
|
|
|
>
|
|
|
|
|
<span v-else>{{ file.name }}</span>
|
|
|
|
|
<span class="el-upload-list__item-actions">
|
|
|
|
|
<span
|
|
|
|
|
v-if="isAssetTypeAnImage(file.name)"
|
|
|
|
|
class="el-upload-list__item-preview"
|
|
|
|
|
@click="handlePictureCardPreview(file)"
|
|
|
|
|
>
|
|
|
|
|
<i class="el-icon-zoom-in"></i>
|
|
|
|
|
</span>
|
|
|
|
|
<span
|
|
|
|
|
class="el-upload-list__item-delete"
|
|
|
|
|
@click="handleDownload(file)"
|
|
|
|
|
>
|
|
|
|
|
<i class="el-icon-download"></i>
|
|
|
|
|
</span>
|
|
|
|
|
<span
|
|
|
|
|
class="el-upload-list__item-delete"
|
|
|
|
|
@click="$refs.upload.handleRemove(file)"
|
|
|
|
|
>
|
|
|
|
|
<i class="el-icon-delete"></i>
|
|
|
|
|
</span>
|
|
|
|
|
</span>
|
|
|
|
|
</div>
|
|
|
|
|
</el-upload>
|
|
|
|
|
<span slot="footer" class="dialog-footer">
|
|
|
|
|
<el-button @click="blueprintModel = false">取 消</el-button>
|
|
|
|
|
<el-button type="primary" @click="blueprintModel = false">确 定</el-button>
|
|
|
|
|
</span>
|
|
|
|
|
</el-dialog>
|
|
|
|
|
<el-dialog :visible.sync="pictureDetailModel">
|
|
|
|
|
<img :src="dialogImageUrl" alt="" width="100%">
|
|
|
|
|
</el-dialog>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
@ -121,6 +175,9 @@ export default {
|
|
|
|
|
dicts: ['active_flag', 'product_status'],
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
blueprintModel: false,
|
|
|
|
|
pictureDetailModel: false,
|
|
|
|
|
dialogImageUrl: '',
|
|
|
|
|
// 选中选项卡的 name
|
|
|
|
|
activeName: "columnInfo",
|
|
|
|
|
// 表格的高度
|
|
|
|
@ -183,10 +240,16 @@ export default {
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
isAssetTypeAnImage(ext) {
|
|
|
|
|
let suffix = ext.lastIndexOf(".");
|
|
|
|
|
let name = ext.substr(suffix + 1);
|
|
|
|
|
return [
|
|
|
|
|
'png', 'jpg', 'jpeg'].includes(name.toLowerCase())
|
|
|
|
|
},
|
|
|
|
|
/** 提交按钮 */
|
|
|
|
|
submitForm() {
|
|
|
|
|
let dataList = this.mesProductPlanList.filter(plan => !plan.oldRowFlag);
|
|
|
|
|
if (dataList.length === 0){
|
|
|
|
|
if (dataList.length === 0) {
|
|
|
|
|
this.close();
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
@ -223,24 +286,29 @@ export default {
|
|
|
|
|
this.$modal.msgSuccess(res.msg);
|
|
|
|
|
this.close();
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
,
|
|
|
|
|
/** 生产计划明细序号 */
|
|
|
|
|
rowMesProductPlanIndex({row, rowIndex}) {
|
|
|
|
|
row.index = rowIndex + 1;
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
,
|
|
|
|
|
/** 复选框选中数据 */
|
|
|
|
|
handleMesProductPlanSelectionChange(selection) {
|
|
|
|
|
this.checkedMesProductPlan = selection.map(item => item.index)
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
,
|
|
|
|
|
/** 关闭按钮 */
|
|
|
|
|
close() {
|
|
|
|
|
const obj = {path: "/mes/plan/productOrder", query: {t: Date.now(), pageNum: this.$route.query.pageNum}};
|
|
|
|
|
this.$tab.closeOpenPage(obj);
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
,
|
|
|
|
|
/** 查看图纸 */
|
|
|
|
|
handleDrawing(row) {
|
|
|
|
|
console.log(row);
|
|
|
|
|
},
|
|
|
|
|
this.blueprintModel = true
|
|
|
|
|
}
|
|
|
|
|
,
|
|
|
|
|
/** 生产计划添加按钮操作 */
|
|
|
|
|
handleAddMesProductPlan() {
|
|
|
|
|
let dispatchCode = "";
|
|
|
|
@ -285,11 +353,13 @@ export default {
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
,
|
|
|
|
|
isPositiveInteger(value) {
|
|
|
|
|
// 使用正则表达式匹配正整数
|
|
|
|
|
return /^[1-9]\d*$/.test(value);
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
,
|
|
|
|
|
/** 生产计划明细删除按钮操作 */
|
|
|
|
|
handleDeleteMesProductPlan() {
|
|
|
|
|
if (this.checkedMesProductPlan.length == 0) {
|
|
|
|
@ -302,6 +372,14 @@ export default {
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
handlePictureCardPreview(file) {
|
|
|
|
|
this.dialogImageUrl = file.url;
|
|
|
|
|
this.pictureDetailModel = true;
|
|
|
|
|
}
|
|
|
|
|
,
|
|
|
|
|
handleDownload(file) {
|
|
|
|
|
console.log(file);
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
mounted() {
|
|
|
|
@ -317,5 +395,6 @@ export default {
|
|
|
|
|
// }
|
|
|
|
|
// });
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
;
|
|
|
|
|
</script>
|
|
|
|
|