✨ feat:新建收款完成100%
This commit is contained in:
@@ -56,6 +56,10 @@
|
||||
}
|
||||
|
||||
.rightFlex {
|
||||
width: 50%;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
.placeholderStyle {
|
||||
color: #f7f7f7;
|
||||
font-size: 28px;
|
||||
|
||||
@@ -10,7 +10,7 @@ import Taro, { faceVerifyForPay, useDidShow } from '@tarojs/taro'
|
||||
import Form from './components/form'
|
||||
import { formatDateTime, formatHashTag, formatImgUrl, formatPriceDiv, formatWeightDiv } from '@/common/format'
|
||||
import {
|
||||
mpreturnApplyOrderlist
|
||||
mpcashManagementOrderpost
|
||||
} from "@/api/newCollection"
|
||||
import TimePicker from "@/components/timePicker"
|
||||
import dayjs from 'dayjs'
|
||||
@@ -18,20 +18,18 @@ import { alert } from "@/common/common"
|
||||
import smallToBig from '@/common/money'
|
||||
|
||||
export default () => {
|
||||
|
||||
//获取选择的客户
|
||||
let pages = Taro.getCurrentPages();
|
||||
let currPage = pages[pages.length - 1]; // 获取当前页面
|
||||
useDidShow(() => {
|
||||
|
||||
//获取选择的客户
|
||||
let pages = Taro.getCurrentPages();
|
||||
let currPage = pages[pages.length - 1]; // 获取当前页面
|
||||
console.log(currPage.data, '8888')
|
||||
|
||||
setQuery((e) => ({
|
||||
...e,
|
||||
purchaser_id: currPage.data?.clientId ? currPage.data?.clientId : '',
|
||||
clientName: currPage.data?.clientName ? currPage.data?.clientName : '',
|
||||
// sale_user_id: currPage.data?.saleuserId ? currPage.data?.saleuserId : '',
|
||||
// saleuserName: currPage.data?.saleuserName ? currPage.data?.saleuserName : '',
|
||||
bankId: currPage.data?.bankId ? currPage.data?.bankId : '',
|
||||
bankName: currPage.data?.bankName ? currPage.data?.bankName : '',
|
||||
}))
|
||||
})
|
||||
|
||||
@@ -50,6 +48,7 @@ export default () => {
|
||||
e.stopPropagation()
|
||||
Taro.scanCode({
|
||||
success(res) {
|
||||
// setQuery({...Query})
|
||||
// setsearchObj((e) => ({ ...e, orderNo: res.result }))
|
||||
},
|
||||
fail(res) {
|
||||
@@ -60,14 +59,16 @@ export default () => {
|
||||
|
||||
//选择内容跳转
|
||||
const navTo = (val) => {
|
||||
if (val === 1) {
|
||||
|
||||
if (val == 1) {
|
||||
Taro.navigateTo({
|
||||
url: '/pages/customerPage/index?clientId=' + Query.purchaser_id
|
||||
})
|
||||
} else {
|
||||
if (Query.purchaser_id == '') {
|
||||
if (typeof (Query.purchaser_id) == 'undefined') {
|
||||
return alert.error('请先选择客户')
|
||||
} else {
|
||||
Taro.navigateTo({
|
||||
url: '/pages/accountPage/id?' + Query.bankId
|
||||
url: '/pages/accountPage/index?bankId?=' + Query?.bankId
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -77,14 +78,13 @@ export default () => {
|
||||
const isDisabled = useMemo(() => {
|
||||
if (Query.clientName == '' ||
|
||||
Query.money == '' ||
|
||||
Query.bankNum == '' ||
|
||||
picUrl.current.length == 0
|
||||
) {
|
||||
return true
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
}, [])
|
||||
}, [Query, picUrl])
|
||||
|
||||
//收款金额回调
|
||||
const getInput = (e) => {
|
||||
@@ -95,6 +95,12 @@ export default () => {
|
||||
setQuery(Query)
|
||||
}, [Query])
|
||||
|
||||
useEffect(() => {
|
||||
if (currPage.data?.clientId && (currPage.data?.clientId != Query.purchaser_id)) {
|
||||
setQuery({ ...Query, bankId: '', bankName: '' })
|
||||
}
|
||||
}, [Query])
|
||||
|
||||
|
||||
//备注信息
|
||||
const [TextareaValue, setTextareaValue] = useState('')
|
||||
@@ -110,7 +116,46 @@ export default () => {
|
||||
})
|
||||
}
|
||||
|
||||
//确认新建
|
||||
const { fetchData: sureFetch } = mpcashManagementOrderpost()
|
||||
const handSure = () => {
|
||||
|
||||
const query = {
|
||||
payment_credential_url: picUrl.current,
|
||||
purchaser_id: Query.purchaser_id,
|
||||
receipt_amount: Number(Query.money) * 100,
|
||||
receiving_account_id: Query.bankId,
|
||||
remark: TextareaValue
|
||||
}
|
||||
Taro.showModal({
|
||||
content: "确认提交吗?",
|
||||
confirmText: "确认",
|
||||
cancelText: "取消",
|
||||
success: async function (res) {
|
||||
if (res.confirm) {
|
||||
Taro.showLoading({
|
||||
title: '请稍等...',
|
||||
mask: true
|
||||
})
|
||||
const res = await sureFetch(query)
|
||||
if (res?.msg === 'success') {
|
||||
Taro.showToast({
|
||||
title: '成功'
|
||||
})
|
||||
Taro.hideLoading()
|
||||
handCancl()
|
||||
} else {
|
||||
Taro.hideLoading()
|
||||
Taro.showToast({
|
||||
title: res?.msg,
|
||||
icon: 'error'
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
})
|
||||
}
|
||||
return (
|
||||
<>
|
||||
<View className={styles.addBox}>
|
||||
@@ -162,7 +207,7 @@ export default () => {
|
||||
isInput={true}
|
||||
disabled={true}
|
||||
placeholderFont={'请选择银行账号'}
|
||||
inputValue={Query.bankNum}
|
||||
inputValue={Query.bankName}
|
||||
showMore={true}
|
||||
showScan={false}
|
||||
styleNone={true}
|
||||
@@ -178,7 +223,6 @@ export default () => {
|
||||
onInput={(e) => getDesc(e.detail.value)}
|
||||
value={TextareaValue}
|
||||
placeholderStyle='font-size: 28rpx;font-weight: 400;'
|
||||
autoFocus
|
||||
maxlength={64}
|
||||
placeholder={'请填写备注信息'}
|
||||
></Textarea>
|
||||
|
||||
Reference in New Issue
Block a user