提交 dfcb4639 编写于 作者: minghao.wu's avatar minghao.wu

Merge branch 'dev-0625' into dev-expressNo-0702

# Conflicts:
#	src/views/goods/order-manage.vue
......@@ -691,6 +691,45 @@
</el-col>
</el-form-item>
</div>
<div class="inline">
<el-form-item label="最小起购件数" prop="name" class="required-label">
<el-col :span="20">
<div class="stock-com">
<span class="sp sp-l" @click="minusCount(1)"><i class="el-icon-minus"></i></span>
<span class="sp sp-c">{{formData.leastCount}}</span>
<span class="sp sp-r" @click="plusCount(1)"><i class="el-icon-plus"></i></span>
</div>
<p class="error-message" v-if="formData.leastCount <= 0">最小起购件数不能为0</p>
</el-col>
</el-form-item>
</div>
<div class="inline" v-if="formData.leastCount > 1">
<el-form-item label="递增方式" prop="incrType">
<el-col :span="24">
<el-radio size="mini" v-model="formData.incrType" :label="2">倍数递增</el-radio>
<el-radio v-model="formData.incrType" :label="1">1件递增</el-radio>
</el-col>
</el-form-item>
</div>
<div class="inline">
<el-form-item label="单次购买上限" prop="name" class="required-label">
<el-col :span="20" style="width: 300%;">
<div class="stock-com" style="width: 500px;">
<span class="sp sp-l" @click="minusCount(2)"><i class="el-icon-minus"></i></span>
<span class="sp sp-c">{{formData.mostCount}}</span>
<span class="sp sp-r" @click="plusCount(2)"><i class="el-icon-plus"></i></span>
<span class="word-num" style="margin-left: 10px;">数值为-1时,代表单次购买上限已无限制</span>
</div>
<p class="error-message" v-if="formData.mostCount === 0">单次购买上限不能为0</p>
<!-- <p class="error-message" v-if="formData.mostCount <= -1">单次购买上限已无限制</p>-->
</el-col>
</el-form-item>
</div>
<div class="inline">
<el-form-item label="第三方商品编码" prop="externalGoodsCode">
<el-col :span="20">
......@@ -705,6 +744,54 @@
</div>
</el-form>
<el-form
ref="formData"
:model="formData"
:rules="rules"
label-width="150px"
label-suffix=":"
class="basic-form"
>
<div class="basic-item-icon">
<div class="part-tit">限购条件</div>
<div v-for="(item, index) in buyLimitDtoList" :key="index" >
<el-form-item label="限制条件">
<el-button @click="delLimit(index)" type="text" size="small">删除</el-button>
</el-form-item>
<el-form-item label="限制对象">
<el-col :span="10">
<el-radio-group v-model="item.limitUserType" size="small" @change="changeLimitUserType(item,index)">
<el-radio :label="1">开单人</el-radio>
<el-radio :label="2">患者</el-radio>
</el-radio-group>
</el-col>
</el-form-item>
<el-form-item label="购买限制">
<el-input-number v-model="item.days" style="margin-left: 5px;" size="small" :precision="0" :min="1" :max="100000"></el-input-number>
<el-select
v-model="item.daysType"
size="small">
<el-option
v-for="(item,index) in daysTypeList"
:key="index"
:label="item.label"
:value="item.value"
></el-option>
</el-select>
<span style="margin-left: 5px;">内,最多购买</span>
<el-input-number v-model="item.limitCount" style="margin-left: 5px;" size="small" :precision="0" :min="1" :max="100000"></el-input-number>
<span style="margin-left: 5px;"></span>
</el-form-item>
</div>
<div class="inline">
<el-form-item>
<el-button size="small" type="primary" @click="addBuyingLimit"><i class="el-icon-plus"></i>限购条件</el-button>
</el-form-item>
</div>
</div>
</el-form>
<el-dialog
:title="stock.title"
:visible.sync="stockDio"
......@@ -795,6 +882,19 @@
label: '其他',
value: '3',
}],
daysTypeList:[{
label: '日',
value: 1,
}, {
label: '周',
value: 7,
}, {
label: '月',
value: 30,
}, {
label: '年',
value: 365,
}],
checkPackageIdList: [{name:'其他',content:0}],
hospitalTypeList: [{label:'村卫生室',value:1},{label:'乡镇卫生院/中心',value:2}], // 医疗机构类型
checkTypeList: [{label:'常规检测',value:1}], // 检测类型
......@@ -806,6 +906,7 @@
formData: JSON.parse(JSON.stringify(originForm)), // 通用信息
formData1: JSON.parse(JSON.stringify(originForm1)), // 基本信息
formData2: JSON.parse(JSON.stringify(originForm2)),
buyLimitDtoList:[],
rules: {},
rules1: {},
rules2: {},
......@@ -838,7 +939,12 @@
uploadImgMessage1: false,//未上传图片,校验提示语
isMedic:false, // 商品类型选择【药品】时!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
isCheckServe: false, // 商品类型选择【检测服务】时!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
inputType: ''
inputType: '',
limitVisibleFlag:false,
limit:{
title:"限购条件"
}
}
},
created() {
......@@ -865,7 +971,9 @@
this.getLever(0,1)
dosageAll().then((res)=>{
this.doseAll = res.data
if (!this.doseAll) {
this.doseAll.push({dosageName: "其他",id: -1})
}
})
getDeparts().then((res)=>{
this.allDeparts = res.data
......@@ -877,7 +985,17 @@
this.checkPackageIdList = res.data;
})
}
debugger;
// 判空
if (this.formData.leastCount == null || this.formData.leastCount === '') {
this.formData.leastCount = 1;
}
if (this.formData.mostCount == null || this.formData.mostCount === '') {
this.formData.mostCount = -1;
}
if (this.formData.incrType == null || this.formData.incrType === '') {
this.formData.incrType = 2;
}
},
methods: {
//eidt状态
......@@ -900,12 +1018,12 @@
});
};
const { goodsInfo, medicalService } = res.data;
const { goodsInfo, medicalService, buyLimitDtoList} = res.data;
this.formData = {...this.formData, ...goodsInfo};
this.formData2 = medicalService;
this.formData = { ...this.formData, ...this.formData2 };
this.buyLimitDtoList = buyLimitDtoList;
this.$set(this.formData2, 'suitableArr', this.formData.suitable.split(','));
this.$set(this.formData, 'suitableArr', this.formData.suitable.split(','));
this.formData.optPrice = this.formData.costPrice/100;
......@@ -942,6 +1060,7 @@
const {goodsList} = res.data;
this.formData1 = goodsList[0];
this.formData = goodsList[0];
this.buyLimitDtoList = this.formData.buyLimitDtoList;
this.formData.optPrice = this.formData.costPrice/100;
this.fileGoodsList = this.getImges(goodsList[0].goodsImgList,1);
this.fileIntrList = this.getImges(goodsList[0].medicImgList,2);
......@@ -969,7 +1088,6 @@
...originRules
};
this.barAndGoodsFlag = this.formData1.medicalCategoryId ? true : false;
}
console.log(this.formData);
},
......@@ -1206,6 +1324,9 @@
placeholderTxt:txt
}
this.stockDio = true
},
buyingLimit() {
},
complete() {
let formNameList = ['formData', 'formData1', 'formData2'];
......@@ -1232,6 +1353,7 @@
this.formData.goodsImages = this.fileGoodsList;
this.formData.goodsHeaderImages = this.fileGoodsList;
this.formData.specificationImages = this.fileIntrList;
this.formData.buyLimitDtoList = this.buyLimitDtoList;
this.isgoodsImages = this.formData.goodsImages.length == 0 ? false :true;
// 如果是【药品】类型的商品
if(this.isMedic){
......@@ -1251,6 +1373,10 @@
return;
}
if(!this.checkCount()){
return;
}
let isTrue = false;
formNameList.map(item=>{
this.$refs[item].validate((valid) => {
......@@ -1453,6 +1579,35 @@
argument[3] && argument[3].destroy();
// vm.slide2.oriUrl = "";
},
// 单次购买上限和最大购买数
minusCount(type) {
if (type === 1) {
if (this.formData.leastCount >= 2) {
this.formData.leastCount -= 1;
this.formData1.leastCount = this.formData.leastCount;
}
} else if (type === 2) {
if(this.formData.mostCount > -1){
this.formData.mostCount -= 1;
this.formData1.mostCount = this.formData.mostCount;
}
}
// if (this.formData.mostCount < this.formData.leastCount) {
// this.formData.mostCount = this.formData.leastCount;
// }
},
plusCount(type) {
if (type === 1) {
this.formData.leastCount += 1;
this.formData1.leastCount = this.formData.leastCount;
} else if (type === 2) {
this.formData.mostCount += 1;
this.formData1.mostCount = this.formData.mostCount;
}
// if (this.formData.mostCount < this.formData.leastCount) {
// this.formData.mostCount = this.formData.leastCount;
// }
},
// 上传七牛
doUploadQiNiu(file){
......@@ -1464,6 +1619,83 @@
});
},
addBuyingLimit(){
if(this.buyLimitDtoList != null && this.buyLimitDtoList.length == 2){
this.$message({
message: '最多添加两个限制条件',
type: 'warning'
});
return;
}
if(this.buyLimitDtoList == null || this.buyLimitDtoList.length == 0){
this.buyLimitDtoList.push({
days:0,
daysType:1,
limitCount:0,
limitUserType:1
})
return;
}
if(this.buyLimitDtoList.length < 2){
let limitUserType = 1;
if(this.buyLimitDtoList[0].limitUserType == 1){
limitUserType = 2;
}
this.buyLimitDtoList.push({
days:0,
daysType:1,
limitCount:0,
limitUserType:limitUserType
})
}
// this.limitVisibleFlag = true;
},
delLimit(index){
this.buyLimitDtoList.splice(index,1);
},
changeLimitUserType(item,index){
if(item.limitUserType == 1){
if(this.buyLimitDtoList.length == 2 && index == 0){
this.buyLimitDtoList[1].limitUserType = 2;
}
else if(this.buyLimitDtoList.length == 2 && index == 1){
this.buyLimitDtoList[0].limitUserType = 2;
}
}
else {
if(this.buyLimitDtoList.length == 2 && index == 0){
this.buyLimitDtoList[1].limitUserType = 1;
}
else if(this.buyLimitDtoList.length == 2 && index == 1){
this.buyLimitDtoList[0].limitUserType = 1;
}
}
},
checkCount(){
let flag = true;
if(this.formData.mostCount == 0){
flag = false;
this.$message({
message: '单次购买上限不能为0',
type: 'warning'
});
return flag;
}
if(this.formData.mostCount != -1 && this.formData.mostCount < this.formData.leastCount){
flag = false;
this.$message({
message: '单次购买上限不能小于最小起购件数',
type: 'warning'
});
return flag;
}
return flag;
}
},
}
</script>
......
......@@ -60,7 +60,10 @@ const form = {
optPrice:'',
goodsStock:0,
stock: 0,
externalGoodsCode: ''
externalGoodsCode: '',
leastCount:1,
mostCount: -1,
incrType:1
};
......
......@@ -228,8 +228,8 @@
<div class="view-content">
<i class="el-icon-truck" style="font-size: 18px"></i><span class="send-status">已发货</span>
<span class="view-number">{{logisticeInfo}}</span>
<el-button type="text" @click="copyTxt">复制</el-button>
<el-button type="text" @click="changeExpressNo">修改物流单号</el-button>
<el-button type="text" @click="copyTxt">复制单号</el-button>
<el-button type="text" @click="updateOrderNo">修改物流单号</el-button>
</div>
<input type="text" id="copyInput" class="hidden-input" />
<span slot="footer" class="dialog-footer">
......@@ -290,6 +290,30 @@
<el-button size="small" type="primary" @click="confirmTui">完成</el-button>
</span>
</el-dialog>
<el-dialog
class="tui-dialog"
title="修改物流单号"
:visible="showOrderNoFlag"
@close="showOrderNoFlag = false"
width="385px"
>
<el-form ref="tuiForm" :rules="rules" :model="tuiForm" label-width="120px">
<el-form-item label="快递公司" prop="name">
<el-input v-model="tuiForm.money"></el-input>
</el-form-item>
<el-form-item label="快递单号" prop="name">
<el-input v-model="tuiForm.money"></el-input>
</el-form-item>
<el-form-item label="备注" prop="name">
<el-input v-model="tuiForm.money"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button size="small" type="primary" @click="confirmTui">完成</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
......@@ -390,6 +414,7 @@
ownerId:'',
brokerList:[],
brokerOwnerList:[],
showOrderNoFlag:false,
pickerOptions1: {
disabledDate: time => {
return (
......@@ -638,6 +663,11 @@
changeOwner(data) {
this.ownerId = data;
this.brokerListAll();
},
// 修改物流单号
updateOrderNo(){
this.viewLogisticsDialog = false;
this.showOrderNoFlag = true;
}
......
......@@ -382,21 +382,37 @@
},
//店铺管理
shopManage(row) {
this.$router.push({
let routeData = this.$router.resolve({
path: '/goods-manage',
query: {
storeId: row.tradeStore.id,
commissionFlag:row.tradeStore.commissionFlag
}
})
});
window.open(routeData.href, '_blank');
// this.$router.push({
// path: '/goods-manage',
// query: {
// storeId: row.tradeStore.id,
// commissionFlag:row.tradeStore.commissionFlag
// }
// })
},
orderManage(row) {
this.$router.push({
let routeData = this.$router.resolve({
path: '/order-manage',
query: {
storeId: row.tradeStore.id,
storeId: row.tradeStore.id
}
})
});
window.open(routeData.href, '_blank');
// this.$router.push({
// path: '/order-manage',
// query: {
// storeId: row.tradeStore.id,
// }
// })
},
//编辑
editShop(row) {
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册