Commit 4f78ed49 by chenwq

bug修复

1 parent 65e84471
<template>
<el-dialog id="baseDialog" top="15vh" :close-on-click-modal="true" :close-on-press-escape="true"
:title="dialogConfig.title" :width="dialogConfig.width" :visible.sync="visible" :show-close="config.showClose"
class="noborder" :append-to-body="config.appendToBody">
<slot />
<div slot="footer" v-if="config.isShowFooter">
<el-button type="primary" @click="confirmBtn">
{{ config.confirm_name }}
</el-button>
<el-button v-preventReClick @click="visible = false">
{{ config.cancel_name }}
</el-button>
</div>
</el-dialog>
</template>
<script>
export default {
name: 'BaseDialog',
directives: {
// 函数节流 监控输入框 提高性能
throttle: {
// 指令的定义
inserted: function (el, obj) {
let timerId = null
let flag = true
el.addEventListener('click', function () {
if (!flag) return
flag = false
timerId && clearTimeout(timerId)
timerId = setTimeout(function () {
flag = true
// 调用绑定在v-throttle上的方法search
obj.value()
}, 1000)
})
}
}
},
props: {
dialogConfig: {
required: false,
type: Object,
default: function () {
return {
title: '提示',
width: '480px'
}
}
},
config: {
required: false,
type: Object,
default: function () {
return {
showClose: true,
appendToBody: false, // 是否将自身插入至 body 元素,有嵌套的弹窗时一定要设置
isShowFooter: true,
cancel_name: '取 消',
confirm_name: '确 定'
}
}
},
isShow: {
// 弹窗是否展示
type: Boolean,
default: false
}
// width: {
// //弹窗宽度
// type: String,
// default: '',
// },
// cancel_name: {
// //取消按钮名称
// type: String,
// default: '取 消',
// },
// confirm_name: {
// //确定按钮名称
// type: String,
// default: '确 定',
// },
// isShowFooter: {
// //是否自定底部
// type: Boolean,
// default: true,
// },
// closeClick: {
// type: Boolean,
// default: false,
// },
// appendToBody: {
// // 是否将自身插入至 body 元素,有嵌套的弹窗时一定要设置
// type: Boolean,
// default: false,
// },
},
data() {
return {}
},
computed: {
visible: {
get() {
return this.isShow
},
set(val) {
this.$emit('update:isShow', false)
}
}
},
methods: {
confirmBtn() {
// 触发保存
this.$emit('handleClick')
}
},
created() {
// console.log('baseDialog')
},
mounted() { }
}
</script>
<style scoped lang="scss">
::v-deep .el-dialog {
// height: 90vh;
border-radius: 6px;
// padding: 0;
overflow: hidden;
.el-dialog__header {
border-bottom: solid 1px #e6e6e6;
border-radius: 6px 6px 0px 0px;
padding: 18px 20px 18px 25px;
.el-dialog__title {
// color: #212121;
color: #333333;
font-family: PingFangSC-Medium;
font-size: 20px;
font-weight: 600;
// font-weight: 16px;
}
.el-dialog__close {
color: #666;
font-weight: 600;
font-size: 20px;
}
}
.el-dialog__body {
box-sizing: border-box;
// padding-left: 25px;
padding: 15px 20px 30px;
color: #333;
max-height: calc(100% - 121px);
// height: calc(100% - 121px);
}
.roleTitle {
margin-right: 40px;
}
}
</style>
<template>
<el-dialog id="baseDialog" top="15vh" :close-on-click-modal="false" :close-on-press-escape="true"
:title="dialogConfig.title" :width="dialogConfig.width" :visible.sync="visible" :show-close="config.showClose"
class="noborder" :append-to-body="config.appendToBody">
<slot />
<div slot="footer" v-if="config.isShowFooter">
<el-button type="primary" @click="confirmBtn">
{{ config.confirm_name }}
</el-button>
<el-button v-preventReClick @click="visible = false">
{{ config.cancel_name }}
</el-button>
</div>
</el-dialog>
</template>
<script>
export default {
name: 'BaseDialog',
directives: {
// 函数节流 监控输入框 提高性能
throttle: {
// 指令的定义
inserted: function (el, obj) {
let timerId = null
let flag = true
el.addEventListener('click', function () {
if (!flag) return
flag = false
timerId && clearTimeout(timerId)
timerId = setTimeout(function () {
flag = true
// 调用绑定在v-throttle上的方法search
obj.value()
}, 1000)
})
}
}
},
props: {
dialogConfig: {
required: false,
type: Object,
default: function () {
return {
title: '提示',
width: '480px'
}
}
},
config: {
required: false,
type: Object,
default: function () {
return {
showClose: true,
appendToBody: false, // 是否将自身插入至 body 元素,有嵌套的弹窗时一定要设置
isShowFooter: true,
cancel_name: '取 消',
confirm_name: '确 定'
}
}
},
isShow: {
// 弹窗是否展示
type: Boolean,
default: false
}
// width: {
// //弹窗宽度
// type: String,
// default: '',
// },
// cancel_name: {
// //取消按钮名称
// type: String,
// default: '取 消',
// },
// confirm_name: {
// //确定按钮名称
// type: String,
// default: '确 定',
// },
// isShowFooter: {
// //是否自定底部
// type: Boolean,
// default: true,
// },
// closeClick: {
// type: Boolean,
// default: false,
// },
// appendToBody: {
// // 是否将自身插入至 body 元素,有嵌套的弹窗时一定要设置
// type: Boolean,
// default: false,
// },
},
data() {
return {}
},
computed: {
visible: {
get() {
return this.isShow
},
set(val) {
this.$emit('update:isShow', false)
}
}
},
methods: {
confirmBtn() {
// 触发保存
this.$emit('handleClick')
}
},
created() {
// console.log('baseDialog')
},
mounted() { }
}
</script>
<style scoped lang="scss">
::v-deep .el-dialog {
// height: 90vh;
border-radius: 6px;
// padding: 0;
overflow: hidden;
.el-dialog__header {
border-bottom: solid 1px #e6e6e6;
border-radius: 6px 6px 0px 0px;
padding: 18px 20px 18px 25px;
.el-dialog__title {
// color: #212121;
color: #333333;
font-family: PingFangSC-Medium;
font-size: 20px;
font-weight: 600;
// font-weight: 16px;
}
.el-dialog__close {
color: #666;
font-weight: 600;
font-size: 20px;
}
}
.el-dialog__body {
box-sizing: border-box;
// padding-left: 25px;
padding: 15px 20px 30px;
color: #333;
max-height: calc(100% - 121px);
// height: calc(100% - 121px);
}
.roleTitle {
margin-right: 40px;
}
}
</style>
......@@ -26,7 +26,7 @@
</div>
<div class="footer">
<el-button @click="handleDetailClose(false)">取消</el-button>
<el-button @click="submit" type="primary" v-preventReClick :loading="$store.state.d2admin.loading.value">确认</el-button>
<el-button @click="submit" type="primary" v-preventReClick :loading="$store.state.d2admin.loading.value">确定</el-button>
</div>
</div>
</baseDialog>
......
......@@ -18,9 +18,9 @@
<!-- 判断是否当前账户发货 -->
<el-input v-if="(isEmptyEdit && !detailInfo.tableData[scope.index].shipperUuid) || (detailInfo.tableData[scope.index].shipperUuid == userInfo.detail.uuid)" :class="{ 'border-red': !nowPurNumList[scope.index] && isSubmit }" placeholder="请输入" v-model="nowPurNumList[scope.index]" @input="e => handleInput(e, scope)"></el-input>
<!-- <div v-if="detailInfo.tableData[scope.index].shipperUuid != userInfo.detail.uuid">{{ detailInfo.tableData[scope.index].shipper }}</div> -->
<div v-else>{{ detailInfo.tableData[scope.index].shipper }}</div>
<div v-else>已分配:{{ detailInfo.tableData[scope.index].shipper }}</div>
</div>
<div v-else>{{ detailInfo.tableData[scope.index].shipperUuid ? detailInfo.tableData[scope.index].shipper : '未分配' }}</div>
<div v-else>{{ detailInfo.tableData[scope.index].shipperUuid ? '已分配:' + detailInfo.tableData[scope.index].shipper : '--' }}</div>
</div>
<div slot="cardNum" slot-scope="scope">
<div v-if="detailInfo.tableData[scope.index].entityCardFlag != 'Y' || (detailInfo.tableData[scope.index].shipperUuid && detailInfo.tableData[scope.index].shipperUuid != userInfo.detail.uuid)">-</div>
......@@ -52,11 +52,11 @@
<div class="footer">
<el-button @click="handleDetailClose(false)">取消</el-button>
<el-button @click="submit" type="primary" v-preventReClick :loading="$store.state.d2admin.loading.value">确认</el-button>
<el-button @click="submit" type="primary" v-preventReClick :loading="$store.state.d2admin.loading.value">确定</el-button>
</div>
</div>
</baseDialog>
<card-dialog v-if="cardVisible" :card-visible="cardVisible" :order-info="orderInfo" :selected-list="selectedCardList" @handleClose="handleCardDialog" @handleConfirm="handleCardConfirm"></card-dialog>
<card-dialog v-if="cardVisible" :card-visible="cardVisible" :order-info="orderInfo" :card-max-num="cardMaxNum" :selected-list="selectedCardList" @handleClose="handleCardDialog" @handleConfirm="handleCardConfirm"></card-dialog>
</div>
</template>
......@@ -209,13 +209,11 @@ export default {
if (!this.paramsObj?.orderCode) {
return true
}
console.log(this.page)
const apiName = this.page != 'purchase' ? factoryOrderDetail : purchaseOrderDetail
apiName({ orderCode: this.paramsObj.orderCode, pageSize: pageObj.pageSize, currentPage: pageObj.currentPage }).then(res => {
this.detailInfo = res
this.detailInfo.tableData = res.pagination.list
this.detailInfo.tableTotal = res.pagination.total
console.log(this.userInfo, 'userInfo---')
})
},
deliveryNumberInput(event, index) {
......@@ -233,22 +231,25 @@ export default {
const _index = scope.index
const _oldVal = this.oldPurNumList[_index] || 0
const _maxVal = _row.goodsNumber - _row.purchaseNumber
this.nowPurNumList[_index] = limitPrice(val, _oldVal, 9999, 0, 0, _maxVal)
this.nowPurNumList[_index] = limitPrice(val, _oldVal, 9999, 0, 0, _maxVal) || (val ? _maxVal : '')
this.oldPurNumList = JSON.parse(JSON.stringify(this.nowPurNumList))
},
handleCardDialog() {
this.cardVisible = !this.cardVisible
},
handleCard(scope) {
this.handleCardDialog()
this.orderInfo = scope.scope
this.orderIdx = scope.index
if (!this.nowPurNumList[scope.index]) {
this.notice.errorTips('请先填写发货数量')
return true
}
this.handleCardDialog()
this.cardMaxNum = this.nowPurNumList[scope.index]
this.selectedCardList = this.deliveryCardList[scope.index] || []
// console.log(scope)
},
handleCardConfirm(obj) {
this.handleCardDialog()
console.log(obj)
this.deliveryCardList[this.orderIdx] = obj
this.orderInfo = {}
this.orderIdx = ''
......@@ -273,9 +274,15 @@ export default {
for (let idx = 0; idx < this.detailInfo.tableData.length; idx++) {
const item = this.detailInfo.tableData[idx]
if (this.nowPurNumList[idx] && this.nowPurNumList[idx] != 0) {
if (item.entityCardFlag == 'Y' && this.nowPurNumList[idx] != this.deliveryCardList[idx].length) {
this.notice.errorTips('发货数量和发货卡号数量不一致,请确认后重新保存')
return true
if (item.entityCardFlag == 'Y') {
if (!this.deliveryCardList[idx]) {
this.notice.errorTips('请选择发货卡号')
return true
}
if (this.nowPurNumList[idx] != this.deliveryCardList[idx].length) {
this.notice.errorTips('发货数量和发货卡号数量不一致,请确认后重新保存')
return true
}
}
params.deliveryDetailList.push({
..._.pick(item, attrNameList),
......@@ -284,7 +291,7 @@ export default {
})
}
}
console.log(params)
// console.log(params)
purchaseOrderDelivery(params).then(res => {
this.handleDetailClose(true)
this.notice.okTips()
......
......@@ -485,10 +485,8 @@ export default {
// 确认发货
handleDelivery(row) {
this.editVisible = true
this.$nextTick(() => {
this.dialogData.orderCode = row.orderCode
this.dialogData.merchantName = row.merchantName
})
this.dialogData.orderCode = row.orderCode
this.dialogData.merchantName = row.merchantName
},
// 查看详情
handleDetail(row) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!