|
@@ -69,6 +69,20 @@
|
|
|
placeholder="商品编号/货号/商品名称"
|
|
|
></el-input>
|
|
|
</el-form-item>
|
|
|
+ <el-form-item prop="organId">
|
|
|
+ <el-select
|
|
|
+ v-model.trim="searchForm.organId"
|
|
|
+ clearable
|
|
|
+ placeholder="所属分部"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in selects.branchs"
|
|
|
+ :key="item.id"
|
|
|
+ :label="item.name"
|
|
|
+ :value="item.id.toString()"
|
|
|
+ ></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
<el-form-item prop="type">
|
|
|
<el-select
|
|
|
v-model.trim="searchForm.type"
|
|
@@ -415,6 +429,21 @@
|
|
|
placeholder="请输入品牌"
|
|
|
></el-input>
|
|
|
</el-form-item>
|
|
|
+ <el-form-item label="所属分部" :label-width="formLabelWidth" prop="organIdList">
|
|
|
+ <select-all v-model.trim="form.organIdList"
|
|
|
+ filterable
|
|
|
+ placeholder="请选择所属分部"
|
|
|
+ style="width: 100% !important"
|
|
|
+ multiple
|
|
|
+ :disabled="addDisabled || addType == 'update'"
|
|
|
+ @change="onOrganChange"
|
|
|
+ clearable>
|
|
|
+ <el-option v-for="item in selects.branchs"
|
|
|
+ :key="item.id"
|
|
|
+ :label="item.name"
|
|
|
+ :value="item.id.toString()"></el-option>
|
|
|
+ </select-all>
|
|
|
+ </el-form-item>
|
|
|
<el-form-item
|
|
|
label="商品类型"
|
|
|
prop="type"
|
|
@@ -482,7 +511,7 @@
|
|
|
@change="onGoodsChange"
|
|
|
filterable
|
|
|
style=" width: 100% !important"
|
|
|
- :disabled="addDisabled"
|
|
|
+ :disabled="addDisabled || form.organIdList.length <= 0"
|
|
|
placeholder="请选择商品"
|
|
|
>
|
|
|
<el-option
|
|
@@ -494,7 +523,7 @@
|
|
|
></el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
- <div v-if="!addDisabled" style="display: inline-block">
|
|
|
+ <div v-if="!addDisabled && form.organIdList.length > 0" style="display: inline-block">
|
|
|
<el-button
|
|
|
icon="el-icon-minus"
|
|
|
v-if="form.goodsList.length > 1"
|
|
@@ -724,6 +753,7 @@ export default {
|
|
|
searchForm: {
|
|
|
search: null,
|
|
|
groupGoods: null,
|
|
|
+ organId: null,
|
|
|
type: null,
|
|
|
status: null,
|
|
|
goodsCategoryId: null,
|
|
@@ -764,6 +794,7 @@ export default {
|
|
|
supplyChannel: null,
|
|
|
name: null,
|
|
|
type: null,
|
|
|
+ organIdList: [],
|
|
|
goodsCategoryId: null,
|
|
|
specification: null,
|
|
|
marketPrice: null,
|
|
@@ -834,6 +865,13 @@ export default {
|
|
|
trigger: "change",
|
|
|
},
|
|
|
],
|
|
|
+ organIdList: [
|
|
|
+ {
|
|
|
+ required: true,
|
|
|
+ message: "请选择所属分部",
|
|
|
+ trigger: "change",
|
|
|
+ },
|
|
|
+ ],
|
|
|
goodsCategoryId: [
|
|
|
{
|
|
|
required: true,
|
|
@@ -939,6 +977,8 @@ export default {
|
|
|
};
|
|
|
},
|
|
|
mounted() {
|
|
|
+ // 获取分部
|
|
|
+ this.$store.dispatch("setBranchs");
|
|
|
this.init();
|
|
|
},
|
|
|
methods: {
|
|
@@ -1037,12 +1077,13 @@ export default {
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
- getAllGoodsList() {
|
|
|
+ getAllGoodsList(organId) {
|
|
|
// 获取所有商品
|
|
|
goodsQuery({
|
|
|
rows: 9999,
|
|
|
page: 1,
|
|
|
groupGoods: 0,
|
|
|
+ organId,
|
|
|
status: 1,
|
|
|
}).then((res) => {
|
|
|
if (res.code == 200 && res.data) {
|
|
@@ -1074,6 +1115,7 @@ export default {
|
|
|
clientShow: null,
|
|
|
educationalShow: null,
|
|
|
musicGroupShow: null,
|
|
|
+ organIdList: [],
|
|
|
courseViewType: [],
|
|
|
stockWarning: null,
|
|
|
image: null,
|
|
@@ -1094,8 +1136,12 @@ export default {
|
|
|
if (this.$refs["ruleForm"]) {
|
|
|
this.$refs["ruleForm"].resetFields();
|
|
|
}
|
|
|
- // 获取所有商品
|
|
|
- this.getAllGoodsList();
|
|
|
+ },
|
|
|
+ onOrganChange(val) {
|
|
|
+ if(val && val.length > 0) {
|
|
|
+ // 获取所有商品
|
|
|
+ this.getAllGoodsList(val.join(','));
|
|
|
+ }
|
|
|
},
|
|
|
onValidGoodsStatus() {
|
|
|
// 更新商品选择状态
|
|
@@ -1144,8 +1190,12 @@ export default {
|
|
|
form.courseViewType = row.courseViewType.split(',')
|
|
|
}
|
|
|
|
|
|
+ if(row.organIdList) {
|
|
|
+ form.organIdList = row.organIdList.split(',')
|
|
|
+ this.getAllGoodsList(row.organIdList);
|
|
|
+ }
|
|
|
+
|
|
|
this.onValidGoodsStatus();
|
|
|
- this.getAllGoodsList();
|
|
|
} else {
|
|
|
let pageTitle = "添加";
|
|
|
if (type == "update") {
|
|
@@ -1268,6 +1318,7 @@ export default {
|
|
|
});
|
|
|
form.complementGoodsIdList = tempIds.join(",");
|
|
|
form.courseViewType = form.courseViewType.join(',')
|
|
|
+ form.organIdList = form.courseViewType.join(',')
|
|
|
form.goodsList = null;
|
|
|
if (this.addType == "create" || this.addType == "copy") {
|
|
|
if (this.form.id) {
|