|
@@ -10,13 +10,13 @@
|
|
|
append-to-body
|
|
|
@close="onClose">
|
|
|
<div class="drawer__panel">
|
|
|
- <div class="flex-align-center flex-between ">
|
|
|
- <div class="flex-align-center" style="margin-top:-10px;margin-bottom: 10px">
|
|
|
+ <div class="flex-align-center flex-between " >
|
|
|
+ <div class="flex-align-center" style="margin-top:-10px;margin-bottom: 10px;float: left">
|
|
|
<el-input size="small" suffix-icon="el-icon-search" v-model="params.content.where.condition" placeholder="产品名称,编号" @keyup.enter.native="listData(params.content.pageNumber = 1)" @clear="listData(params.content.pageNumber = 1)" clearable></el-input>
|
|
|
</div>
|
|
|
-<!-- <div>
|
|
|
- <el-button style="float: right" type="primary" size="mini">批量添加</el-button>
|
|
|
- </div>-->
|
|
|
+ <div style="margin-top:-10px;margin-bottom: 10px;float: right">
|
|
|
+ <el-button style="float: right" type="primary" size="mini" @click="onSubmit" :disabled="tableSelectData.length === 0 ">批量添加</el-button>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
<div class="produtMag-panel">
|
|
|
<el-table
|
|
@@ -57,14 +57,6 @@
|
|
|
<p><span>{{scope.row.model}}</span> / <span>{{scope.row.spec}}</span></p>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
-<!-- <el-table-column
|
|
|
- prop="unitid"
|
|
|
- label="起订量/增量"
|
|
|
- width="150">
|
|
|
- <template slot-scope="scope">
|
|
|
- <p><span>{{scope.row.orderminqty}}</span> / <span>{{scope.row.orderaddqty}}</span></p>
|
|
|
- </template>
|
|
|
- </el-table-column>-->
|
|
|
<el-table-column
|
|
|
prop="caliber"
|
|
|
label="口径"
|
|
@@ -131,33 +123,37 @@
|
|
|
<span>{{scope.row.totalPrice}}</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
-<!-- <el-table-column
|
|
|
- prop=""
|
|
|
+ <el-table-column
|
|
|
+ prop="totalPrice"
|
|
|
fixed="right"
|
|
|
label="操作"
|
|
|
width="80">
|
|
|
<template slot-scope="scope">
|
|
|
- <el-button type="text">添 加</el-button>
|
|
|
+ <el-button type="text" @click="onSelect(scope.row)">添 加</el-button>
|
|
|
</template>
|
|
|
- </el-table-column>-->
|
|
|
+ </el-table-column>
|
|
|
</el-table>
|
|
|
- <div style="margin-top:16px;text-align:right">
|
|
|
- <el-pagination
|
|
|
- background
|
|
|
- small
|
|
|
- @size-change="handleSizeChange"
|
|
|
- @current-change="handleCurrentChange"
|
|
|
- :current-page="currentPage"
|
|
|
- :page-size="params.content.pageSize"
|
|
|
- layout="total, prev, pager, next, jumper"
|
|
|
- :total="total">
|
|
|
- </el-pagination>
|
|
|
+ <div>
|
|
|
+ <div style="float: left">已选:{{selectTotal}}个商品</div>
|
|
|
+ <div style="margin-top:16px;text-align:right">
|
|
|
+ <el-pagination
|
|
|
+ background
|
|
|
+ small
|
|
|
+ @size-change="handleSizeChange"
|
|
|
+ @current-change="handleCurrentChange"
|
|
|
+ :current-page="currentPage"
|
|
|
+ :page-size="params.content.pageSize"
|
|
|
+ layout="total, prev, pager, next, jumper"
|
|
|
+ :total="total">
|
|
|
+ </el-pagination>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
+
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="fixed__btn__panel">
|
|
|
<el-button size="small" @click="onClose" class="normal-btn-width">取 消</el-button>
|
|
|
- <el-button size="small" type="primary" @click="onSubmit" :disabled="tableSelectData.length === 0 " class="normal-btn-width">确 定</el-button>
|
|
|
+<!-- <el-button size="small" type="primary" @click="onSubmit" :disabled="tableSelectData.length === 0 " class="normal-btn-width">确 定</el-button>-->
|
|
|
</div>
|
|
|
</el-drawer>
|
|
|
</div>
|
|
@@ -198,7 +194,8 @@ export default {
|
|
|
tableSelectData:[],
|
|
|
tableData: [],
|
|
|
total:0,
|
|
|
- currentPage:0
|
|
|
+ currentPage:0,
|
|
|
+ selectTotal:0
|
|
|
}
|
|
|
},
|
|
|
|
|
@@ -212,8 +209,9 @@ export default {
|
|
|
},
|
|
|
})
|
|
|
this.tool.showMessage(res,()=>{
|
|
|
- this.dialogFormVisible = false
|
|
|
this.$emit('addSuccess')
|
|
|
+ this.listData()
|
|
|
+ this.selectData()
|
|
|
})
|
|
|
/*this.tableSelectData = []*/
|
|
|
/*this.$refs['form'].validate(async (valid) => {
|
|
@@ -231,6 +229,13 @@ export default {
|
|
|
})
|
|
|
})*/
|
|
|
},
|
|
|
+ onSelect(val){
|
|
|
+ console.log(val,"选择的商品")
|
|
|
+ this.tableSelectData = []
|
|
|
+ this.tableSelectData[0] = val
|
|
|
+ console.log(this.tableSelectData)
|
|
|
+ this.onSubmit()
|
|
|
+ },
|
|
|
onClose(){
|
|
|
this.dialogFormVisible = false
|
|
|
this.tableSelectData = []
|
|
@@ -238,6 +243,7 @@ export default {
|
|
|
onShow(){
|
|
|
this.dialogFormVisible = true
|
|
|
this.listData()
|
|
|
+ this.selectData()
|
|
|
},
|
|
|
async listData () {
|
|
|
this.params.content.sa_projectid = this.$route.query.id
|
|
@@ -275,6 +281,22 @@ export default {
|
|
|
},
|
|
|
clearSelection () {
|
|
|
this.$refs.multipleTable.clearSelection();
|
|
|
+ },
|
|
|
+ /*已选产品数据*/
|
|
|
+ async selectData(){
|
|
|
+ const res = await this.$api.requested({
|
|
|
+ "id": 20221021145702,
|
|
|
+ "content": {
|
|
|
+ "sa_projectid": this.$route.query.id,
|
|
|
+ "pageNumber": 1,
|
|
|
+ "pageSize": 20,
|
|
|
+ "where": {
|
|
|
+ "condition": ""
|
|
|
+ }
|
|
|
+ },
|
|
|
+ })
|
|
|
+ this.selectTotal = res.total
|
|
|
+ console.log(res.total,"已选产品数量")
|
|
|
}
|
|
|
},
|
|
|
/*mounted() {
|