|
|
@@ -67,7 +67,6 @@
|
|
|
<el-dialog title="修改套餐" :visible.sync="dialogEditFormVisible">
|
|
|
<el-form :model="form" label-width="250px" class="form-dialog" v-loading="dialogEditLoading">
|
|
|
|
|
|
-
|
|
|
<el-form-item label="商品名称">
|
|
|
<el-input v-model="form.goodsName"></el-input>
|
|
|
</el-form-item>
|
|
|
@@ -81,7 +80,12 @@
|
|
|
<el-input v-model="form.sellDiscount"></el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="商品类型">
|
|
|
- <el-checkbox v-for="(value,index) in GiftTypeArr" v-model="value.checked" :key="index" >{{value.name}}</el-checkbox>
|
|
|
+ <el-checkbox v-for="(value,index) in GiftTypeArr" v-model="value.checked" :key="index" v-show="(index%2)!=0">{{value.name}}</el-checkbox>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="报单类型">
|
|
|
+ <el-radio-group v-model="form.reconsumeType">
|
|
|
+ <el-radio v-for="(value,index) in GiftTypeArr" :label="index" :key="index" v-show="(index%2)==0" @click.native.prevent="reconsumeChange(index)">{{value.name}}</el-radio>
|
|
|
+ </el-radio-group>
|
|
|
</el-form-item>
|
|
|
<!-- <el-form-item label="复消购买方式">
|
|
|
<el-checkbox v-for="(value,index) in sell_type" v-model="value.checked" :key="index" >{{value.name}}</el-checkbox>
|
|
|
@@ -109,7 +113,7 @@
|
|
|
<el-form-item label="销售价格" >
|
|
|
<el-input v-model="form.sellPrice"></el-input>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="价格PV ">
|
|
|
+ <el-form-item label="价格PV">
|
|
|
<el-input v-model="form.pricePv"></el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="兑换积分" v-show="false">
|
|
|
@@ -142,8 +146,6 @@
|
|
|
</div>
|
|
|
</el-form-item>
|
|
|
|
|
|
-
|
|
|
-
|
|
|
</el-form>
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
<el-button @click="dialogEditFormVisible = false">取 消</el-button>
|
|
|
@@ -154,7 +156,6 @@
|
|
|
<el-dialog title="商品限时" :visible.sync="dialogEditFormVisibleGoodsTimes">
|
|
|
<el-form :model="form" label-width="250px" class="form-dialog" v-loading="dialogEditLoadingGoodsTimes">
|
|
|
|
|
|
-
|
|
|
<el-form-item label="是否限时">
|
|
|
<el-switch
|
|
|
v-model="form.statusdate"
|
|
|
@@ -172,8 +173,6 @@
|
|
|
popper-class='goodsdate'>
|
|
|
</el-date-picker>
|
|
|
|
|
|
-
|
|
|
-
|
|
|
</el-form-item>
|
|
|
</transition>
|
|
|
<transition name="el-zoom-in-top">
|
|
|
@@ -184,7 +183,6 @@
|
|
|
</el-form-item>
|
|
|
</transition>
|
|
|
|
|
|
-
|
|
|
</el-form>
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
<el-button @click="dialogEditFormVisibleGoodsTimes = false">取 消</el-button>
|
|
|
@@ -195,48 +193,48 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
- import network from '@/utils/network'
|
|
|
- import tool from '@/utils/tool'
|
|
|
- import baseInfo from '@/utils/baseInfo'
|
|
|
- import FilterUser from '../../components/FilterUser'
|
|
|
- import permission from '@/utils/permission'
|
|
|
- import Pagination from '@/components/Pagination'
|
|
|
- import filterHelper from '@/utils/filterHelper'
|
|
|
- import {FRONTEND_SERVER} from '@/utils/config'
|
|
|
- import store from './../../utils/vuexStore'
|
|
|
- import LeoUploader from '@/components/Uploader';
|
|
|
- export default {
|
|
|
- name: 'index',
|
|
|
- components: {FilterUser,Pagination,LeoUploader},
|
|
|
- mounted () {
|
|
|
- this.getData();
|
|
|
- // this.$refs.up_load.successImageUrl='';
|
|
|
- },
|
|
|
-
|
|
|
- data () {
|
|
|
- return {
|
|
|
- tableHeaders: null,
|
|
|
- tableData: null,
|
|
|
- loading: true,
|
|
|
- currentPage: 1,
|
|
|
- totalPages: 1,
|
|
|
- totalCount: 1,
|
|
|
- pageSize: 20,
|
|
|
- multipleSelection: [],
|
|
|
- tool: tool,
|
|
|
- permission: permission,
|
|
|
- baseDecLevels: baseInfo.decLevels(),
|
|
|
- baseEmpLevels: baseInfo.empLevels(),
|
|
|
- filterTypes: null,
|
|
|
- dialogVisible: false,
|
|
|
- dialogLoading: false,
|
|
|
- filterModel: {},
|
|
|
- value:[],
|
|
|
- selectedIds:'',
|
|
|
- dialogEditFormVisible: false,
|
|
|
- dialogEditLoading: false,
|
|
|
- dialogEditFormVisibleGoodsTimes: false,
|
|
|
- dialogEditLoadingGoodsTimes: false,
|
|
|
+import network from '@/utils/network'
|
|
|
+import tool from '@/utils/tool'
|
|
|
+import baseInfo from '@/utils/baseInfo'
|
|
|
+import FilterUser from '../../components/FilterUser'
|
|
|
+import permission from '@/utils/permission'
|
|
|
+import Pagination from '@/components/Pagination'
|
|
|
+import filterHelper from '@/utils/filterHelper'
|
|
|
+import {FRONTEND_SERVER} from '@/utils/config'
|
|
|
+import store from './../../utils/vuexStore'
|
|
|
+import LeoUploader from '@/components/Uploader'
|
|
|
+export default {
|
|
|
+ name: 'index',
|
|
|
+ components: {FilterUser,Pagination,LeoUploader},
|
|
|
+ mounted () {
|
|
|
+ this.getData()
|
|
|
+ // this.$refs.up_load.successImageUrl='';
|
|
|
+ },
|
|
|
+
|
|
|
+ data () {
|
|
|
+ return {
|
|
|
+ tableHeaders: null,
|
|
|
+ tableData: null,
|
|
|
+ loading: true,
|
|
|
+ currentPage: 1,
|
|
|
+ totalPages: 1,
|
|
|
+ totalCount: 1,
|
|
|
+ pageSize: 20,
|
|
|
+ multipleSelection: [],
|
|
|
+ tool: tool,
|
|
|
+ permission: permission,
|
|
|
+ baseDecLevels: baseInfo.decLevels(),
|
|
|
+ baseEmpLevels: baseInfo.empLevels(),
|
|
|
+ filterTypes: null,
|
|
|
+ dialogVisible: false,
|
|
|
+ dialogLoading: false,
|
|
|
+ filterModel: {},
|
|
|
+ value: [],
|
|
|
+ selectedIds: '',
|
|
|
+ dialogEditFormVisible: false,
|
|
|
+ dialogEditLoading: false,
|
|
|
+ dialogEditFormVisibleGoodsTimes: false,
|
|
|
+ dialogEditLoadingGoodsTimes: false,
|
|
|
pvSplitOptions: [
|
|
|
{
|
|
|
value: '0',
|
|
|
@@ -246,315 +244,328 @@
|
|
|
value: '1',
|
|
|
label: 'Yes'
|
|
|
}],
|
|
|
- form:{
|
|
|
- sellType:[],
|
|
|
- goodsName:'',
|
|
|
- type:'',
|
|
|
- giftType:[],
|
|
|
- goodsNo:'',
|
|
|
- unit:'',
|
|
|
- marketPrice:'',
|
|
|
- sellPrice:'',
|
|
|
- pricePv:'',
|
|
|
- point:'',
|
|
|
- storeNums:'',
|
|
|
- content:'',
|
|
|
- sort:'',
|
|
|
- discount:'',
|
|
|
- cover:'',
|
|
|
- textarea:'',
|
|
|
- sellDiscount:'',
|
|
|
+ form: {
|
|
|
+ sellType: [],
|
|
|
+ goodsName: '',
|
|
|
+ type: '',
|
|
|
+ giftType: [],
|
|
|
+ goodsNo: '',
|
|
|
+ unit: '',
|
|
|
+ marketPrice: '',
|
|
|
+ sellPrice: '',
|
|
|
+ pricePv: '',
|
|
|
+ point: '',
|
|
|
+ storeNums: '',
|
|
|
+ content: '',
|
|
|
+ sort: '',
|
|
|
+ discount: '',
|
|
|
+ cover: '',
|
|
|
+ textarea: '',
|
|
|
+ sellDiscount: '',
|
|
|
pvSplit:'',
|
|
|
- statusdate:'',
|
|
|
- goodsstatusdate:'',
|
|
|
- goodsdate:'',
|
|
|
- },
|
|
|
- submitButtonStat: false,
|
|
|
- goodsType:[],
|
|
|
- GiftTypeArr:[],
|
|
|
- sell_type:[],
|
|
|
- img_show:true
|
|
|
+ statusdate: '',
|
|
|
+ goodsstatusdate: '',
|
|
|
+ goodsdate: '',
|
|
|
+ reconsumeType: ''
|
|
|
+ },
|
|
|
+ submitButtonStat: false,
|
|
|
+ goodsType: [],
|
|
|
+ GiftTypeArr: [],
|
|
|
+ sell_type: [],
|
|
|
+ img_show: true
|
|
|
+ }
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ reconsumeChange (key) {
|
|
|
+ if(this.form.reconsumeType!=key){
|
|
|
+ this.form.reconsumeType = key
|
|
|
+ }else{
|
|
|
+ this.form.reconsumeType = null
|
|
|
+ }
|
|
|
+ },
|
|
|
+ handleSelectionChange (val) {
|
|
|
+ this.multipleSelection = val
|
|
|
+ },
|
|
|
+ handleCurrentChange (page) {
|
|
|
+ this.getData(page, this.pageSize)
|
|
|
+ },
|
|
|
+ handleSizeChange (pageSize) {
|
|
|
+ this.getData(this.currentPage, pageSize)
|
|
|
+ },
|
|
|
+ handleFilterUser (filterData) {
|
|
|
+ filterHelper.handleFilterUser(this, filterData)
|
|
|
+ },
|
|
|
+ checkSelectable (row) {
|
|
|
+ return row.DONT_DEL !== '1'
|
|
|
+ },
|
|
|
+ handleFilter () {
|
|
|
+ this.getData()
|
|
|
+ },
|
|
|
+ handlestate () {
|
|
|
+ this.$router.push({path: `/shop/goods-add`})
|
|
|
+ },
|
|
|
+ upLoadSuccess (file) {
|
|
|
+ this.form.cover = tool.getLocaleLink(file, '/files/')
|
|
|
+ this.form.coverOrigin = file
|
|
|
+ this.img_show = false
|
|
|
+ },
|
|
|
+ handleEditShow (row) {
|
|
|
+ this.dialogEditLoading = true
|
|
|
+ this.auditId = row.ID
|
|
|
+ this.dialogEditFormVisible = true
|
|
|
+ let vueObj = this
|
|
|
+ network.getData('shop/goods-edit', {id: this.auditId}).then(response => {
|
|
|
+ vueObj.dialogEditLoading = false
|
|
|
+ vueObj.goodsType = response.goodsType
|
|
|
+
|
|
|
+ let gift = response.goodsInfo.GIFT_TYPE
|
|
|
+ let gift_type = response.giftType
|
|
|
+
|
|
|
+ let giftType = []
|
|
|
+ if (gift.length > 0) {
|
|
|
+ for (let i in gift_type) {
|
|
|
+ giftType.push({key: i, name: gift_type[i].name, checked: false})
|
|
|
+ gift.map((v, k) => {
|
|
|
+ if (v == i) {
|
|
|
+ giftType[i - 1].checked = true
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ for (let j in gift){
|
|
|
+ if(gift[j]%2!=0){
|
|
|
+ vueObj.form.reconsumeType = gift[j]-1
|
|
|
}
|
|
|
- },
|
|
|
- methods: {
|
|
|
-
|
|
|
- handleSelectionChange(val) {
|
|
|
- this.multipleSelection = val
|
|
|
- },
|
|
|
- handleCurrentChange (page) {
|
|
|
- this.getData(page, this.pageSize)
|
|
|
- },
|
|
|
- handleSizeChange (pageSize) {
|
|
|
- this.getData(this.currentPage, pageSize)
|
|
|
- },
|
|
|
- handleFilterUser(filterData){
|
|
|
- filterHelper.handleFilterUser(this, filterData)
|
|
|
- },
|
|
|
- checkSelectable(row) {
|
|
|
- return row.DONT_DEL !== '1'
|
|
|
- },
|
|
|
- handleFilter() {
|
|
|
- this.getData()
|
|
|
- },
|
|
|
- handlestate(){
|
|
|
- this.$router.push({path: `/shop/goods-add`})
|
|
|
- },
|
|
|
- upLoadSuccess(file){
|
|
|
- this.form.cover = tool.getLocaleLink(file, '/files/');
|
|
|
- this.form.coverOrigin = file
|
|
|
- this.img_show=false;
|
|
|
- },
|
|
|
- handleEditShow(row) {
|
|
|
- this.dialogEditLoading = true
|
|
|
- this.auditId = row.ID
|
|
|
- this.dialogEditFormVisible = true
|
|
|
- let vueObj = this
|
|
|
- network.getData('shop/goods-edit', {id: this.auditId}).then(response => {
|
|
|
- vueObj.dialogEditLoading = false
|
|
|
- vueObj.goodsType=response.goodsType
|
|
|
-
|
|
|
- let gift=response.goodsInfo.GIFT_TYPE;
|
|
|
- let gift_type=response.giftType;
|
|
|
-
|
|
|
- let giftType=[];
|
|
|
- if(gift.length>0){
|
|
|
- for(let i in gift_type){
|
|
|
- giftType.push({key:i,name:gift_type[i].name,checked:false})
|
|
|
- gift.map((v,k)=>{
|
|
|
- if(v==i){
|
|
|
- giftType[i-1].checked=true;
|
|
|
- }
|
|
|
- })
|
|
|
- }
|
|
|
- }
|
|
|
- vueObj.GiftTypeArr=giftType
|
|
|
-
|
|
|
- let sell=response.goodsInfo.SELL_TYPE;
|
|
|
- let sell_type=response.sellType;
|
|
|
- let sellType=[];
|
|
|
- if(sell.length>0){
|
|
|
- for(let i in sell_type){
|
|
|
- sellType.push({key:i,name:sell_type[i].name,checked:false})
|
|
|
- sell.map((item,index)=>{
|
|
|
- if(item==i){
|
|
|
- sellType[i-1].checked=true;
|
|
|
- }
|
|
|
- })
|
|
|
- }
|
|
|
- }
|
|
|
- vueObj.sell_type=sellType;
|
|
|
-
|
|
|
- vueObj.form.goodsName=response.goodsInfo.GOODS_NAME
|
|
|
- vueObj.form.sellDiscount=response.goodsInfo.SELL_DISCOUNT
|
|
|
- vueObj.form.goodsNo=response.goodsInfo.GOODS_NO
|
|
|
- vueObj.form.type=response.goodsInfo.TYPE
|
|
|
- vueObj.form.unit=response.goodsInfo.UNIT
|
|
|
- vueObj.form.marketPrice=response.goodsInfo.MARKET_PRICE
|
|
|
- vueObj.form.sellPrice=response.goodsInfo.SELL_PRICE
|
|
|
- vueObj.form.pricePv=response.goodsInfo.PRICE_PV
|
|
|
- vueObj.form.point=response.goodsInfo.POINT
|
|
|
- vueObj.form.storeNums=response.goodsInfo.STORE_NUMS
|
|
|
- vueObj.form.content=response.goodsInfo.CONTENT
|
|
|
- vueObj.form.sort=response.goodsInfo.SORT
|
|
|
- vueObj.form.id=response.goodsInfo.ID
|
|
|
- vueObj.form.statusdate=response.goodsInfo.STATUS_DATE
|
|
|
- vueObj.form.pvSplit = response.goodsInfo.PV_SPLIT
|
|
|
- vueObj.form.goodsstatusdate=response.goodsInfo.GOODS_STATUS_DATE
|
|
|
- vueObj.form.goodsdate=response.goodsInfo.GOODS_DATE * 1000
|
|
|
- // vueObj.form.sellType=vueObj.form.sellType.map((item,index)=>{
|
|
|
- // return response.goodsInfo.SELL_TYPE.some(val=>(index+1).toString()==val)
|
|
|
- // })
|
|
|
-
|
|
|
- vueObj.form.coverOrigin = response.goodsInfo.COVER
|
|
|
- vueObj.form.cover = tool.getLocaleLink(response.goodsInfo.COVER, '/files/')
|
|
|
-
|
|
|
- this.$forceUpdate()
|
|
|
-
|
|
|
- })
|
|
|
- },
|
|
|
- /**
|
|
|
- * 2022-05-09
|
|
|
- * York
|
|
|
- * 限时商品
|
|
|
- */
|
|
|
- handleEditShowGoodsTimes(row) {
|
|
|
- this.dialogEditLoadingGoodsTimes = true
|
|
|
- this.auditId = row.ID
|
|
|
- this.dialogEditFormVisibleGoodsTimes = true
|
|
|
- let vueObj = this
|
|
|
- network.getData('shop/goods-edit', {id: this.auditId}).then(response => {
|
|
|
- vueObj.dialogEditLoadingGoodsTimes = false
|
|
|
- vueObj.goodsType=response.goodsType
|
|
|
-
|
|
|
- let gift=response.goodsInfo.GIFT_TYPE;
|
|
|
- let gift_type=response.giftType;
|
|
|
-
|
|
|
- let giftType=[];
|
|
|
- if(gift.length>0){
|
|
|
- for(let i in gift_type){
|
|
|
- giftType.push({key:i,name:gift_type[i].name,checked:false})
|
|
|
- gift.map((v,k)=>{
|
|
|
- if(v==i){
|
|
|
- giftType[i-1].checked=true;
|
|
|
- }
|
|
|
- })
|
|
|
- }
|
|
|
- }
|
|
|
- vueObj.GiftTypeArr=giftType
|
|
|
-
|
|
|
- let sell=response.goodsInfo.SELL_TYPE;
|
|
|
- let sell_type=response.sellType;
|
|
|
- let sellType=[];
|
|
|
- if(sell.length>0){
|
|
|
- for(let i in sell_type){
|
|
|
- sellType.push({key:i,name:sell_type[i].name,checked:false})
|
|
|
- sell.map((item,index)=>{
|
|
|
- if(item==i){
|
|
|
- sellType[i-1].checked=true;
|
|
|
- }
|
|
|
- })
|
|
|
- }
|
|
|
- }
|
|
|
- vueObj.sell_type=sellType;
|
|
|
-
|
|
|
- vueObj.form.goodsName=response.goodsInfo.GOODS_NAME
|
|
|
- vueObj.form.sellDiscount=response.goodsInfo.SELL_DISCOUNT
|
|
|
- vueObj.form.goodsNo=response.goodsInfo.GOODS_NO
|
|
|
- vueObj.form.type=response.goodsInfo.TYPE
|
|
|
- vueObj.form.unit=response.goodsInfo.UNIT
|
|
|
- vueObj.form.marketPrice=response.goodsInfo.MARKET_PRICE
|
|
|
- vueObj.form.sellPrice=response.goodsInfo.SELL_PRICE
|
|
|
- vueObj.form.pricePv=response.goodsInfo.PRICE_PV
|
|
|
- vueObj.form.point=response.goodsInfo.POINT
|
|
|
- vueObj.form.storeNums=response.goodsInfo.STORE_NUMS
|
|
|
- vueObj.form.content=response.goodsInfo.CONTENT
|
|
|
- vueObj.form.sort=response.goodsInfo.SORT
|
|
|
- vueObj.form.id=response.goodsInfo.ID
|
|
|
- vueObj.form.statusdate=response.goodsInfo.STATUS_DATE
|
|
|
- vueObj.form.goodsstatusdate=response.goodsInfo.GOODS_STATUS_DATE
|
|
|
- vueObj.form.goodsdate=response.goodsInfo.GOODS_DATE * 1000
|
|
|
- vueObj.form.coverOrigin = response.goodsInfo.COVER
|
|
|
- vueObj.form.cover = tool.getLocaleLink(response.goodsInfo.COVER, '/files/')
|
|
|
-
|
|
|
- this.$forceUpdate()
|
|
|
-
|
|
|
- })
|
|
|
- },
|
|
|
-
|
|
|
- handleEdit() {
|
|
|
- this.dialogEditFormVisible = false
|
|
|
- this.dialogEditFormVisibleGoodsTimes = false
|
|
|
- this.$message({
|
|
|
- message: '正在修改数据',
|
|
|
- type: 'info'
|
|
|
- })
|
|
|
- let path = 'shop/goods-edit'
|
|
|
-
|
|
|
- let sen_sell=[];
|
|
|
- this.sell_type.map((item,index)=>{
|
|
|
- if(item.checked){
|
|
|
- sen_sell.push(item.key);
|
|
|
- }
|
|
|
- })
|
|
|
- this.form.sellType=sen_sell;
|
|
|
-
|
|
|
- let sen_gift=[];
|
|
|
- this.GiftTypeArr.map((item,index)=>{
|
|
|
- if(item.checked){
|
|
|
- sen_gift.push(item.key);
|
|
|
- }
|
|
|
- })
|
|
|
- this.form.giftType=sen_gift;
|
|
|
- this.form.cover = this.form.coverOrigin;
|
|
|
- delete this.form.coverOrigin;
|
|
|
- network.postData(path, {...this.form}).then(response => {
|
|
|
- this.$message({
|
|
|
- message: response,
|
|
|
- type: 'success'
|
|
|
- })
|
|
|
- this.getData(this.currentPage, this.pageSize)
|
|
|
- }).catch(response => {
|
|
|
- })
|
|
|
- },
|
|
|
-
|
|
|
- handleDel(id = null) {
|
|
|
- let obj = this
|
|
|
- this.$confirm('确定删除选定的数据?', '提示', {
|
|
|
- confirmButtonText: '确定',
|
|
|
- cancelButtonText: '取消',
|
|
|
- type: 'warning'
|
|
|
- }).then(() => {
|
|
|
- let selectedIds = []
|
|
|
- if (id === null) {
|
|
|
- for (let val of obj.multipleSelection) {
|
|
|
- selectedIds.push(val.ID)
|
|
|
- }
|
|
|
- } else {
|
|
|
- selectedIds.push(id)
|
|
|
- }
|
|
|
- return network.postData(`shop/goods-delete`, {
|
|
|
- selected: selectedIds
|
|
|
- })
|
|
|
- }).then(response => {
|
|
|
- this.$message({
|
|
|
- message: response,
|
|
|
- type: 'success'
|
|
|
- })
|
|
|
- obj.getData(obj.currentPage, obj.pageSize)
|
|
|
- }).catch(response => {
|
|
|
-
|
|
|
- })
|
|
|
- },
|
|
|
- getData (page, pageSize) {
|
|
|
- let filterData = this.filterModel
|
|
|
- /*this.allData = response*/
|
|
|
- network.getPageData(this, 'shop/index', page, pageSize, this.filterModel, response=>{
|
|
|
- console.log(response)
|
|
|
- this.filterTypes = response.filterTypes
|
|
|
-
|
|
|
- })
|
|
|
- },
|
|
|
- handleGoodUp(id){
|
|
|
- console.log(id);
|
|
|
- network.postData('shop/goods-status',{selectedIds:id,status:1})
|
|
|
- .then(response=>{
|
|
|
- this.$message({
|
|
|
- message: response,
|
|
|
- type: 'success'
|
|
|
- })
|
|
|
- this.getData(this.currentPage, this.pageSize)
|
|
|
- })
|
|
|
- },
|
|
|
- handleGoodDown(id){
|
|
|
- network.postData('shop/goods-status',{selectedIds:id,status:0})
|
|
|
- .then(response=>{
|
|
|
- this.$message({
|
|
|
- message: response,
|
|
|
- type: 'success'
|
|
|
- })
|
|
|
- this.getData(this.currentPage, this.pageSize)
|
|
|
- })
|
|
|
- },
|
|
|
-
|
|
|
- handleExport(){
|
|
|
- this.$confirm(`确定要导出当前数据吗?`, '提示', {
|
|
|
- confirmButtonText: '确定',
|
|
|
- cancelButtonText: '取消',
|
|
|
- type: 'warning'
|
|
|
- }).then(() => {
|
|
|
- return network.getData(`shop/goods-list-export`, this.filterModel)
|
|
|
- }).then(response => {
|
|
|
- this.$message({
|
|
|
- message: response,
|
|
|
- type: 'success'
|
|
|
- })
|
|
|
- }).catch(response => {
|
|
|
-
|
|
|
- })
|
|
|
- },
|
|
|
- },
|
|
|
-
|
|
|
+ }
|
|
|
+ }
|
|
|
+ vueObj.GiftTypeArr = giftType
|
|
|
+
|
|
|
+ let sell = response.goodsInfo.SELL_TYPE
|
|
|
+ let sell_type = response.sellType
|
|
|
+ let sellType = []
|
|
|
+ if (sell.length > 0) {
|
|
|
+ for (let i in sell_type) {
|
|
|
+ sellType.push({key: i, name: sell_type[i].name, checked: false})
|
|
|
+ sell.map((item, index) => {
|
|
|
+ if (item == i) {
|
|
|
+ sellType[i - 1].checked = true
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ vueObj.sell_type = sellType
|
|
|
+
|
|
|
+ vueObj.form.goodsName = response.goodsInfo.GOODS_NAME
|
|
|
+ vueObj.form.sellDiscount = response.goodsInfo.SELL_DISCOUNT
|
|
|
+ vueObj.form.goodsNo = response.goodsInfo.GOODS_NO
|
|
|
+ vueObj.form.type = response.goodsInfo.TYPE
|
|
|
+ vueObj.form.unit = response.goodsInfo.UNIT
|
|
|
+ vueObj.form.marketPrice = response.goodsInfo.MARKET_PRICE
|
|
|
+ vueObj.form.sellPrice = response.goodsInfo.SELL_PRICE
|
|
|
+ vueObj.form.pricePv = response.goodsInfo.PRICE_PV
|
|
|
+ vueObj.form.point = response.goodsInfo.POINT
|
|
|
+ vueObj.form.storeNums = response.goodsInfo.STORE_NUMS
|
|
|
+ vueObj.form.content = response.goodsInfo.CONTENT
|
|
|
+ vueObj.form.sort = response.goodsInfo.SORT
|
|
|
+ vueObj.form.id = response.goodsInfo.ID
|
|
|
+ vueObj.form.statusdate = response.goodsInfo.STATUS_DATE
|
|
|
+ vueObj.form.pvSplit = response.goodsInfo.PV_SPLIT
|
|
|
+ vueObj.form.goodsstatusdate = response.goodsInfo.GOODS_STATUS_DATE
|
|
|
+ vueObj.form.goodsdate = response.goodsInfo.GOODS_DATE * 1000
|
|
|
+ // vueObj.form.sellType=vueObj.form.sellType.map((item,index)=>{
|
|
|
+ // return response.goodsInfo.SELL_TYPE.some(val=>(index+1).toString()==val)
|
|
|
+ // })
|
|
|
+
|
|
|
+ vueObj.form.coverOrigin = response.goodsInfo.COVER
|
|
|
+ vueObj.form.cover = tool.getLocaleLink(response.goodsInfo.COVER, '/files/')
|
|
|
+
|
|
|
+ this.$forceUpdate()
|
|
|
+ })
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * 2022-05-09
|
|
|
+ * York
|
|
|
+ * 限时商品
|
|
|
+ */
|
|
|
+ handleEditShowGoodsTimes (row) {
|
|
|
+ this.dialogEditLoadingGoodsTimes = true
|
|
|
+ this.auditId = row.ID
|
|
|
+ this.dialogEditFormVisibleGoodsTimes = true
|
|
|
+ let vueObj = this
|
|
|
+ network.getData('shop/goods-edit', {id: this.auditId}).then(response => {
|
|
|
+ vueObj.dialogEditLoadingGoodsTimes = false
|
|
|
+ vueObj.goodsType = response.goodsType
|
|
|
+
|
|
|
+ let gift = response.goodsInfo.GIFT_TYPE
|
|
|
+ let gift_type = response.giftType
|
|
|
+
|
|
|
+ let giftType = []
|
|
|
+ if (gift.length > 0) {
|
|
|
+ for (let i in gift_type) {
|
|
|
+ giftType.push({key: i, name: gift_type[i].name, checked: false})
|
|
|
+ gift.map((v, k) => {
|
|
|
+ if (v == i) {
|
|
|
+ giftType[i - 1].checked = true
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ vueObj.GiftTypeArr = giftType
|
|
|
+
|
|
|
+ let sell = response.goodsInfo.SELL_TYPE
|
|
|
+ let sell_type = response.sellType
|
|
|
+ let sellType = []
|
|
|
+ if (sell.length > 0) {
|
|
|
+ for (let i in sell_type) {
|
|
|
+ sellType.push({key: i, name: sell_type[i].name, checked: false})
|
|
|
+ sell.map((item, index) => {
|
|
|
+ if (item == i) {
|
|
|
+ sellType[i - 1].checked = true
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ vueObj.sell_type = sellType
|
|
|
+
|
|
|
+ vueObj.form.goodsName = response.goodsInfo.GOODS_NAME
|
|
|
+ vueObj.form.sellDiscount = response.goodsInfo.SELL_DISCOUNT
|
|
|
+ vueObj.form.goodsNo = response.goodsInfo.GOODS_NO
|
|
|
+ vueObj.form.type = response.goodsInfo.TYPE
|
|
|
+ vueObj.form.unit = response.goodsInfo.UNIT
|
|
|
+ vueObj.form.marketPrice = response.goodsInfo.MARKET_PRICE
|
|
|
+ vueObj.form.sellPrice = response.goodsInfo.SELL_PRICE
|
|
|
+ vueObj.form.pricePv = response.goodsInfo.PRICE_PV
|
|
|
+ vueObj.form.point = response.goodsInfo.POINT
|
|
|
+ vueObj.form.storeNums = response.goodsInfo.STORE_NUMS
|
|
|
+ vueObj.form.content = response.goodsInfo.CONTENT
|
|
|
+ vueObj.form.sort = response.goodsInfo.SORT
|
|
|
+ vueObj.form.id = response.goodsInfo.ID
|
|
|
+ vueObj.form.statusdate = response.goodsInfo.STATUS_DATE
|
|
|
+ vueObj.form.goodsstatusdate = response.goodsInfo.GOODS_STATUS_DATE
|
|
|
+ vueObj.form.goodsdate = response.goodsInfo.GOODS_DATE * 1000
|
|
|
+ vueObj.form.coverOrigin = response.goodsInfo.COVER
|
|
|
+ vueObj.form.cover = tool.getLocaleLink(response.goodsInfo.COVER, '/files/')
|
|
|
+
|
|
|
+ this.$forceUpdate()
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+ handleEdit () {
|
|
|
+ this.dialogEditFormVisible = false
|
|
|
+ this.dialogEditFormVisibleGoodsTimes = false
|
|
|
+ this.$message({
|
|
|
+ message: '正在修改数据',
|
|
|
+ type: 'info'
|
|
|
+ })
|
|
|
+ let path = 'shop/goods-edit'
|
|
|
+
|
|
|
+ let sen_sell = []
|
|
|
+ this.sell_type.map((item, index) => {
|
|
|
+ if (item.checked) {
|
|
|
+ sen_sell.push(item.key)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ this.form.sellType = sen_sell
|
|
|
+
|
|
|
+ let sen_gift = []
|
|
|
+ this.GiftTypeArr.map((item, index) => {
|
|
|
+ if (item.checked && (index % 2!=0)) {
|
|
|
+ sen_gift.push(item.key)
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
+ if (this.form.reconsumeType==0||this.form.reconsumeType==2){ // 复消类型,单选
|
|
|
+ sen_gift.push((this.form.reconsumeType+1).toString())
|
|
|
+ }
|
|
|
+ this.form.giftType = sen_gift
|
|
|
+ this.form.cover = this.form.coverOrigin
|
|
|
+ delete this.form.coverOrigin
|
|
|
+ network.postData(path, {...this.form}).then(response => {
|
|
|
+ this.$message({
|
|
|
+ message: response,
|
|
|
+ type: 'success'
|
|
|
+ })
|
|
|
+ this.getData(this.currentPage, this.pageSize)
|
|
|
+ }).catch(response => {
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+ handleDel (id = null) {
|
|
|
+ let obj = this
|
|
|
+ this.$confirm('确定删除选定的数据?', '提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning'
|
|
|
+ }).then(() => {
|
|
|
+ let selectedIds = []
|
|
|
+ if (id === null) {
|
|
|
+ for (let val of obj.multipleSelection) {
|
|
|
+ selectedIds.push(val.ID)
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ selectedIds.push(id)
|
|
|
+ }
|
|
|
+ return network.postData(`shop/goods-delete`, {
|
|
|
+ selected: selectedIds
|
|
|
+ })
|
|
|
+ }).then(response => {
|
|
|
+ this.$message({
|
|
|
+ message: response,
|
|
|
+ type: 'success'
|
|
|
+ })
|
|
|
+ obj.getData(obj.currentPage, obj.pageSize)
|
|
|
+ }).catch(response => {
|
|
|
+
|
|
|
+ })
|
|
|
+ },
|
|
|
+ getData (page, pageSize) {
|
|
|
+ let filterData = this.filterModel
|
|
|
+ /* this.allData = response */
|
|
|
+ network.getPageData(this, 'shop/index', page, pageSize, this.filterModel, response => {
|
|
|
+ // console.log(response)
|
|
|
+ this.filterTypes = response.filterTypes
|
|
|
+ })
|
|
|
+ },
|
|
|
+ handleGoodUp (id) {
|
|
|
+ // console.log(id)
|
|
|
+ network.postData('shop/goods-status', {selectedIds: id, status: 1})
|
|
|
+ .then(response => {
|
|
|
+ this.$message({
|
|
|
+ message: response,
|
|
|
+ type: 'success'
|
|
|
+ })
|
|
|
+ this.getData(this.currentPage, this.pageSize)
|
|
|
+ })
|
|
|
+ },
|
|
|
+ handleGoodDown (id) {
|
|
|
+ network.postData('shop/goods-status', {selectedIds: id, status: 0})
|
|
|
+ .then(response => {
|
|
|
+ this.$message({
|
|
|
+ message: response,
|
|
|
+ type: 'success'
|
|
|
+ })
|
|
|
+ this.getData(this.currentPage, this.pageSize)
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+ handleExport () {
|
|
|
+ this.$confirm(`确定要导出当前数据吗?`, '提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning'
|
|
|
+ }).then(() => {
|
|
|
+ return network.getData(`shop/goods-list-export`, this.filterModel)
|
|
|
+ }).then(response => {
|
|
|
+ this.$message({
|
|
|
+ message: response,
|
|
|
+ type: 'success'
|
|
|
+ })
|
|
|
+ }).catch(response => {
|
|
|
+
|
|
|
+ })
|
|
|
}
|
|
|
+ }
|
|
|
+
|
|
|
+}
|
|
|
|
|
|
</script>
|
|
|
|