|
@@ -1,11 +1,61 @@
|
|
|
<template>
|
|
|
<div>
|
|
|
<el-button type="primary" size="small" :disabled="disabled" @click="addBtn">添 加</el-button>
|
|
|
+
|
|
|
+ <el-dialog append-to-body title="选择报价单" :visible.sync="drawer2" width="70%">
|
|
|
+ <div class="inline-16" style="margin-bottom:10px">
|
|
|
+ <el-input suffix-icon="el-icon-search" size="small" v-model="params2.content.where.condition" placeholder="产品名称,编号" @keyup.enter.native="getQuotationList(params2.content.pageNumber = 1)" @clear="getQuotationList(params2.content.pageNumber = 1)" clearable></el-input>
|
|
|
+ </div>
|
|
|
+ <el-table
|
|
|
+ :data="ENlist"
|
|
|
+ stripe
|
|
|
+ style="width: 100%"
|
|
|
+ height="300"
|
|
|
+ border>
|
|
|
+ <el-table-column
|
|
|
+ prop="billno"
|
|
|
+ label="单号"
|
|
|
+ width="180">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="submitby"
|
|
|
+ label="提交人"
|
|
|
+ width="180">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="submitdate"
|
|
|
+ label="提交时间">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column>
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-button size="mini" type="text" @click="rowClick(scope.row)">选 择</el-button>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ <div style="display:flex;justify-content:space-between;margin-top:16px;">
|
|
|
+ <div style="text-align:left">
|
|
|
+ <el-pagination
|
|
|
+ background
|
|
|
+ small
|
|
|
+ @size-change="handleSizeChange2"
|
|
|
+ @current-change="handleCurrentChange2"
|
|
|
+ :current-page="params2.content.pageNumber"
|
|
|
+ :page-size="params2.content.pageSize"
|
|
|
+ layout="total, prev, pager, next"
|
|
|
+ :total="total2">
|
|
|
+ </el-pagination>
|
|
|
+ </div>
|
|
|
+ <el-button size="mini" @click="cancel()">取消</el-button>
|
|
|
+ </div>
|
|
|
+
|
|
|
+
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
<el-drawer append-to-body size="80%" :with-header="false" :visible.sync="drawer">
|
|
|
<div class="container">
|
|
|
<p class="normal-title normal-margin">产品清单</p>
|
|
|
<el-input size="small" style="width:200px;margin-bottom:10px" v-model="params.content.where.condition" placeholder="输入搜索内容" @clear="getProductList(params.content.pageNumber = 1)" @keyup.native.enter="getProductList(params.content.pageNumber = 1)" clearable></el-input>
|
|
|
- <Table ref="table" v-model="itemno" :layout="tablecols" :data="productList" :custom="true" height="500px" @upDateData="upDateData">
|
|
|
+ <Table @selectArr="selectArr" ref="table" fixedName="operation" v-model="itemno" :layout="tablecols" :data="productList" :custom="true" height="500px" @upDateData="upDateData">
|
|
|
<template v-slot:customcol="scope">
|
|
|
<div v-if="scope.column.columnname == 'attinfos'">
|
|
|
<previewImage
|
|
@@ -21,26 +71,30 @@
|
|
|
{{scope.column.data[scope.column.columnname][0] && scope.column.data[scope.column.columnname][0].brandname}}
|
|
|
</div>
|
|
|
<div v-else>{{scope.column.data[scope.column.columnname]}}</div>
|
|
|
- <span v-if="!scope.column.data[scope.column.columnname] && scope.column.data[scope.column.columnname] !== 0">--</span>
|
|
|
+ <span v-if="!scope.column.data[scope.column.columnname] && scope.column.data[scope.column.columnname] !== 0 && scope.column.columnname != 'operation'">--</span>
|
|
|
+ </template>
|
|
|
+ <template v-slot:opreation="scope">
|
|
|
+ <el-button type="text" size="mini" @click="addProduct(scope.data)">添 加</el-button>
|
|
|
</template>
|
|
|
</Table>
|
|
|
- <div class="container normal-panel" style="text-align:right">
|
|
|
+ <div style="display:flex;justify-content:space-between;align-items:center;margin-top:10px">
|
|
|
+ <span>已添加产品数:{{addProductLength}}</span>
|
|
|
<el-pagination
|
|
|
- style="text-align:right"
|
|
|
+ style="display:inline-block"
|
|
|
background
|
|
|
small
|
|
|
@size-change="handleSizeChange"
|
|
|
@current-change="handleCurrentChange"
|
|
|
:current-page="params.content.pageNumber"
|
|
|
:page-sizes="[20, 50, 100, 200]"
|
|
|
- layout="total,sizes, prev, pager, next, jumper"
|
|
|
+ layout="total, prev, pager, next, jumper"
|
|
|
:total="total">
|
|
|
</el-pagination>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="fixed__btn__panel">
|
|
|
<el-button size="small" @click="drawer = false">取 消</el-button>
|
|
|
- <el-button type="primary" size="small" @click="onSumit">确 定</el-button>
|
|
|
+ <el-button type="primary" size="small" :disabled="selectProductLength == 0" @click="onSumit">批 量 添 加</el-button>
|
|
|
</div>
|
|
|
</el-drawer>
|
|
|
</div>
|
|
@@ -50,28 +104,47 @@
|
|
|
import Table from '@/HDrpManagement/ProductGroupMag/modules/table'
|
|
|
import previewImage from '@/components/previewImage/index'
|
|
|
export default {
|
|
|
- props:['disabled'],
|
|
|
+ props:['disabled','data'],
|
|
|
name: '',
|
|
|
components:{Table,previewImage},
|
|
|
data() {
|
|
|
return {
|
|
|
drawer:false,
|
|
|
+ drawer2:false,
|
|
|
form:{
|
|
|
qty:'',
|
|
|
discountrate:'',
|
|
|
price:'',
|
|
|
|
|
|
},
|
|
|
+ currentQuotation:'',
|
|
|
+ selectProductLength:0,
|
|
|
+ addProductLength:0,
|
|
|
tablecols:[],
|
|
|
productList:[],
|
|
|
itemno:'',
|
|
|
total:0,
|
|
|
+ total2:0,
|
|
|
+ ENlist:[],
|
|
|
params: {
|
|
|
"id": 20221123162902,
|
|
|
"content": {
|
|
|
"sa_contractid": '',
|
|
|
"pageNumber": 1,
|
|
|
"pageSize": 20,
|
|
|
+ "nocache":true,
|
|
|
+ "where": {
|
|
|
+ "condition": ""
|
|
|
+ }
|
|
|
+ },
|
|
|
+ },
|
|
|
+ params2: {
|
|
|
+ "id": 20221123162902,
|
|
|
+ "content": {
|
|
|
+ "sa_contractid": '',
|
|
|
+ "pageNumber": 1,
|
|
|
+ "pageSize": 20,
|
|
|
+ "nocache":true,
|
|
|
"where": {
|
|
|
"condition": ""
|
|
|
}
|
|
@@ -83,22 +156,61 @@ export default {
|
|
|
},
|
|
|
watch:{
|
|
|
},
|
|
|
+ updated () {
|
|
|
+ setTimeout(() => {
|
|
|
+ this.addProductLength = this.$parent.list.length
|
|
|
+ },300)
|
|
|
+ },
|
|
|
created () {
|
|
|
this.tablecols = this.tool.tabelCol(this.$route.name)['productTable'].tablecols
|
|
|
},
|
|
|
methods: {
|
|
|
- addBtn () {
|
|
|
+ cancel () {
|
|
|
+ this.drawer2=false
|
|
|
+ },
|
|
|
+ rowClick (data) {
|
|
|
+ console.log(data);
|
|
|
this.drawer = true
|
|
|
- this.getProductList()
|
|
|
+ this.drawer2 = false
|
|
|
+ this.currentQuotation = data
|
|
|
+ this.getProductList(data)
|
|
|
+ },
|
|
|
+ addBtn () {
|
|
|
+ this.drawer2 = true
|
|
|
+ this.getQuotationList()
|
|
|
},
|
|
|
- async getProductList () {
|
|
|
+ async getProductList (data) {
|
|
|
this.params.content.sa_contractid = this.$route.query.id
|
|
|
+ this.params.content.sa_quotedpriceid = this.currentQuotation.sa_quotedpriceid
|
|
|
+
|
|
|
let res = await this.$api.requested(this.params)
|
|
|
this.productList = res.data
|
|
|
this.total = res.total
|
|
|
console.log(this.productList);
|
|
|
|
|
|
},
|
|
|
+ selectArr (data) {
|
|
|
+ this.selectProductLength = data.length
|
|
|
+ },
|
|
|
+ async addProduct (data) {
|
|
|
+ let res = await this.$api.requested({
|
|
|
+ "id": 20221123164402,
|
|
|
+ "content": {
|
|
|
+ "sa_contractid": this.$route.query.id,
|
|
|
+ "items": [
|
|
|
+ {
|
|
|
+ "itemid": data.itemid,
|
|
|
+ "price": '0',
|
|
|
+ "qty": '0'
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ })
|
|
|
+ this.tool.showMessage(res,() => {
|
|
|
+ this.getProductList()
|
|
|
+ this.$emit('onSuccess')
|
|
|
+ })
|
|
|
+ },
|
|
|
async onSumit () {
|
|
|
console.log(this.$refs.table.allArr);
|
|
|
let item = this.$refs.table.allArr.map(item => {
|
|
@@ -118,11 +230,29 @@ export default {
|
|
|
this.tool.showMessage(res,() => {
|
|
|
this.drawer = false
|
|
|
this.$emit('onSuccess')
|
|
|
+ this.$refs.table.allArr = []
|
|
|
})
|
|
|
},
|
|
|
upDateData (data) {
|
|
|
console.log(data);
|
|
|
|
|
|
+ },
|
|
|
+ async getQuotationList () {
|
|
|
+ let res = await this.$api.requested({
|
|
|
+ "id": 20221222151302,
|
|
|
+ "content": {
|
|
|
+ "sa_projectid": this.data.sa_projectid,
|
|
|
+ "pageNumber": 1,
|
|
|
+ "pageSize": 20,
|
|
|
+ "where": {
|
|
|
+ "condition": ""
|
|
|
+ }
|
|
|
+ },
|
|
|
+ })
|
|
|
+ this.ENlist = res.data
|
|
|
+ this.total2 = res.total
|
|
|
+ console.log(this.ENlist,'报价单数据');
|
|
|
+
|
|
|
},
|
|
|
handleSizeChange(val) {
|
|
|
// console.log(`每页 ${val} 条`);
|
|
@@ -132,6 +262,14 @@ export default {
|
|
|
// console.log(`当前页: ${val}`);
|
|
|
this.params.content.pageNumber = val
|
|
|
},
|
|
|
+ handleSizeChange2(val) {
|
|
|
+ // console.log(`每页 ${val} 条`);
|
|
|
+ this.params2.content.pageSize = val
|
|
|
+ },
|
|
|
+ handleCurrentChange2(val) {
|
|
|
+ // console.log(`当前页: ${val}`);
|
|
|
+ this.params2.content.pageNumber = val
|
|
|
+ },
|
|
|
},
|
|
|
};
|
|
|
</script>
|