Commit 4f78ed49 by chenwq

bug修复

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