|
@@ -4,7 +4,6 @@
|
|
<el-form
|
|
<el-form
|
|
ref="screenForm"
|
|
ref="screenForm"
|
|
:model="screenForm"
|
|
:model="screenForm"
|
|
-
|
|
|
|
size="small"
|
|
size="small"
|
|
label-position="left"
|
|
label-position="left"
|
|
>
|
|
>
|
|
@@ -149,12 +148,16 @@
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<div>
|
|
- <el-dialog :visible.sync="dialogVisible" width="50%" @close="resetForm"
|
|
|
|
- :close-on-click-modal="false">
|
|
|
|
|
|
+ <el-dialog
|
|
|
|
+ :visible.sync="dialogVisible"
|
|
|
|
+ width="50%"
|
|
|
|
+ @close="resetForm"
|
|
|
|
+ :close-on-click-modal="false"
|
|
|
|
+ >
|
|
<el-form
|
|
<el-form
|
|
ref="dialogForm"
|
|
ref="dialogForm"
|
|
:model="dialogForm"
|
|
:model="dialogForm"
|
|
- :rules="type==1?rules:''"
|
|
|
|
|
|
+ :rules="type == 1 ? rules : ''"
|
|
label-width="120px"
|
|
label-width="120px"
|
|
size="normal"
|
|
size="normal"
|
|
>
|
|
>
|
|
@@ -162,10 +165,20 @@
|
|
<el-input v-model="dialogForm.saleCode"></el-input>
|
|
<el-input v-model="dialogForm.saleCode"></el-input>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item label="销售类型名称" prop="saleName">
|
|
<el-form-item label="销售类型名称" prop="saleName">
|
|
- <el-input v-model="dialogForm.saleName" ></el-input>
|
|
|
|
|
|
+ <el-input v-model="dialogForm.saleName"></el-input>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item label="品类" prop="mainName">
|
|
<el-form-item label="品类" prop="mainName">
|
|
- <el-input v-model="dialogForm.mainName"></el-input>
|
|
|
|
|
|
+ <el-select v-model="dialogForm.mainName">
|
|
|
|
+ <el-option
|
|
|
|
+ v-for="(item, index) in productList"
|
|
|
|
+ :key="index"
|
|
|
|
+ :label="item.productCategoryName"
|
|
|
|
+ :value="item.productCategoryName"
|
|
|
|
+ >
|
|
|
|
+ </el-option>
|
|
|
|
+ </el-select>
|
|
|
|
+
|
|
|
|
+ <!-- <el-input v-model="dialogForm.mainName"></el-input> -->
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item label="状态" prop="status">
|
|
<el-form-item label="状态" prop="status">
|
|
<el-switch
|
|
<el-switch
|
|
@@ -178,7 +191,9 @@
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-form>
|
|
</el-form>
|
|
<span slot="footer" class="dialog-footer">
|
|
<span slot="footer" class="dialog-footer">
|
|
- <el-button @click="dialogVisible = false,resetForm()">取 消</el-button>
|
|
|
|
|
|
+ <el-button @click="(dialogVisible = false), resetForm()"
|
|
|
|
+ >取 消</el-button
|
|
|
|
+ >
|
|
<el-button type="primary" @click="handelInfo">确 定</el-button>
|
|
<el-button type="primary" @click="handelInfo">确 定</el-button>
|
|
</span>
|
|
</span>
|
|
</el-dialog>
|
|
</el-dialog>
|
|
@@ -195,6 +210,7 @@ import {
|
|
addData,
|
|
addData,
|
|
updateType,
|
|
updateType,
|
|
getDetail,
|
|
getDetail,
|
|
|
|
+ getProductList,
|
|
} from "@/api/supply/sales";
|
|
} from "@/api/supply/sales";
|
|
|
|
|
|
export default {
|
|
export default {
|
|
@@ -280,10 +296,17 @@ export default {
|
|
},
|
|
},
|
|
],
|
|
],
|
|
rules: {
|
|
rules: {
|
|
- saleCode: [{required: true,message: '请输入销售类型编码', trigger: 'blur'}],
|
|
|
|
- saleName: [{required: true,message: '请输入销售类型名称', trigger: 'blur'}],
|
|
|
|
- mainName: [{required: true,message: '请输入品类名称', trigger: 'blur'}],
|
|
|
|
|
|
+ saleCode: [
|
|
|
|
+ { required: true, message: "请输入销售类型编码", trigger: "blur" },
|
|
|
|
+ ],
|
|
|
|
+ saleName: [
|
|
|
|
+ { required: true, message: "请输入销售类型名称", trigger: "blur" },
|
|
|
|
+ ],
|
|
|
|
+ mainName: [
|
|
|
|
+ { required: true, message: "请输入品类名称", trigger: "blur" },
|
|
|
|
+ ],
|
|
},
|
|
},
|
|
|
|
+ productList: [],
|
|
};
|
|
};
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
@@ -301,6 +324,12 @@ export default {
|
|
this.listTotal = res.data.total;
|
|
this.listTotal = res.data.total;
|
|
this.listLoading = false;
|
|
this.listLoading = false;
|
|
});
|
|
});
|
|
|
|
+ getProductList({
|
|
|
|
+ productCategoryName: "",
|
|
|
|
+ productCategoryNumber: "",
|
|
|
|
+ }).then((res) => {
|
|
|
|
+ this.productList = res.data;
|
|
|
|
+ });
|
|
},
|
|
},
|
|
hanleDatele(id) {
|
|
hanleDatele(id) {
|
|
this.hanleDeleteAllPromise(id).then((ids) => {
|
|
this.hanleDeleteAllPromise(id).then((ids) => {
|
|
@@ -331,25 +360,22 @@ export default {
|
|
this.type = 3;
|
|
this.type = 3;
|
|
},
|
|
},
|
|
handelInfo() {
|
|
handelInfo() {
|
|
-
|
|
|
|
if (this.type == 1) {
|
|
if (this.type == 1) {
|
|
- this.$refs.dialogForm.validate((valid) => {
|
|
|
|
|
|
+ this.$refs.dialogForm.validate((valid) => {
|
|
if (valid) {
|
|
if (valid) {
|
|
- const params = {
|
|
|
|
- ...this.dialogForm,
|
|
|
|
- };
|
|
|
|
- addData(params).then((res) => {
|
|
|
|
- console.log(res);
|
|
|
|
- this.$successMsg("添加成功");
|
|
|
|
- this.hanleReset();
|
|
|
|
-
|
|
|
|
- });
|
|
|
|
|
|
+ const params = {
|
|
|
|
+ ...this.dialogForm,
|
|
|
|
+ };
|
|
|
|
+ addData(params).then((res) => {
|
|
|
|
+ console.log(res);
|
|
|
|
+ this.$successMsg("添加成功");
|
|
|
|
+ this.hanleReset();
|
|
|
|
+ });
|
|
} else {
|
|
} else {
|
|
- console.log('error submit!!');
|
|
|
|
|
|
+ console.log("error submit!!");
|
|
return false;
|
|
return false;
|
|
}
|
|
}
|
|
});
|
|
});
|
|
-
|
|
|
|
} else if (this.type == 0) {
|
|
} else if (this.type == 0) {
|
|
const upParams = {
|
|
const upParams = {
|
|
...this.dialogForm,
|
|
...this.dialogForm,
|
|
@@ -358,18 +384,15 @@ export default {
|
|
this.$successMsg("修改成功");
|
|
this.$successMsg("修改成功");
|
|
|
|
|
|
this.hanleReset();
|
|
this.hanleReset();
|
|
-
|
|
|
|
});
|
|
});
|
|
} else {
|
|
} else {
|
|
this.dialogVisible = false;
|
|
this.dialogVisible = false;
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- resetForm(formName) {
|
|
|
|
- this.$refs.dialogForm.resetFields();
|
|
|
|
-
|
|
|
|
|
|
+ resetForm(formName) {
|
|
|
|
+ this.$refs.dialogForm.resetFields();
|
|
},
|
|
},
|
|
hanleReset() {
|
|
hanleReset() {
|
|
-
|
|
|
|
this.dialogForm = {
|
|
this.dialogForm = {
|
|
id: "",
|
|
id: "",
|
|
saleCode: "",
|
|
saleCode: "",
|