|
|
@@ -2,7 +2,7 @@
|
|
|
<ele-modal
|
|
|
:visible.sync="visible"
|
|
|
:closed="cancel"
|
|
|
- :title="`${type == 'add' ? '创建' : '编辑'}采购配料计划`"
|
|
|
+ :title="`${type == 'add' ? '创建' : '编辑'}配料计划`"
|
|
|
custom-class="ele-dialog-form"
|
|
|
:close-on-click-modal="true"
|
|
|
:close-on-press-escape="false"
|
|
|
@@ -15,14 +15,32 @@
|
|
|
class="ele-body"
|
|
|
:rules="rules"
|
|
|
>
|
|
|
- <el-row :gutter="32">
|
|
|
- <el-col :span="12">
|
|
|
- <el-form-item label="配料计划名称" prop="name">
|
|
|
+ <el-row :gutter="24">
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="需求类型" prop="demandType">
|
|
|
+ <el-select
|
|
|
+ v-model="formData.demandType"
|
|
|
+ placeholder="请选择"
|
|
|
+ style="width: 100%"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in demandTypeList"
|
|
|
+ :key="item.dictCode"
|
|
|
+ :label="item.dictValue"
|
|
|
+ :value="item.dictCode"
|
|
|
+ >
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="计划名称" prop="name">
|
|
|
<el-input placeholder="请选择" v-model="formData.name"></el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
|
|
|
- <el-col :span="12">
|
|
|
+ <el-col :span="8">
|
|
|
<el-form-item label="备注" prop="remark">
|
|
|
<el-input placeholder="备注" v-model="formData.remark"></el-input>
|
|
|
</el-form-item>
|
|
|
@@ -261,6 +279,7 @@
|
|
|
import ProductionVersion from '@/components/CreatePlan/ProductionVersion2.vue';
|
|
|
import fileUpload from '@/components/upload/fileUpload';
|
|
|
import timeDialog from './timeDialog';
|
|
|
+ import dictMixins from '@/mixins/dictMixins';
|
|
|
export default {
|
|
|
components: {
|
|
|
saleOrderPop,
|
|
|
@@ -269,6 +288,7 @@
|
|
|
fileUpload,
|
|
|
timeDialog
|
|
|
},
|
|
|
+ mixins: [dictMixins],
|
|
|
data() {
|
|
|
return {
|
|
|
visible: false,
|
|
|
@@ -490,6 +510,13 @@
|
|
|
}
|
|
|
],
|
|
|
rules: {
|
|
|
+ demandType: [
|
|
|
+ {
|
|
|
+ required: true,
|
|
|
+ message: '请选择需求类型',
|
|
|
+ trigger: ['blur', 'change']
|
|
|
+ }
|
|
|
+ ],
|
|
|
name: [
|
|
|
{
|
|
|
required: true,
|
|
|
@@ -503,13 +530,20 @@
|
|
|
remark: '',
|
|
|
detailRemoveIds: [],
|
|
|
materialRemoveIds: []
|
|
|
- }
|
|
|
+ },
|
|
|
+
|
|
|
+ demandTypeList: []
|
|
|
};
|
|
|
},
|
|
|
+
|
|
|
methods: {
|
|
|
async open(type, row) {
|
|
|
this.type = type;
|
|
|
+
|
|
|
+ this.typeList();
|
|
|
+
|
|
|
this.visible = true;
|
|
|
+
|
|
|
if (row) {
|
|
|
this.getDetail(row.id);
|
|
|
} else {
|
|
|
@@ -519,6 +553,18 @@
|
|
|
}
|
|
|
},
|
|
|
|
|
|
+ typeList() {
|
|
|
+ this.requestDict('需求类型').then((res) => {
|
|
|
+ let _res = res || [];
|
|
|
+
|
|
|
+ this.demandTypeList = _res.filter(
|
|
|
+ (f) => f.dictCode == 1 || f.dictCode == 6
|
|
|
+ );
|
|
|
+
|
|
|
+ console.log( this.demandTypeList );
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
getDetail(id) {
|
|
|
getById(id).then((res) => {
|
|
|
this.$set(this.formData, 'name', res.name);
|