|
@@ -7,48 +7,26 @@
|
|
|
@close="onClose"
|
|
|
>
|
|
|
<div>
|
|
|
- <el-table
|
|
|
- ref="multipleTable"
|
|
|
- :data="productsList"
|
|
|
- tooltip-effect="dark"
|
|
|
- style="width: 100%"
|
|
|
- @selection-change="handleSelectionChange"
|
|
|
- >
|
|
|
- <el-table-column
|
|
|
- type="selection"
|
|
|
- width="55">
|
|
|
- </el-table-column>
|
|
|
- <el-table-column
|
|
|
- label="商品名称"
|
|
|
- width="260">
|
|
|
- <template slot-scope="scope">{{ scope.row.itemname }}</template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column
|
|
|
- label="商品编号"
|
|
|
- width="260">
|
|
|
- <template slot-scope="scope">{{ scope.row.itemno }}</template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column
|
|
|
- label="商品型号"
|
|
|
- width="260">
|
|
|
- <template slot-scope="scope">{{ scope.row.model }}</template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column
|
|
|
- label="商品规格"
|
|
|
- >
|
|
|
- <template slot-scope="scope">{{ scope.row.spec }}</template>
|
|
|
- </el-table-column>
|
|
|
- </el-table>
|
|
|
- <div style="margin-top: 20px">
|
|
|
- <el-button type="primary" @click="onSubmit">确定</el-button>
|
|
|
- <el-button @click="toggleSelection()">取消选择</el-button>
|
|
|
- </div>
|
|
|
+<!-- <table_list :layout="tablecols" :opwidth="200" :data="productsList" :custom="true" :height="tableHieght" :checkbox="true">-->
|
|
|
+<!-- <template v-slot:customcol="scope">-->
|
|
|
+<!-- <p >{{scope.column.data[scope.column.columnname]}}</p>-->
|
|
|
+<!-- </template>-->
|
|
|
+<!-- </table_list>-->
|
|
|
+ <tablelayout :layout="tablecols" :data="productsList" :custom="true" :checkbox="true" height="calc(100vh - 452px)" @checkboxCallBack="checkboxCallBack">
|
|
|
+ <template v-slot:customcol="scope">
|
|
|
+ <div v-if="scope.column.columnname === 'province'">
|
|
|
+ <span>{{scope.column.data.province}} - {{scope.column.data.city}} - {{scope.column.data.county}}</span>
|
|
|
+ </div>
|
|
|
+ <p v-else>{{scope.column.data[scope.column.columnname]}}</p>
|
|
|
+ </template>
|
|
|
+ </tablelayout>
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+import tablelayout from '@/components/table/index2'
|
|
|
export default {
|
|
|
name: "add",
|
|
|
props:["plm_technicalinfoid"],
|
|
@@ -66,21 +44,29 @@ export default {
|
|
|
},
|
|
|
productsList:[],
|
|
|
multipleSelection: [],
|
|
|
+ tablecols:[],
|
|
|
+ tableHieght:420
|
|
|
}
|
|
|
},
|
|
|
+ components:{
|
|
|
+ tablelayout
|
|
|
+ },
|
|
|
mounted() {
|
|
|
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ this.tablecols = this.tool.tabelCol(this.$route.name).relationProductTable.tablecols
|
|
|
},
|
|
|
methods: {
|
|
|
onShow(){
|
|
|
this.drawer = true
|
|
|
- this.queryProducts()
|
|
|
+ this.productsData()
|
|
|
},
|
|
|
onClose(){
|
|
|
this.drawer = false
|
|
|
this.form.itemid=''
|
|
|
},
|
|
|
- async queryProducts(){
|
|
|
+ async productsData(){
|
|
|
const res = await this.$api.requested({
|
|
|
"id": 20220923140602,
|
|
|
"content": {
|
|
@@ -92,15 +78,16 @@ export default {
|
|
|
console.log(res)
|
|
|
this.productsList = res.data
|
|
|
},
|
|
|
- toggleSelection(rows) {
|
|
|
- if (rows) {
|
|
|
- rows.forEach(row => {
|
|
|
- this.$refs.multipleTable.toggleRowSelection(row);
|
|
|
- });
|
|
|
- } else {
|
|
|
- this.$refs.multipleTable.clearSelection();
|
|
|
- }
|
|
|
- },
|
|
|
+ // toggleSelection(rows) {
|
|
|
+ // if (rows) {
|
|
|
+ // rows.forEach(row => {
|
|
|
+ // this.$refs.multipleTable.toggleRowSelection(row);
|
|
|
+ // });
|
|
|
+ // } else {
|
|
|
+ // this.$refs.multipleTable.clearSelection();
|
|
|
+ // }
|
|
|
+ // },
|
|
|
+
|
|
|
handleSelectionChange(val) {
|
|
|
this.multipleSelection = val;
|
|
|
},
|