diff --git a/.prettierrc.json b/.prettierrc.json index ad0351a..9b44b26 100644 --- a/.prettierrc.json +++ b/.prettierrc.json @@ -1,5 +1,5 @@ { - "tabWidth": 4, + "tabWidth": 2, "singleQuote": true, "semi": false, "printWidth": 100, diff --git a/src/components/PopupConfirm/approve.vue b/src/components/PopupConfirm/approve.vue new file mode 100644 index 0000000..12bd223 --- /dev/null +++ b/src/components/PopupConfirm/approve.vue @@ -0,0 +1,148 @@ + + + + + diff --git a/src/pages.json b/src/pages.json index 6cb0f3d..2d1f813 100644 --- a/src/pages.json +++ b/src/pages.json @@ -855,6 +855,18 @@ "navigationBarTitleText": "OCR盘点入库" } }, + { + "path": "pages/settleAccounts/index", + "style": { + "navigationBarTitleText": "结算审批" + } + }, + { + "path": "pages/settleAccounts/details", + "style": { + "navigationBarTitleText": "结算审批" + } + }, // 材料站 start // 首页 { diff --git a/src/pages/settleAccounts/details.vue b/src/pages/settleAccounts/details.vue new file mode 100644 index 0000000..8d318ae --- /dev/null +++ b/src/pages/settleAccounts/details.vue @@ -0,0 +1,175 @@ + + + + + diff --git a/src/pages/settleAccounts/index.vue b/src/pages/settleAccounts/index.vue new file mode 100644 index 0000000..2987e39 --- /dev/null +++ b/src/pages/settleAccounts/index.vue @@ -0,0 +1,302 @@ + + + + + diff --git a/src/pages/work/index.vue b/src/pages/work/index.vue index 6b7d62a..b42092d 100644 --- a/src/pages/work/index.vue +++ b/src/pages/work/index.vue @@ -396,6 +396,11 @@ const inStorageList = ref([ url: '/pages/inStorage/index', iconSrc: '../../static/workbench/minPai.png', }, + { + title: '结算管理', + url: '/pages/settleAccounts/index', + iconSrc: '../../static/workbench/minPai.png', + }, ]) const inStorageListTwo = computed(() => { diff --git a/src/services/accounts/index.js b/src/services/accounts/index.js new file mode 100644 index 0000000..e5c7689 --- /dev/null +++ b/src/services/accounts/index.js @@ -0,0 +1,28 @@ +import { http } from '@/utils/http' + +// 结算审批-列表 +export const getSltListApi = (data) => { + return http({ + method: 'GET', + url: '/material/slt_agreement_info/getSltList', + data, + }) +} + +// 协议书 +export const getSltInfoApi = (data) => { + return http({ + method: 'POST', + url: '/material/slt_agreement_info/getSltInfo', + data, + }) +} + +// 结算审批 +export const costExamineApi = (data) => { + return http({ + method: 'POST', + url: '/material/slt_agreement_info/costExamine', + data, + }) +} diff --git a/src/utils/bnsBase.js b/src/utils/bnsBase.js index 1703f46..90a8105 100644 --- a/src/utils/bnsBase.js +++ b/src/utils/bnsBase.js @@ -58,4 +58,42 @@ export const formatDiff = (...nums) => { // 保留 3 位小数,但去掉多余的 0 return parseFloat(result.toFixed(3)) } +} + +export function toChineseAmount(n) { + const fraction = ['角', '分'] + const digit = ['零', '壹', '贰', '叁', '肆', '伍', '陆', '柒', '捌', '玖'] + const unit = [ + ['元', '万', '亿'], + ['', '拾', '佰', '仟'] + ] + let head = n < 0 ? '负' : '' + n = Math.abs(n) + + let s = '' + + // 处理小数部分 + for (let i = 0; i < fraction.length; i++) { + s += (digit[Math.floor(n * 10 * Math.pow(10, i)) % 10] + fraction[i]).replace(/零./, '') + } + s = s || '整' + + // 处理整数部分 + n = Math.floor(n) + for (let i = 0; i < unit[0].length && n > 0; i++) { + let p = '' + for (let j = 0; j < unit[1].length && n > 0; j++) { + p = digit[n % 10] + unit[1][j] + p + n = Math.floor(n / 10) + } + s = p.replace(/(零.)*零$/, '').replace(/^$/, '零') + unit[0][i] + s + } + + return ( + head + + s + .replace(/(零.)*零元/, '元') + .replace(/(零.)+/g, '零') + .replace(/^整$/, '零元整') + ) } \ No newline at end of file