|
@@ -21,25 +21,23 @@
|
|
<el-col :xs="24" :sm="12" :lg="6">
|
|
<el-col :xs="24" :sm="12" :lg="6">
|
|
<el-form-item label="型号" prop="model">
|
|
<el-form-item label="型号" prop="model">
|
|
<el-input
|
|
<el-input
|
|
- type="number"
|
|
|
|
placeholder="请输入型号"
|
|
placeholder="请输入型号"
|
|
- v-model.number="screenForm.model"
|
|
|
|
|
|
+ v-model="screenForm.model"
|
|
></el-input>
|
|
></el-input>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-col>
|
|
</el-col>
|
|
<el-col :xs="24" :sm="12" :lg="6">
|
|
<el-col :xs="24" :sm="12" :lg="6">
|
|
<el-form-item label="编码" prop="number">
|
|
<el-form-item label="编码" prop="number">
|
|
<el-input
|
|
<el-input
|
|
-
|
|
|
|
placeholder="请输入编码"
|
|
placeholder="请输入编码"
|
|
- v-model.number="screenForm.number"
|
|
|
|
|
|
+ v-model="screenForm.number"
|
|
></el-input>
|
|
></el-input>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-col>
|
|
</el-col>
|
|
<el-col :xs="24" :sm="12" :lg="6">
|
|
<el-col :xs="24" :sm="12" :lg="6">
|
|
<el-form-item label="体积" prop="volume">
|
|
<el-form-item label="体积" prop="volume">
|
|
<el-input
|
|
<el-input
|
|
- type="number"
|
|
|
|
|
|
+ type="number"
|
|
placeholder="请输入体积"
|
|
placeholder="请输入体积"
|
|
v-model.number="screenForm.volume"
|
|
v-model.number="screenForm.volume"
|
|
></el-input>
|
|
></el-input>
|
|
@@ -97,7 +95,13 @@
|
|
<el-button type="primary" size="small" @click="handleExport"
|
|
<el-button type="primary" size="small" @click="handleExport"
|
|
>导出</el-button
|
|
>导出</el-button
|
|
>
|
|
>
|
|
- <el-button type="primary" size="small" icon="el-icon-printer" v-print="printObj">打 印</el-button>
|
|
|
|
|
|
+ <!-- <el-button
|
|
|
|
+ type="primary"
|
|
|
|
+ size="small"
|
|
|
|
+ icon="el-icon-printer"
|
|
|
|
+ v-print="printObj"
|
|
|
|
+ >打 印</el-button
|
|
|
|
+ > -->
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="mymain-container" id="printMe">
|
|
<div class="mymain-container" id="printMe">
|
|
@@ -122,10 +126,15 @@
|
|
min-width="160"
|
|
min-width="160"
|
|
show-overflow-tooltip
|
|
show-overflow-tooltip
|
|
>
|
|
>
|
|
- <template slot-scope="scope">
|
|
|
|
- {{scope.row.type=='INNER'?'内机':scope.row.type=='OUTSIDE'?'外机':'配件'}}
|
|
|
|
- </template>
|
|
|
|
-
|
|
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
+ {{
|
|
|
|
+ scope.row.type == "INNER"
|
|
|
|
+ ? "内机"
|
|
|
|
+ : scope.row.type == "OUTSIDE"
|
|
|
|
+ ? "外机"
|
|
|
|
+ : "配件"
|
|
|
|
+ }}
|
|
|
|
+ </template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
<el-table-column
|
|
<el-table-column
|
|
align="center"
|
|
align="center"
|
|
@@ -243,11 +252,12 @@
|
|
ref="diaLogForm"
|
|
ref="diaLogForm"
|
|
:model="diaLogForm"
|
|
:model="diaLogForm"
|
|
label-width="70px"
|
|
label-width="70px"
|
|
|
|
+ :rules="rules"
|
|
size="small"
|
|
size="small"
|
|
label-position="left"
|
|
label-position="left"
|
|
>
|
|
>
|
|
- <el-form-item label="类型">
|
|
|
|
- <el-select v-model="diaLogForm.type" filterable placeholder="请选择">
|
|
|
|
|
|
+ <el-form-item label="类型" prop="type">
|
|
|
|
+ <el-select v-model="diaLogForm.type" filterable placeholder="请选择">
|
|
<el-option
|
|
<el-option
|
|
v-for="item in distList"
|
|
v-for="item in distList"
|
|
:key="item.dictCode"
|
|
:key="item.dictCode"
|
|
@@ -257,21 +267,25 @@
|
|
</el-option>
|
|
</el-option>
|
|
</el-select>
|
|
</el-select>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
- <el-form-item label="名称">
|
|
|
|
- <el-input v-model="diaLogForm.name" type="number" size="normal"></el-input>
|
|
|
|
|
|
+ <el-form-item label="名称" prop="name">
|
|
|
|
+ <el-input v-model="diaLogForm.name" size="normal"></el-input>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
- <el-form-item label="型号">
|
|
|
|
- <el-input v-model="diaLogForm.model" type="number" size="normal"></el-input>
|
|
|
|
|
|
+ <el-form-item label="型号" prop="model">
|
|
|
|
+ <el-input v-model="diaLogForm.model" size="normal"></el-input>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
- <el-form-item label="编码">
|
|
|
|
- <el-input v-model="diaLogForm.number" size="normal"></el-input>
|
|
|
|
|
|
+ <el-form-item label="编码" prop="number">
|
|
|
|
+ <el-input v-model="diaLogForm.number" size="normal"></el-input>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
- <el-form-item label="体积">
|
|
|
|
- <el-input v-model="diaLogForm.volume" type="number" size="normal"></el-input>
|
|
|
|
|
|
+ <el-form-item label="体积" prop="volume">
|
|
|
|
+ <el-input
|
|
|
|
+ v-model="diaLogForm.volume"
|
|
|
|
+ type="number"
|
|
|
|
+ size="normal"
|
|
|
|
+ ></el-input>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-form>
|
|
</el-form>
|
|
<div slot="footer" class="dialog-footer">
|
|
<div slot="footer" class="dialog-footer">
|
|
- <el-button @click="(showDialogForm = false), resetInfo()"
|
|
|
|
|
|
+ <el-button @click="(showDialogForm = false), resetForm(), resetInfo()"
|
|
>取 消</el-button
|
|
>取 消</el-button
|
|
>
|
|
>
|
|
<el-button type="primary" @click="hanleInfo">确 定</el-button>
|
|
<el-button type="primary" @click="hanleInfo">确 定</el-button>
|
|
@@ -290,16 +304,16 @@ import {
|
|
getMachineEdit,
|
|
getMachineEdit,
|
|
getDistList,
|
|
getDistList,
|
|
} from "@/api/basic_data/material";
|
|
} from "@/api/basic_data/material";
|
|
-import print from 'vue-print-nb'
|
|
|
|
|
|
+import print from "vue-print-nb";
|
|
export default {
|
|
export default {
|
|
mixins: [Mixin],
|
|
mixins: [Mixin],
|
|
- directives: {
|
|
|
|
- print
|
|
|
|
|
|
+ directives: {
|
|
|
|
+ print,
|
|
},
|
|
},
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
- printObj: {
|
|
|
|
- id: 'printMe'
|
|
|
|
|
|
+ printObj: {
|
|
|
|
+ id: "printMe",
|
|
},
|
|
},
|
|
currentPage: 1, // 当前页码
|
|
currentPage: 1, // 当前页码
|
|
pageSize: 10, // 每页数量
|
|
pageSize: 10, // 每页数量
|
|
@@ -335,26 +349,37 @@ export default {
|
|
type: "",
|
|
type: "",
|
|
},
|
|
},
|
|
showDialogForm: false,
|
|
showDialogForm: false,
|
|
- dataList: [
|
|
|
|
-
|
|
|
|
- ],
|
|
|
|
|
|
+ dataList: [],
|
|
screenForm: {
|
|
screenForm: {
|
|
- model:'',
|
|
|
|
|
|
+ model: "",
|
|
name: "",
|
|
name: "",
|
|
number: "",
|
|
number: "",
|
|
type: "",
|
|
type: "",
|
|
volume: "",
|
|
volume: "",
|
|
},
|
|
},
|
|
type: null,
|
|
type: null,
|
|
- distList:[]
|
|
|
|
-
|
|
|
|
|
|
+ distList: [],
|
|
|
|
+ rules: {
|
|
|
|
+ type: [{ required: true, message: "请选择类型", trigger: "blur" }],
|
|
|
|
+ name: [{ required: true, message: "请选择名称", trigger: "blur" }],
|
|
|
|
+ model: [{ required: true, message: "请输入型号", trigger: "blur" }],
|
|
|
|
+ number: [{ required: true, message: "请输入编码", trigger: "blur" }],
|
|
|
|
+ volume: [
|
|
|
|
+ {
|
|
|
|
+ required: true,
|
|
|
|
+ message: "请输入体积",
|
|
|
|
+ type: "number",
|
|
|
|
+ trigger: "blur",
|
|
|
|
+ },
|
|
|
|
+ ],
|
|
|
|
+ },
|
|
};
|
|
};
|
|
},
|
|
},
|
|
created() {
|
|
created() {
|
|
- getDistList({ sysDictEnum: "MACHINE_CONFIGURE" }).then((res) => {
|
|
|
|
- this.distList = res.data;
|
|
|
|
- console.log(res, 123);
|
|
|
|
- });
|
|
|
|
|
|
+ getDistList({ sysDictEnum: "MACHINE_CONFIGURE" }).then((res) => {
|
|
|
|
+ this.distList = res.data;
|
|
|
|
+ console.log(res, 123);
|
|
|
|
+ });
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
editFn(id, row) {
|
|
editFn(id, row) {
|
|
@@ -369,24 +394,37 @@ export default {
|
|
};
|
|
};
|
|
this.showDialogForm = true;
|
|
this.showDialogForm = true;
|
|
},
|
|
},
|
|
|
|
+ resetForm(formName) {
|
|
|
|
+ this.$refs.diaLogForm.resetFields();
|
|
|
|
+ },
|
|
hanleInfo() {
|
|
hanleInfo() {
|
|
- if (this.type === 1) {
|
|
|
|
- getMachineAdd(this.diaLogForm).then((res) => {
|
|
|
|
- this.$successMsg("保存成功");
|
|
|
|
- this.getList();
|
|
|
|
- });
|
|
|
|
- } else if (this.type === 2) {
|
|
|
|
- const params = {
|
|
|
|
- ...this.diaLogForm,
|
|
|
|
- };
|
|
|
|
- getMachineEdit(params).then((res) => {
|
|
|
|
- this.$successMsg("编辑成功");
|
|
|
|
- this.getList();
|
|
|
|
- });
|
|
|
|
- this.diaLogForm.id = null;
|
|
|
|
- }
|
|
|
|
- this.resetInfo();
|
|
|
|
- this.showDialogForm = false;
|
|
|
|
|
|
+ this.$refs.diaLogForm.validate((valid) => {
|
|
|
|
+ if (valid) {
|
|
|
|
+ if (this.type === 1) {
|
|
|
|
+ getMachineAdd(this.diaLogForm).then((res) => {
|
|
|
|
+ this.$successMsg("保存成功");
|
|
|
|
+ this.showDialogForm = false;
|
|
|
|
+ this.resetInfo();
|
|
|
|
+ this.getList();
|
|
|
|
+ });
|
|
|
|
+ } else if (this.type === 2) {
|
|
|
|
+ const params = {
|
|
|
|
+ ...this.diaLogForm,
|
|
|
|
+ };
|
|
|
|
+ getMachineEdit(params).then((res) => {
|
|
|
|
+ this.$successMsg("编辑成功");
|
|
|
|
+ this.showDialogForm = false;
|
|
|
|
+ this.resetInfo();
|
|
|
|
+ this.getList();
|
|
|
|
+ });
|
|
|
|
+ this.diaLogForm.id = null;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ } else {
|
|
|
|
+ console.log("error submit!!");
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ });
|
|
},
|
|
},
|
|
// 初始化数据
|
|
// 初始化数据
|
|
getList() {
|
|
getList() {
|
|
@@ -394,7 +432,7 @@ export default {
|
|
let params = {
|
|
let params = {
|
|
pageNum: this.currentPage,
|
|
pageNum: this.currentPage,
|
|
pageSize: this.pageSize,
|
|
pageSize: this.pageSize,
|
|
- name: this.screenForm.name ,
|
|
|
|
|
|
+ name: this.screenForm.name,
|
|
number: this.screenForm.number,
|
|
number: this.screenForm.number,
|
|
model: this.screenForm.model,
|
|
model: this.screenForm.model,
|
|
volume: this.screenForm.volume,
|
|
volume: this.screenForm.volume,
|
|
@@ -405,7 +443,6 @@ export default {
|
|
this.listLoading = false;
|
|
this.listLoading = false;
|
|
console.log(this.dataList, 1233);
|
|
console.log(this.dataList, 1233);
|
|
});
|
|
});
|
|
-
|
|
|
|
},
|
|
},
|
|
// 导入
|
|
// 导入
|
|
async handleImport(param) {
|
|
async handleImport(param) {
|