提交 d29b3210 编写于 作者: zhongyao.qiao's avatar zhongyao.qiao

Merge remote-tracking branch 'origin/release' into feature/qiao

......@@ -113,7 +113,7 @@
}
.backTip {
font-size: 12px;
color: red;
color: #f56c6c;
cursor: pointer;
}
.ad-back {
......@@ -349,4 +349,8 @@
height: 100%;
}
}
.tips {
color: #f56c6c;
}
}
......@@ -388,7 +388,7 @@
<div class="part-tit">销售信息</div>
<div class="inline">
<el-form-item label="销售方式" prop="saleType">
<el-radio-group v-model="formData.saleType" size="small">
<el-radio-group @change="handleSaleTypeChange" v-model="formData.saleType" size="small">
<el-radio :label="1">零售</el-radio>
<el-radio :label="2" :disabled="commissionFlag == 1"
>批发</el-radio
......@@ -500,7 +500,7 @@
class="required-label"
>
<el-col :span="20">
<div class="stock-com" style="width: 500px; display: flex">
<div class="stock-com" style="width: 550px; display: flex">
<el-input-number
class="stock-com"
@input="$forceUpdate()"
......@@ -535,15 +535,14 @@
</el-col>
</el-form-item>
</div>
<div class="inline" v-if="formData.saleType == 1">
<div class="inline">
<el-form-item
label="单次购买上限"
prop="mostCount"
class="required-label"
>
<el-col :span="20" style="width: 300%">
<div class="stock-com" style="width: 500px; display: flex">
<div class="stock-com" style="width: 550px; display: flex">
<el-input-number
class="stock-com"
@input="$forceUpdate()"
......@@ -553,9 +552,10 @@
:min="-1"
:max="9999"
></el-input-number>
<span class="word-num" style="margin-left: 10px"
>数值为-1时,代表单次购买上限已无限制(最高9999件哦)</span
>
<span class="word-num" style="margin-left: 10px">
数值为-1时,代表单次购买上限已无限制(最高9999件哦)
<span v-if="formData.saleType == 2" class="tips">(CRM 生效)</span>
</span>
</div>
<p class="error-message" v-if="formData.mostCount === 0">
单次购买上限不能为0
......@@ -596,7 +596,7 @@
class="required-label"
>
<el-col :span="20">
<div class="stock-com" style="width: 500px; display: flex">
<div class="stock-com" style="width: 550px; display: flex">
<el-input-number
class="stock-com"
@input="$forceUpdate()"
......@@ -632,8 +632,8 @@
</p>
</el-form-item>
</div>
<div class="basic-item-icon" v-if="formData.saleType == 1">
<div class="part-tit">限购条件</div>
<div class="basic-item-icon">
<div class="part-tit">限购条件<span v-if="formData.saleType == 2" class="tips">(仅CRM生效)</span></div>
<div v-for="(item, index) in buyLimitDtoList" :key="index">
<el-form-item label="限制条件">
<el-button @click="delLimit(index)" type="text" size="small"
......@@ -647,8 +647,10 @@
size="small"
@change="changeLimitUserType(item, index)"
>
<el-radio :label="1">开单人</el-radio>
<el-radio :label="2">患者</el-radio>
<!-- <el-radio :label=1>开单人</el-radio>
<el-radio :label=2>患者</el-radio>
<el-radio :label=3>单个机构</el-radio> -->
<el-radio v-for="(i, idx) in userTypeList" :label="i.value" :key="idx">{{ i.label }}</el-radio>
</el-radio-group>
</el-col>
</el-form-item>
......@@ -1102,6 +1104,25 @@ export default {
};
},
computed: {
userTypeList() {
const wholesale = [
{
label: '开单人',
value: 1
},
{
label: '患者',
value: 2
}
]
const retail = [
{
label: '单个机构',
value: 3
}
]
return this.formData.saleType === 1 ? wholesale: retail;
},
mCommonName() {
return [4, 5].includes(this.formData1.medicalCategoryId)
? "产品名称"
......@@ -1173,6 +1194,10 @@ export default {
radioChange(val) {
this.formData.expressLimitFlag = val;
},
handleSaleTypeChange(val) {
console.log('handleSaleTypeChange', val)
this.buyLimitDtoList = [];
},
getArr(arr) {
if (arr.length > 0) {
let newoodsList = [];
......@@ -2065,25 +2090,34 @@ export default {
});
return;
}
const commonItem = {
days: 0,
daysType: 1,
limitCount: 0,
}
if (this.buyLimitDtoList == null || this.buyLimitDtoList.length == 0) {
this.buyLimitDtoList.push({
days: 0,
daysType: 1,
limitCount: 0,
limitUserType: 1,
...commonItem,
limitUserType: this.formData.saleType === 1 ? 1 : 3,
});
return;
}
if (this.buyLimitDtoList.length < 2) {
if (this.formData.saleType === 2) {
this.buyLimitDtoList.push({
...commonItem,
limitUserType: 3,
});
return
}
let limitUserType = 1;
if (this.buyLimitDtoList[0].limitUserType == 1) {
limitUserType = 2;
}
this.buyLimitDtoList.push({
days: 0,
daysType: 1,
limitCount: 0,
...commonItem,
limitUserType: limitUserType,
});
}
......@@ -2093,23 +2127,31 @@ export default {
this.buyLimitDtoList.splice(index, 1);
},
changeLimitUserType(item, index) {
if (item.limitUserType == 1) {
if (this.buyLimitDtoList.length == 2 && index == 0) {
if (item.limitUserType === 1) {
if (this.buyLimitDtoList.length === 2 && index === 0) {
this.buyLimitDtoList[1].limitUserType = 2;
} else if (this.buyLimitDtoList.length == 2 && index == 1) {
} else if (this.buyLimitDtoList.length === 2 && index === 1) {
this.buyLimitDtoList[0].limitUserType = 2;
}
} else {
if (this.buyLimitDtoList.length == 2 && index == 0) {
}
if (item.limitUserType === 2) {
if (this.buyLimitDtoList.length === 2 && index === 0) {
this.buyLimitDtoList[1].limitUserType = 1;
} else if (this.buyLimitDtoList.length == 2 && index == 1) {
} else if (this.buyLimitDtoList.length === 2 && index === 1) {
this.buyLimitDtoList[0].limitUserType = 1;
}
}
if (item.limitUserType === 3) {
if (this.buyLimitDtoList.length === 2 && index === 0) {
this.buyLimitDtoList[1].limitUserType = 3;
} else if (this.buyLimitDtoList.length == 2 && index == 1) {
this.buyLimitDtoList[0].limitUserType = 3;
}
}
},
checkCount() {
let flag = true;
if (this.formData.saleType == 1 && this.formData.mostCount == 0) {
if (this.formData.mostCount == 0) {
flag = false;
this.$message({
message: "单次购买上限不能为0",
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册