Commit 6e9c57f5 by 胡悦
2 parents c2d25351 c50ab786
...@@ -65,4 +65,15 @@ const getProInfoApi = params => { ...@@ -65,4 +65,15 @@ const getProInfoApi = params => {
}) })
} }
export default { getListApi, getProShareApi, topProApi, updateStatusProApi, deleteTakeProApi, getProInfoApi } const insertOrUpdateProApi = params => {
params.method = `${defaultPath}insertOrUpdate`
return http({
url: 'rop-scrm-shopmall/router',
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
export default { getListApi, getProShareApi, topProApi, updateStatusProApi, deleteTakeProApi, getProInfoApi, insertOrUpdateProApi }
...@@ -152,6 +152,10 @@ body,html { ...@@ -152,6 +152,10 @@ body,html {
z-index: 3000 !important; z-index: 3000 !important;
} }
.marketing .txt-red {
color: red;
}
.one-line-ellipsis { .one-line-ellipsis {
display: -webkit-box; display: -webkit-box;
overflow: hidden; overflow: hidden;
......
...@@ -125,7 +125,7 @@ ...@@ -125,7 +125,7 @@
<tr> <tr>
<td :style="{ width: specsWidth }" v-for="(subItem, subIndex) in specificationDetailList" :key="subIndex">{{ subItem.specificationName }}</td> <td :style="{ width: specsWidth }" v-for="(subItem, subIndex) in specificationDetailList" :key="subIndex">{{ subItem.specificationName }}</td>
<td :style="{ width: specsWidth }">零售价(元)</td> <td :style="{ width: specsWidth }">零售价(元)</td>
<td :style="{ width: specsWidth }">库存</td> <td :style="{ width: specsWidth }">库存(件)</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
...@@ -134,12 +134,22 @@ ...@@ -134,12 +134,22 @@
<tr style="border-bottom: 1px solid rgb(235, 235, 235);" v-for="(subItem, subIndex) in nameToValSpecsList" :key="subIndex"> <tr style="border-bottom: 1px solid rgb(235, 235, 235);" v-for="(subItem, subIndex) in nameToValSpecsList" :key="subIndex">
<td :style="{ width: specsWidth }" v-for="(n, idx) in subItem.specsValueList" :key="idx">{{ n }}</td> <td :style="{ width: specsWidth }" v-for="(n, idx) in subItem.specsValueList" :key="idx">{{ n }}</td>
<td :style="{ width: specsWidth }"> <td :style="{ width: specsWidth }">
<el-input placeholder="零售价" v-model="subItem.retailPrice" ng-blur="handleBlur()"></el-input> <div v-if="routeInfo.groupOrStore == 1">
<!-- <p ng-show="(parentData.groupOrStore == 1) && (+formData.supplyPrice > +item.retailPrice) && submitted" <el-input :class="{ 'border-red': (!(subItem.retailPrice + '') || (+editForm.supplyPrice > +subItem.retailPrice)) && submitted }" placeholder="零售价" v-model="subItem.retailPrice" ng-blur="handleBlur()">
class="text-danger form-text">零售价要大于供货价</p> --> <el-popover v-show="(!(subItem.retailPrice + '') || (+editForm.supplyPrice > +subItem.retailPrice)) && submitted" slot="suffix" placement="top" title="" width="90" trigger="hover" :content="!(subItem.retailPrice + '') ? '零售价是必填项' :'零售价要大于供货价'">
<i class="el-icon-warning color-red" slot="reference"></i>
</el-popover>
</el-input>
</div>
<el-input v-else placeholder="零售价" v-model="subItem.retailPrice" ng-blur="handleBlur()"></el-input>
</td> </td>
<td :style="{ width: specsWidth }"> <td :style="{ width: specsWidth }">
<el-input placeholder="库存" v-model="subItem.stock"></el-input></td> <el-input placeholder="库存" v-model="subItem.stock" :class="{ 'border-red': !(subItem.stock + '') && submitted }">
<el-popover v-show="!(subItem.stock + '') && submitted" slot="suffix" placement="top" title="" width="90" trigger="hover" content="库存是必填项">
<i class="el-icon-warning color-red" slot="reference"></i>
</el-popover>
</el-input>
</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
...@@ -220,6 +230,7 @@ export default { ...@@ -220,6 +230,7 @@ export default {
footerLeft: '0', footerLeft: '0',
footerWidth: '0', footerWidth: '0',
editChildRef: 'editChildRef', editChildRef: 'editChildRef',
submitted: false,
routeInfo: { routeInfo: {
// 1-新增;2-编辑;3-查看 // 1-新增;2-编辑;3-查看
addOrEdit: 1, addOrEdit: 1,
...@@ -319,7 +330,7 @@ export default { ...@@ -319,7 +330,7 @@ export default {
const base64 = file.name.split('.')[1] + '@' + imgFile.split(',')[1] const base64 = file.name.split('.')[1] + '@' + imgFile.split(',')[1]
this.$apis.common.uploadImgApi({ file: base64, fileType: 'image' }).then(res => { this.$apis.common.uploadImgApi({ file: base64, fileType: 'image' }).then(res => {
this.editForm[targetItem.name] = res this.editForm[targetItem.name] = res
this.$refs.editFormRef.$refs.editProRef0.validateField(targetItem.name) this.$refs.editFormRef[0].$refs.editProRef0.validateField(targetItem.name)
}) })
} }
}, },
...@@ -339,7 +350,7 @@ export default { ...@@ -339,7 +350,7 @@ export default {
resType: 1, resType: 1,
bizType: 1 bizType: 1
}) })
this.$refs.editFormRef.$refs.editProRef0.validateField(targetItem.name) this.$refs.editFormRef[0].$refs.editProRef0.validateField(targetItem.name)
}) })
} }
}, },
...@@ -833,10 +844,6 @@ export default { ...@@ -833,10 +844,6 @@ export default {
this.editForm.supplyMerchantList.length && this.recoveryMerchantList() this.editForm.supplyMerchantList.length && this.recoveryMerchantList()
this.handleTypeChange(this.editForm.deliveryType) this.handleTypeChange(this.editForm.deliveryType)
// console.log(this.editForm) // console.log(this.editForm)
// this.editForm.supplyMerchantList = res.merchantRefList
// this.editForm.supplyMerchantList.forEach(item => {
// item.merchantNo = item.merchantId
// })
}) })
}, },
getOptionsList(idx, formName, hasAll = true, refreshSigle) { getOptionsList(idx, formName, hasAll = true, refreshSigle) {
...@@ -917,31 +924,36 @@ export default { ...@@ -917,31 +924,36 @@ export default {
// 图片-描述-end // 图片-描述-end
handleConfirm() { handleConfirm() {
var isJump = false var isJump = false
this.submitted = true
for (var i = 0; i < this.externalFormList.length; i++) { for (var i = 0; i < this.externalFormList.length; i++) {
if (isJump) { if (isJump) {
return true return true
} }
this.$refs.editFormRef[i].$refs['editProRef' + i].validate((valid, errorObj) => { this.$refs.editFormRef[i].$refs['editProRef' + i].validate((valid, errorObj) => {
if (!valid) { // 规格值验证
if (i == 1) {
for (var j = 0; j < this.nameToValSpecsList.length; j++) {
var item = this.nameToValSpecsList[j]
if (!item.retailPrice || !item.stock) {
this.whereToGo('specificationDetailList')
isJump = true
break
}
if ((this.routeInfo.groupOrStore == 1) && (+item.retailPrice < +this.editForm.supplyPrice)) {
this.whereToGo('specificationDetailList')
isJump = true
break
}
}
}
if (!isJump && !valid) {
isJump = true isJump = true
this.whereToGo(Object.keys(errorObj)[0]) this.whereToGo(Object.keys(errorObj)[0])
} }
}) })
} }
// this.$refs.editFormRef[0].$refs.editProRef0.validate((valid0, errorObj0) => {
// if (!valid0) {
// this.whereToGo(Object.keys(errorObj0)[0])
// return true
// }
// this.$refs.editFormRef[1].$refs.editProRef1.validate((valid1, errorObj1) => {
// if (!valid0) {
// this.whereToGo(Object.keys(errorObj1)[0])
// return true
// }
// this.$refs.editFormRef[2].$refs.editProRef2.validate(valid2 => {
// if (valid0 && valid1 && valid2) {
var params = this.$common.utils.deepClone(this.editForm) var params = this.$common.utils.deepClone(this.editForm)
var deleteAttrList = ['descImgList', 'describeTxt'] var deleteAttrList = ['descImgList', 'describeTxt', 'specificationList']
var priceList = ['retailPrice', 'originalPrice', 'supplyPrice', 'expressFee'] var priceList = ['retailPrice', 'originalPrice', 'supplyPrice', 'expressFee']
if (this.routeInfo.addOrEdit == 2) { if (this.routeInfo.addOrEdit == 2) {
params.id = this.routeInfo.id params.id = this.routeInfo.id
...@@ -993,19 +1005,15 @@ export default { ...@@ -993,19 +1005,15 @@ export default {
delete params[item] delete params[item]
}) })
console.log(params) console.log(params)
// this.$apis.zoneList.insertZoneApi(params).then(res => { this.$apis.proManage.insertOrUpdateProApi(params).then(res => {
// this.$message({ this.$message({
// message: res.code == '0' ? '操作成功' : '操作失败', message: res.code == '0' ? '操作成功' : '操作失败',
// type: res.code == '0' ? 'success' : 'error' type: res.code == '0' ? 'success' : 'error'
// }) })
// if (res.code == '0') { if (res.code == '0') {
// this.handleCancel() this.handleCancel()
// } }
// }) })
// }
// })
// })
// })
}, },
handleCancel() { handleCancel() {
this.$router.push({ this.$router.push({
...@@ -1068,4 +1076,11 @@ export default { ...@@ -1068,4 +1076,11 @@ export default {
width: 90px; width: 90px;
vertical-align: bottom; vertical-align: bottom;
} }
.edit-pro .table-spesc .el-input--small.border-red .el-input__inner {
border: 1px solid #EB4E4E;
}
.color-red {
color: #EB4E4E;
cursor: pointer;
}
</style> </style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!