|
@@ -32,6 +32,7 @@
|
|
|
<el-table
|
|
|
ref="multipleTable"
|
|
|
:data="tableData"
|
|
|
+ row-key="goodsId"
|
|
|
border
|
|
|
:header-cell-style="{
|
|
|
'background-color': '#eee',
|
|
@@ -39,16 +40,12 @@
|
|
|
color: '#333',
|
|
|
}"
|
|
|
>
|
|
|
- <el-table-column label="" width="45" align="center">
|
|
|
- <template scope="scope">
|
|
|
- <el-radio
|
|
|
- :disabled="scope.row.selectStatus === 0"
|
|
|
- :label="scope.row.goodsId"
|
|
|
- v-model="activeObj.makeGoodsId"
|
|
|
- @change.native="getGoodsId(scope.row)"
|
|
|
- >{{ "" }}</el-radio
|
|
|
- >
|
|
|
- </template>
|
|
|
+ <el-table-column
|
|
|
+ type="selection"
|
|
|
+ width="55"
|
|
|
+ :reserve-selection="true"
|
|
|
+ :selectable="selectableFunc"
|
|
|
+ >
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
v-for="(item, index) in tableSet"
|
|
@@ -83,10 +80,7 @@
|
|
|
/>
|
|
|
<span slot="footer" class="dialog-footer">
|
|
|
<el-button @click="dialogVisibleTableBoxs = false">取 消</el-button>
|
|
|
- <el-button
|
|
|
- type="primary"
|
|
|
- :disabled="!activeObj.makeGoodsId"
|
|
|
- @click="submitTab"
|
|
|
+ <el-button type="primary" @click="submitTab" :loading="loading"
|
|
|
>确 定</el-button
|
|
|
>
|
|
|
</span>
|
|
@@ -100,6 +94,7 @@ export default {
|
|
|
components: { pagination },
|
|
|
data() {
|
|
|
return {
|
|
|
+ loading: false,
|
|
|
size: "small",
|
|
|
dialogVisibleTableBoxs: false,
|
|
|
tableData: [],
|
|
@@ -141,33 +136,27 @@ export default {
|
|
|
],
|
|
|
formData: {},
|
|
|
total: 0,
|
|
|
- activeObj: {
|
|
|
- makeGoodsId: "",
|
|
|
- makeGoodsName: "",
|
|
|
- makeGoodsCode: "",
|
|
|
- },
|
|
|
+ activeArray: [],
|
|
|
};
|
|
|
},
|
|
|
methods: {
|
|
|
- /**
|
|
|
- * 选中补考/前培商品
|
|
|
- */
|
|
|
- getGoodsId(row) {
|
|
|
- this.activeObj = {
|
|
|
- makeGoodsId: row.goodsId,
|
|
|
- makeGoodsName: row.goodsName,
|
|
|
- makeGoodsCode: row.code,
|
|
|
- };
|
|
|
+ /**是否允许选中 */
|
|
|
+ selectableFunc(row) {
|
|
|
+ return !this.activeArray.includes(row.goodsId);
|
|
|
},
|
|
|
/**
|
|
|
* 初始
|
|
|
*/
|
|
|
openBox(obj, active) {
|
|
|
- this.activeObj = JSON.parse(JSON.stringify(active));
|
|
|
+ this.activeArray = JSON.parse(JSON.stringify(active)) || [];
|
|
|
this.formData = JSON.parse(JSON.stringify(obj));
|
|
|
//获取业务层次-课程
|
|
|
this.getInfos();
|
|
|
this.dialogVisibleTableBoxs = true;
|
|
|
+ this.loading = false;
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$refs.multipleTable.clearSelection();
|
|
|
+ });
|
|
|
},
|
|
|
/**
|
|
|
* 搜索数据
|
|
@@ -191,9 +180,20 @@ export default {
|
|
|
* 提交回调数据
|
|
|
*/
|
|
|
submitTab() {
|
|
|
- this.$message.success("添加成功");
|
|
|
+ this.loading = true;
|
|
|
+ let ary = [];
|
|
|
+ if (this.$refs.multipleTable.selection.length > 0) {
|
|
|
+ ary = this.$refs.multipleTable.selection.map((i) => {
|
|
|
+ return {
|
|
|
+ makeGoodsCode: i.code,
|
|
|
+ makeGoodsId: i.goodsId,
|
|
|
+ makeGoodsName: i.goodsName,
|
|
|
+ };
|
|
|
+ });
|
|
|
+ this.$message.success("添加成功");
|
|
|
+ this.$emit("backData", ary);
|
|
|
+ }
|
|
|
this.dialogVisibleTableBoxs = false;
|
|
|
- this.$emit("backData", this.activeObj);
|
|
|
},
|
|
|
handleSizeChange(v) {
|
|
|
this.formData.pageSize = v;
|
|
@@ -208,5 +208,4 @@ export default {
|
|
|
};
|
|
|
</script>
|
|
|
|
|
|
-<style lang="less" scoped>
|
|
|
-</style>
|
|
|
+<style lang="less" scoped></style>
|