|
|
@@ -1,23 +1,31 @@
|
|
|
<template>
|
|
|
<div>
|
|
|
<el-button type="primary" size="small" :disabled="disabled" @click="addBtn">添 加</el-button>
|
|
|
- <el-drawer append-to-body size="80%" :with-header="false" :visible.sync="drawer">
|
|
|
- <div class="container">
|
|
|
+ <el-drawer append-to-body size="80%" :with-header="false" :visible.sync="drawer" @close="onClose">
|
|
|
+ <div class="container ">
|
|
|
<p class="normal-title normal-margin">产品类别</p>
|
|
|
- <div style="display:flex;justify-content:space-between;align-items:center">
|
|
|
- <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>
|
|
|
- <el-button type="primary" size="small" :disabled="selectProductLength == 0" @click="onSumit">批 量 添 加</el-button>
|
|
|
- </div>
|
|
|
- <Table @selectArr="selectArr" ref="table" id="itemclassid" v-model="itemno" :layout="tablecols" :data="productList" :custom="true" height="500px" @upDateData="upDateData">
|
|
|
+ <div class="drawer__panel">
|
|
|
+ <div style="margin-bottom: 10px">
|
|
|
+ <uploadAllData
|
|
|
+ style="display: inline-block !important;"
|
|
|
+ :total="total"
|
|
|
+ @handlePullApi="handlePullApi"
|
|
|
+ @handleUploadApi="handleUploadApi"
|
|
|
+ @onSuccess="onSuccess"
|
|
|
+ ></uploadAllData>
|
|
|
+ <el-button type="primary" class="inline-16" size="small" :disabled="selectProductLength == 0" @click="onSumit">批 量 添 加</el-button>
|
|
|
+ <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>
|
|
|
+ </div>
|
|
|
+ <Table :checkbox="true" @selectionChange="selectArr" ref="table" id="itemclassid" v-model="itemno" :layout="tablecols" :data="productList" :custom="true" @upDateData="upDateData">
|
|
|
<template v-slot:customcol="scope">
|
|
|
<div v-if="scope.column.columnname == 'attinfos'">
|
|
|
- <previewImage
|
|
|
- v-if="scope.column.data.attinfos[0]"
|
|
|
- style="width:38px;height:38px;margin:0px"
|
|
|
- class="image"
|
|
|
- :image="scope.column.data.attinfos[0]"
|
|
|
- :list="scope.column.data.attinfos"
|
|
|
- :deletebtn="false"
|
|
|
+ <previewImage
|
|
|
+ v-if="scope.column.data.attinfos[0]"
|
|
|
+ style="width:38px;height:38px;margin:0px"
|
|
|
+ class="image"
|
|
|
+ :image="scope.column.data.attinfos[0]"
|
|
|
+ :list="scope.column.data.attinfos"
|
|
|
+ :deletebtn="false"
|
|
|
></previewImage>
|
|
|
</div>
|
|
|
<div v-else-if="scope.column.columnname == 'brand'">
|
|
|
@@ -30,23 +38,27 @@
|
|
|
<el-button type="text" size="mini" @click="addProduct(scope.data)">添 加</el-button>
|
|
|
</template>
|
|
|
</Table>
|
|
|
- <div style="display:flex;justify-content:space-between;align-items:center;margin-top:10px">
|
|
|
-<!-- <el-pagination
|
|
|
- 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, prev, pager, next, jumper"
|
|
|
- :total="total">
|
|
|
- </el-pagination>-->
|
|
|
+ <div style="display:flex;justify-content:space-between;align-items:center;margin-top:10px">
|
|
|
+ <!-- <el-pagination
|
|
|
+ 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, prev, pager, next, jumper"
|
|
|
+ :total="total">
|
|
|
+ </el-pagination>-->
|
|
|
</div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
</div>
|
|
|
|
|
|
<div class="fixed__btn__panel">
|
|
|
- <el-button size="small" @click="drawer = false">取 消</el-button>
|
|
|
+ <el-button size="small" @click="onClose">取 消</el-button>
|
|
|
<!-- <el-button type="primary" size="small" :disabled="selectProductLength == 0" @click="onSumit">批 量 添 加</el-button>-->
|
|
|
</div>
|
|
|
</el-drawer>
|
|
|
@@ -54,12 +66,14 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import Table from './table'
|
|
|
+// import Table from './table'
|
|
|
+import Table from '@/components/table/index5'
|
|
|
import previewImage from '@/components/previewImage/index'
|
|
|
+import uploadAllData from '@/components/uploadAllData/index'
|
|
|
export default {
|
|
|
props:['disabled'],
|
|
|
name: '',
|
|
|
- components:{Table,previewImage},
|
|
|
+ components:{Table,previewImage,uploadAllData},
|
|
|
data() {
|
|
|
return {
|
|
|
drawer:false,
|
|
|
@@ -187,10 +201,10 @@ export default {
|
|
|
},
|
|
|
})
|
|
|
this.tool.showMessage(res,() => {
|
|
|
- this.drawer = false
|
|
|
+ // this.drawer = false
|
|
|
this.$emit('onSuccess')
|
|
|
+ this.getProductList()
|
|
|
this.$refs.table.allArr = []
|
|
|
-
|
|
|
})
|
|
|
},
|
|
|
upDateData (data) {
|
|
|
@@ -206,6 +220,37 @@ export default {
|
|
|
this.params.content.pageNumber = val
|
|
|
this.getProductList()
|
|
|
},
|
|
|
+ /*拉取数据*/
|
|
|
+ handlePullApi (pullApi) {
|
|
|
+ pullApi.content = JSON.parse(JSON.stringify(this.params.content))
|
|
|
+ pullApi.id = this.params.id
|
|
|
+ /*pullApi.content.sa_projectid = this.$route.query.id*/
|
|
|
+ },
|
|
|
+ /*上传数据*/
|
|
|
+ handleUploadApi (uploadApi,data) {
|
|
|
+ uploadApi.id = 20221124110202
|
|
|
+ uploadApi.content = {
|
|
|
+ "sa_contractid": this.$route.query.id, //订单ID
|
|
|
+ "items": data.map(e=>{
|
|
|
+ return {
|
|
|
+ "sa_contract_itemsaleclassid": 0,
|
|
|
+ "itemclassid": e.itemclassid,
|
|
|
+ "discountrate": e.discountrate
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ this.getProductList()
|
|
|
+ this.$emit('onSuccess')
|
|
|
+ },
|
|
|
+ onClose(){
|
|
|
+ this.drawer = false
|
|
|
+ this.params.content.where.condition = ''
|
|
|
+ this.getProductList()
|
|
|
+ this.$emit('closeDrawer')
|
|
|
+ },
|
|
|
+ onSuccess () {
|
|
|
+ this.getProductList()
|
|
|
+ },
|
|
|
},
|
|
|
};
|
|
|
</script>
|