|
|
@@ -28,7 +28,8 @@
|
|
|
v-show="permission.hasPermission(`shop/goods-delete`)">Delete<!-- 删除数据 -->
|
|
|
</el-dropdown-item>
|
|
|
<el-dropdown-item command="goods-edit" @click.native="handleGoodUp(scope.row.ID)">On sale<!-- 商品上架 --> </el-dropdown-item>
|
|
|
- <el-dropdown-item command="goods-edit" @click.native="handleGoodDown(scope.row.ID)">Sold out<!-- 商品下架 --> </el-dropdown-item>
|
|
|
+ <el-dropdown-item command="goods-edit" @click.native="handleGoodDown(scope.row.ID)">Sold out<!-- 商品下架 --> </el-dropdown-item>
|
|
|
+ <el-dropdown-item command="goods-edit" @click.native="handleEditShowGoodsTimes(scope.row)">商品限时 </el-dropdown-item>
|
|
|
</el-dropdown-menu>
|
|
|
</el-dropdown>
|
|
|
</template>
|
|
|
@@ -142,7 +143,49 @@
|
|
|
<el-button @click="dialogEditFormVisible = false">Cancel<!-- 取 消 --></el-button>
|
|
|
<el-button type="primary" @click.native="handleEdit">Edit<!-- 修 改 --></el-button>
|
|
|
</div>
|
|
|
- </el-dialog>
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
+ <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"
|
|
|
+ active-value="1"
|
|
|
+ inactive-value="0">
|
|
|
+ </el-switch>
|
|
|
+ </el-form-item>
|
|
|
+ <transition name="el-zoom-in-top">
|
|
|
+ <el-form-item label="限时时间" v-show='form.statusdate==1?true:false'>
|
|
|
+ <el-date-picker
|
|
|
+ v-model="form.goodsdate"
|
|
|
+ type="datetime"
|
|
|
+ placeholder="选择日期时间"
|
|
|
+ value-format="timestamp"
|
|
|
+ popper-class='goodsdate'>
|
|
|
+ </el-date-picker>
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ </el-form-item>
|
|
|
+ </transition>
|
|
|
+ <transition name="el-zoom-in-top">
|
|
|
+ <el-form-item label="限时类型" v-show='form.statusdate==1?true:false'>
|
|
|
+
|
|
|
+ <el-radio v-model="form.goodsstatusdate" label="0" border>下架</el-radio>
|
|
|
+ <el-radio v-model="form.goodsstatusdate" label="1" border>上架</el-radio>
|
|
|
+ </el-form-item>
|
|
|
+ </transition>
|
|
|
+
|
|
|
+
|
|
|
+ </el-form>
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
+ <el-button @click="dialogEditFormVisibleGoodsTimes = false">取 消</el-button>
|
|
|
+ <el-button type="primary" @click.native="handleEdit">修 改</el-button>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
@@ -186,7 +229,9 @@
|
|
|
value:[],
|
|
|
selectedIds:'',
|
|
|
dialogEditFormVisible: false,
|
|
|
- dialogEditLoading: false,
|
|
|
+ dialogEditLoading: false,
|
|
|
+ dialogEditFormVisibleGoodsTimes: false,
|
|
|
+ dialogEditLoadingGoodsTimes: false,
|
|
|
form:{
|
|
|
// sellType:[],
|
|
|
goodsName:'',
|
|
|
@@ -206,7 +251,10 @@
|
|
|
textarea:'',
|
|
|
sellDiscount:'',
|
|
|
categoryType: '',
|
|
|
- sellType: 1,
|
|
|
+ sellType: 1,
|
|
|
+ statusdate:'',
|
|
|
+ goodsstatusdate:'',
|
|
|
+ goodsdate:'',
|
|
|
},
|
|
|
submitButtonStat: false,
|
|
|
goodsType:[],
|
|
|
@@ -297,7 +345,10 @@
|
|
|
vueObj.form.sort=response.goodsInfo.SORT
|
|
|
vueObj.form.id=response.goodsInfo.ID
|
|
|
vueObj.form.cover=response.goodsInfo.COVER
|
|
|
- vueObj.form.categoryType=parseInt(response.goodsInfo.CATEGORY_TYPE)
|
|
|
+ vueObj.form.categoryType=parseInt(response.goodsInfo.CATEGORY_TYPE)
|
|
|
+ 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.sellType=vueObj.form.sellType.map((item,index)=>{
|
|
|
// return response.goodsInfo.SELL_TYPE.some(val=>(index+1).toString()==val)
|
|
|
// })
|
|
|
@@ -305,9 +356,62 @@
|
|
|
this.$forceUpdate()
|
|
|
|
|
|
})
|
|
|
- },
|
|
|
+ },
|
|
|
+
|
|
|
+ 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
|
|
|
+ vueObj.categoryType = response.categoryType
|
|
|
+
|
|
|
+ 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
|
|
|
+
|
|
|
+ vueObj.sell_type=response.goodsInfo.SELL_TYPE;
|
|
|
+ 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.cover=response.goodsInfo.COVER
|
|
|
+ vueObj.form.categoryType=parseInt(response.goodsInfo.CATEGORY_TYPE)
|
|
|
+ vueObj.form.statusdate=response.goodsInfo.STATUS_DATE
|
|
|
+ vueObj.form.goodsstatusdate=response.goodsInfo.GOODS_STATUS_DATE
|
|
|
+ vueObj.form.goodsdate=response.goodsInfo.GOODS_DATE * 1000
|
|
|
+
|
|
|
+
|
|
|
+ this.$forceUpdate()
|
|
|
+
|
|
|
+ })
|
|
|
+ },
|
|
|
handleEdit() {
|
|
|
- this.dialogEditFormVisible = false
|
|
|
+ this.dialogEditFormVisible = false
|
|
|
+ this.dialogEditFormVisibleGoodsTimes = false
|
|
|
this.$message({
|
|
|
message: 'Modifying data',//正在修改数据
|
|
|
type: 'info'
|