| ¶Ô±ÈÐÂÎļþ |
| | |
| | | #!/usr/bin/env bash |
| | | # ============================================================ |
| | | # å®å¤ä¸éæ°æ ââ å端é¨ç½²èæ¬ï¼macOS / Linux çï¼ |
| | | # 对åºä»åºéç WTXC.batï¼åªéç¨äºæ¬åæ¯ï¼ä¸éæ°æï¼ã |
| | | # |
| | | # ./WTXC.sh # æå»º + ä¸ä¼ + è§£åï¼çä»·äº WTXC.batï¼ |
| | | # ./WTXC.sh --dry-run # åªæå»ºåæ¬å°æ£æ¥ï¼ä¸è¿æå¡å¨ãä¸ä¸ä¼ |
| | | # ./WTXC.sh --skip-build # ä¸æå»ºï¼ç´æ¥ä¸ä¼ å½åç®å½å·²æç dist.zip |
| | | # |
| | | # æµç¨ä¸ WTXC.bat å®å
¨ä¸è´ï¼pnpm buildï¼å¸¦ VITE_COMPANY=WTXCï¼â çæ dist.zip |
| | | # â scp ä¸ä¼ å° <è¿ç«¯ç®å½>/.dist.zip.uploading â æ ¡éªå¤§å° â æ¹å |
| | | # â unzip -t æ ¡éª â unzip -o è§£å â å é¤è¿ç«¯ zip |
| | | # |
| | | # é¨ç½²ç®æ ï¼root@42.63.71.140:/home/vue/dist |
| | | # |
| | | # ç¯å¢åéè¦çï¼DEPLOY_PASSWORDãDEPLOY_HOSTãDEPLOY_DIRãDEPLOY_PORT |
| | | # ï¼æ¹å¯ç æä¸´æ¶æå°å«çç®å½æ¶ç¨ï¼é¿å
æå¯ç åè¿å½ä»¤è¡åå²ï¼ |
| | | # |
| | | # 说æï¼WTXC.bat èµ°çæ¯ bin\sshpass.exeï¼Windows ä¸ç¨ï¼ãmacOS 䏿²¡æ sshpass |
| | | # æ¶æ¬èæ¬èªå¨æ¹ç¨ç³»ç»èªå¸¦ç expect éå¯ç ï¼å æ¤æ éé¢å¤å®è£
ï¼è¥å·²è£
|
| | | # sshpassï¼brew install hudochenkov/sshpass/sshpassï¼åä¼å
使ç¨å®ã |
| | | # ============================================================ |
| | | set -euo pipefail |
| | | |
| | | SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" |
| | | cd "$SCRIPT_DIR" |
| | | |
| | | # ------------------------------------------------------------------ |
| | | # 1. åæ°ä¸ç®æ é
ç½®ï¼å¯¹åº WTXC.bat é¡¶é¨ç Configuration æ®µï¼ |
| | | # ------------------------------------------------------------------ |
| | | SKIP_BUILD=0 |
| | | DRY_RUN=0 |
| | | |
| | | for arg in "$@"; do |
| | | case "$arg" in |
| | | --skip-build) SKIP_BUILD=1 ;; |
| | | --dry-run) DRY_RUN=1 ;; |
| | | -h | --help) |
| | | # æå°æä»¶å¤´é¨ç注é说æï¼ç¬¬ä¸è¡ shebang ä¹åå° set ä¹åï¼ |
| | | awk 'NR == 1 { next } /^set / { exit } { print }' "${BASH_SOURCE[0]}" |
| | | exit 0 |
| | | ;; |
| | | *) |
| | | echo "[ERROR] æªç¥åæ°ï¼${arg}ï¼å¯ç¨ï¼--skip-build / --dry-run / -hï¼" >&2 |
| | | exit 1 |
| | | ;; |
| | | esac |
| | | done |
| | | |
| | | COMPANY="WTXC" |
| | | EXPECT_BRANCH="dev_å®å¤_ä¸éæ°ææ" |
| | | REMOTE_USER="root" |
| | | REMOTE_HOST="42.63.71.140" |
| | | PORT="22" |
| | | PASSWORD="Nxwtxc123." |
| | | REMOTE_DIR="/home/vue/dist" |
| | | ZIP_FILE="dist.zip" |
| | | |
| | | # å
许ç¨ç¯å¢åéè¦ç |
| | | REMOTE_HOST="${DEPLOY_HOST:-$REMOTE_HOST}" |
| | | REMOTE_DIR="${DEPLOY_DIR:-$REMOTE_DIR}" |
| | | PASSWORD="${DEPLOY_PASSWORD:-$PASSWORD}" |
| | | PORT="${DEPLOY_PORT:-$PORT}" |
| | | |
| | | SSH_OPTS=(-o StrictHostKeyChecking=no -o ConnectTimeout=10 -o ServerAliveInterval=15 -o ServerAliveCountMax=3 -o NumberOfPasswordPrompts=1) |
| | | |
| | | # ------------------------------------------------------------------ |
| | | # 2. åç½®æ£æ¥ï¼åªè½å¨æ¬å®¢æ·åæ¯ä¸æå»ºé¨ç½² |
| | | # å
éåæ»äºä¸éçåç§°/Logo/æ¥å£å°åï¼ç¨å«ç忝æå»ºä¼æå«å®¢æ·çåç«¯ä¼ ä¸æ¥ã |
| | | # ------------------------------------------------------------------ |
| | | CURRENT_BRANCH="$(git rev-parse --abbrev-ref HEAD 2>/dev/null || echo '')" |
| | | if [ -n "$CURRENT_BRANCH" ] && [ "$CURRENT_BRANCH" != "$EXPECT_BRANCH" ]; then |
| | | if [ "${ALLOW_BRANCH_MISMATCH:-0}" != "1" ]; then |
| | | echo "[ERROR] å½ååæ¯æ¯ ${CURRENT_BRANCH}ï¼ä¸æ¯ä¸é忝 ${EXPECT_BRANCH}ã" >&2 |
| | | echo " æ¬èæ¬ä¼ææå»ºç»æé¨ç½²å°ä¸éç产æå¡å¨ï¼è¯·å
ååä¸é忝ï¼" >&2 |
| | | echo " git checkout ${EXPECT_BRANCH}" >&2 |
| | | echo " ç¡®å®è¦å¨è¯¥åæ¯ä¸é¨ç½²æ¶ï¼å¯å ALLOW_BRANCH_MISMATCH=1 è·³è¿æ¤æ ¡éªã" >&2 |
| | | exit 1 |
| | | fi |
| | | echo "[WARN] 忝䏿¯ ${EXPECT_BRANCH}ï¼å½å ${CURRENT_BRANCH}ï¼ï¼æ ALLOW_BRANCH_MISMATCH=1 ç»§ç»ã" >&2 |
| | | fi |
| | | |
| | | echo |
| | | echo "============================================================" |
| | | echo " Vue Dist Auto Deploy (ä¸éæ°æ / macOS)" |
| | | echo "============================================================" |
| | | echo |
| | | echo "Company : $COMPANY" |
| | | echo "Server : $REMOTE_USER@$REMOTE_HOST:$PORT" |
| | | echo "Remote Dir : $REMOTE_DIR" |
| | | echo "Package : $ZIP_FILE" |
| | | if [ -n "$(git status --porcelain 2>/dev/null || true)" ]; then |
| | | echo "Git : â å·¥ä½åºææªæäº¤æ¹å¨ï¼é¨ç½²çæ¯å·¥ä½åºå
容ï¼ä¸æ¯æäº¤å
容ï¼" |
| | | else |
| | | echo "Git : ${CURRENT_BRANCH} @ $(git rev-parse --short HEAD 2>/dev/null || echo '-')" |
| | | fi |
| | | echo |
| | | |
| | | # ------------------------------------------------------------------ |
| | | # 3. ä¾èµæ£æ¥ï¼å¯¹åº WTXC.bat ç [1/7]~[3/7]ï¼ |
| | | # ------------------------------------------------------------------ |
| | | echo "[1/4] æ£æ¥ pnpm / node ..." |
| | | command -v pnpm >/dev/null 2>&1 || { |
| | | echo "[ERROR] æ¾ä¸å° pnpmï¼è¯·å
npm install -g pnpm" >&2 |
| | | exit 1 |
| | | } |
| | | command -v node >/dev/null 2>&1 || { |
| | | echo "[ERROR] æ¾ä¸å° node" >&2 |
| | | exit 1 |
| | | } |
| | | echo " pnpm $(pnpm --version) / node $(node --version)" |
| | | |
| | | if [ ! -d node_modules ]; then |
| | | echo "[INFO] node_modules ä¸åå¨ï¼æ§è¡ pnpm install ..." |
| | | pnpm install |
| | | else |
| | | echo " node_modules å·²åå¨" |
| | | fi |
| | | |
| | | # ------------------------------------------------------------------ |
| | | # 4. æå»ºï¼å¯¹åº WTXC.bat ç [4/7]ï¼ |
| | | # 注æï¼archiver æä»¶æ¯å¨ closeBundle é弿¥å dist.zipï¼ |
| | | # æä»¥æå»ºå®è¦çå®è½å°ï¼åæ¶å
å ææ§ zipï¼é¿å
ææ§å
彿°å
ä¼ ä¸å»ã |
| | | # é»è®¤æ¯æ¬¡éæ°æå»ºï¼WTXC.bat 乿¯å¦æ¤ï¼ï¼åªææ¾å¼ --skip-build æå¤ç¨æ§å
ã |
| | | # ------------------------------------------------------------------ |
| | | if [ "$SKIP_BUILD" -eq 0 ]; then |
| | | echo |
| | | echo "[2/4] æå»ºä¸ï¼VITE_COMPANY=${COMPANY}ï¼pnpm run buildï¼..." |
| | | rm -f "$ZIP_FILE" |
| | | VITE_COMPANY="$COMPANY" pnpm run build |
| | | for _ in $(seq 1 30); do |
| | | [ -f "$ZIP_FILE" ] && break |
| | | sleep 1 |
| | | done |
| | | else |
| | | echo |
| | | echo "[2/4] è·³è¿æå»ºï¼--skip-buildï¼ï¼å¤ç¨å·²æç ${ZIP_FILE}" |
| | | echo "[WARN] 请确认该å
å°±æ¯ç¨ VITE_COMPANY=${COMPANY} æå»ºçï¼" >&2 |
| | | echo " å
é已忻客æ·çåç§°/Logo/æ¥å£å°åï¼ç¨éå
伿å«å®¢æ·çåç«¯ä¼ å°æ¬æå¡å¨ã" >&2 |
| | | fi |
| | | |
| | | if [ ! -f "$ZIP_FILE" ]; then |
| | | echo "[ERROR] æå»ºç»æä½æ²¡æçæ $ZIP_FILE" >&2 |
| | | exit 1 |
| | | fi |
| | | |
| | | ZIP_BYTES="$(wc -c < "$ZIP_FILE" | tr -d ' ')" |
| | | echo "[OK] æå
宿ï¼${ZIP_FILE}ï¼${ZIP_BYTES} åèï¼" |
| | | |
| | | if [ "$DRY_RUN" -eq 1 ]; then |
| | | echo "[INFO] --dry-runï¼æ¬å°æ£æ¥éè¿ï¼æªè¿æå¡å¨ãæªä¸ä¼ ã" |
| | | exit 0 |
| | | fi |
| | | |
| | | # ------------------------------------------------------------------ |
| | | # 5. è¿ç«¯æä½ï¼å¯¹åº WTXC.bat ç [6/7][7/7]ï¼ |
| | | # ------------------------------------------------------------------ |
| | | EXPECT_HELPER="$(mktemp -t wtxc-sshpass)" |
| | | cleanup() { rm -f "$EXPECT_HELPER"; } |
| | | trap cleanup EXIT |
| | | |
| | | cat > "$EXPECT_HELPER" <<'EXPECT' |
| | | #!/usr/bin/expect -f |
| | | # ç¨æ³: sshpass-helper <password> <command...> |
| | | set timeout 3600 |
| | | set pw [lindex $argv 0] |
| | | set cmd [lrange $argv 1 end] |
| | | eval spawn -noecho $cmd |
| | | expect { |
| | | -re "(?i)are you sure you want to continue connecting" { send "yes\r"; exp_continue } |
| | | -re "(?i)password:" { send "$pw\r"; exp_continue } |
| | | -re "(?i)permission denied" { exit 5 } |
| | | # è¶
æ¶å¿
é¡»æ¾å¼éåºï¼å¦å expect 伿å¨åé¢ç wait ä¸ä¸è¿å |
| | | timeout { puts stderr "SSH è¶
æ¶"; exit 9 } |
| | | eof |
| | | } |
| | | catch wait result |
| | | exit [lindex $result 3] |
| | | EXPECT |
| | | chmod +x "$EXPECT_HELPER" |
| | | |
| | | HAS_SSHPASS=0 |
| | | command -v sshpass >/dev/null 2>&1 && HAS_SSHPASS=1 |
| | | if [ "$HAS_SSHPASS" -eq 0 ] && ! command -v expect >/dev/null 2>&1; then |
| | | echo "[ERROR] æ¢æ²¡æ sshpass 乿²¡æ expectï¼æ æ³å¨èæ¬éèªå¨éå¯ç ã" >&2 |
| | | echo " 坿§è¡ï¼brew install hudochenkov/sshpass/sshpassï¼ææå·¥ scp ä¸ä¼ ã" >&2 |
| | | exit 1 |
| | | fi |
| | | |
| | | # å¨è¿ç«¯æ§è¡å½ä»¤ï¼è¿åå
¶éåºç ï¼stdout ç±è°ç¨æ¹æè·ï¼å¤±è´¥æ¶è¾åºæå° stderrï¼ |
| | | remote_run() { |
| | | local out rc=0 |
| | | if [ "$HAS_SSHPASS" -eq 1 ]; then |
| | | out="$(SSHPASS="$PASSWORD" sshpass -e ssh -p "$PORT" "${SSH_OPTS[@]}" "$REMOTE_USER@$REMOTE_HOST" "$1" 2>&1)" || rc=$? |
| | | else |
| | | out="$("$EXPECT_HELPER" "$PASSWORD" ssh -p "$PORT" "${SSH_OPTS[@]}" "$REMOTE_USER@$REMOTE_HOST" "$1" 2>&1)" || rc=$? |
| | | fi |
| | | if [ "$rc" -ne 0 ]; then |
| | | echo "[ERROR] è¿ç«¯å½ä»¤æ§è¡å¤±è´¥ï¼exit $rcï¼ï¼$1" >&2 |
| | | [ -n "$out" ] && printf '%s\n' "$out" >&2 |
| | | fi |
| | | printf '%s' "$out" |
| | | return "$rc" |
| | | } |
| | | |
| | | # ä¸ä¼ ä¸ä¸ªæä»¶ï¼remote_copy <æ¬å°æä»¶> <è¿ç«¯ç»å¯¹è·¯å¾>ï¼ä¿çè¿åº¦æ¡ï¼ |
| | | remote_copy() { |
| | | if [ "$HAS_SSHPASS" -eq 1 ]; then |
| | | SSHPASS="$PASSWORD" sshpass -e scp -P "$PORT" "${SSH_OPTS[@]}" "$1" "$REMOTE_USER@$REMOTE_HOST:$2" |
| | | else |
| | | "$EXPECT_HELPER" "$PASSWORD" scp -P "$PORT" "${SSH_OPTS[@]}" "$1" "$REMOTE_USER@$REMOTE_HOST:$2" |
| | | fi |
| | | } |
| | | |
| | | echo |
| | | echo "[3/4] è¿æ¥æå¡å¨ ..." |
| | | remote_run "echo SSH_OK" >/dev/null |
| | | echo "[OK] SSH è¿æ¥æå" |
| | | |
| | | remote_run "mkdir -p '$REMOTE_DIR'" >/dev/null |
| | | echo "[OK] è¿ç«¯ç®å½å°±ç»ª" |
| | | |
| | | REMOTE_TMP="$REMOTE_DIR/.dist.zip.uploading" |
| | | echo |
| | | echo "[4/4] ä¸ä¼ å¹¶è§£å ..." |
| | | remote_run "rm -f '$REMOTE_TMP'" >/dev/null |
| | | remote_copy "$ZIP_FILE" "$REMOTE_TMP" |
| | | echo "[OK] ä¸ä¼ 宿" |
| | | |
| | | # è¿ç«¯å½ä»¤çè¾åºé伿··æ expect åæ¾çå¯ç æç¤ºï¼å½ä»¤æ¬èº«ç stdout æ»å¨æåï¼ |
| | | # åæåä¸ä¸ªå段å³ä¸ºæéæ°å¼ï¼stat ç stderr ä¹ä¼èµ°å°è¿éï¼æ
åå䏿¬¡ç©ºå¼å¤æï¼ã |
| | | REMOTE_BYTES="$(remote_run "stat -c %s '$REMOTE_TMP'" | tr -d '\r' | awk 'END { print $NF }')" |
| | | REMOTE_BYTES="$(printf '%s' "$REMOTE_BYTES" | tr -cd '0-9')" |
| | | if [ -z "$REMOTE_BYTES" ] || [ "$REMOTE_BYTES" != "$ZIP_BYTES" ]; then |
| | | echo "[ERROR] è¿ç«¯æä»¶å¤§å°($REMOTE_BYTES)䏿¬å°($ZIP_BYTES)ä¸ä¸è´ï¼å·²ä¸æ¢ï¼è¿ç«¯ä¸´æ¶æä»¶ä¿çå¨ $REMOTE_TMP" >&2 |
| | | exit 1 |
| | | fi |
| | | echo "[OK] 大尿 ¡éªä¸è´ï¼$REMOTE_BYTES åèï¼" |
| | | |
| | | remote_run "mv -f '$REMOTE_TMP' '$REMOTE_DIR/$ZIP_FILE'" >/dev/null |
| | | echo "[OK] å
已就ä½" |
| | | |
| | | remote_run "command -v unzip" >/dev/null || { |
| | | echo "[ERROR] è¿ç«¯æ²¡æ unzipï¼CentOS ç¨ yum install -y unzip / Ubuntu ç¨ apt install -y unzip" >&2 |
| | | exit 1 |
| | | } |
| | | |
| | | remote_run "cd '$REMOTE_DIR' && unzip -tq '$ZIP_FILE'" >/dev/null |
| | | echo "[OK] è¿ç«¯ zip æ ¡éªéè¿" |
| | | |
| | | remote_run "cd '$REMOTE_DIR' && unzip -oq '$ZIP_FILE'" >/dev/null |
| | | echo "[OK] è§£å宿" |
| | | |
| | | remote_run "rm -f '$REMOTE_DIR/$ZIP_FILE'" >/dev/null || echo "[WARN] è¿ç«¯ zip å é¤å¤±è´¥ï¼ä¸å½±å使ç¨ï¼" |
| | | |
| | | echo |
| | | echo "============================================================" |
| | | echo " DEPLOY SUCCESS" |
| | | echo "============================================================" |
| | | echo "Company : $COMPANY" |
| | | echo "Server : $REMOTE_HOST:$PORT" |
| | | echo "Remote Dir : $REMOTE_DIR" |
| | | echo "Package : ${ZIP_FILE}ï¼${ZIP_BYTES} åèï¼" |
| | | echo "æç¤ºï¼å端æ¯éæèµæºï¼æµè§å¨ Ctrl/Cmd+Shift+R 强å·ååéªè¯ã" |
| | | echo |
| | |
| | | productUnitId?: number; // 产ååä½ç¼å· |
| | | productUnitName?: string; // 产ååä½åç§° |
| | | productBarCode?: string; // äº§åæ¡ç |
| | | productPrice?: number; // 产ååä»·ï¼åèä»·ï¼ |
| | | productPrice?: number; // å«ç¨åä»·ï¼åèä»·ï¼ |
| | | count: number; // æ°é |
| | | taxPercent?: number; // ç¨ç |
| | | totalPrice?: number; // ä¸å«ç¨éé¢ |
| | | taxPrice?: number; // ç¨é¢ |
| | | demandTime?: string; // éæ±æ¥æ |
| | | remark?: string; // 夿³¨ |
| | | qcCheckFlag?: boolean; // æ¯å¦è´¨æ£ |
| | | inCount?: number; // å
¥åºæ°é |
| | | } |
| | | } |
| | | |
| | |
| | | api: getBusinessStatusTypeSimpleList, |
| | | labelField: 'name', |
| | | valueField: 'id', |
| | | placeholder: 'è¯·éæ©åæºç¶æç»', |
| | | placeholder: 'è¯·éæ©åæºç¶æç»ï¼éå¡«ï¼', |
| | | allowClear: true, |
| | | }, |
| | | dependencies: { |
| | | triggerFields: ['id'], |
| | | disabled: (values) => values.id, |
| | | }, |
| | | rules: 'required', |
| | | }, |
| | | { |
| | | fieldName: 'dealTime', |
| | |
| | | dependencies: { |
| | | triggerFields: [''], |
| | | async componentProps() { |
| | | const statusList = await getBusinessStatusSimpleList( |
| | | formData.value?.statusTypeId ?? 0, |
| | | ); |
| | | const statusTypeId = formData.value?.statusTypeId; |
| | | // åæºç¶æç»ä¸ºéå¡«ï¼æªè®¾ç½®ç¶æç»æ¶æ²¡æå¯éé¶æ®µï¼ç¦ç¨å¹¶è¯´æåå |
| | | if (!statusTypeId) { |
| | | return { |
| | | disabled: true, |
| | | options: [], |
| | | placeholder: 'è¯¥åæºæªè®¾ç½®ãåæºç¶æç»ãï¼æ å¯éåæºé¶æ®µ', |
| | | }; |
| | | } |
| | | const statusList = await getBusinessStatusSimpleList(statusTypeId); |
| | | const options = statusList.map((item) => ({ |
| | | label: `${item.name}(èµ¢åçï¼${item.percent}%)`, |
| | | value: item.id, |
| | | })); |
| | | return { |
| | | disabled: false, |
| | | options, |
| | | placeholder: 'è¯·éæ©åæºé¶æ®µ', |
| | | }; |
| | | }, |
| | | // æªè®¾ç½®åæºç¶æç»æ¶ä¸åå¿
å¡«æ ¡éªï¼æ¤æ¶ä¹æ²¡æé¶æ®µå¯ä¾éæ©ï¼ |
| | | rules: () => (formData.value?.statusTypeId ? 'required' : null), |
| | | }, |
| | | rules: 'required', |
| | | }, |
| | | ]; |
| | | } |
| | |
| | | fieldName: 'customerId', |
| | | label: '客æ·åç§°', |
| | | component: markRaw(CrmCustomerSelect), |
| | | rules: 'required', |
| | | componentProps: (_values, form) => ({ |
| | | placeholder: 'è¯·éæ©å®¢æ·', |
| | | placeholder: 'è¯·éæ©å®¢æ·ï¼å¯ä¸éï¼', |
| | | allowClear: true, |
| | | onChange: () => { |
| | | form.setFieldValue('contractId', undefined); |
| | | form.setFieldValue('price', undefined); |
| | |
| | | fieldName: 'contractId', |
| | | label: 'åååç§°', |
| | | component: 'Select', |
| | | rules: 'required', |
| | | dependencies: { |
| | | triggerFields: ['customerId'], |
| | | disabled: (values) => !values.customerId || !!values.id, |
| | |
| | | if (!values.customerId) { |
| | | return { |
| | | options: [], |
| | | placeholder: '请å
鿩客æ·', |
| | | placeholder: '请å
鿩客æ·ï¼å¯ä¸éï¼', |
| | | allowClear: true, |
| | | }; |
| | | } |
| | | const contracts = await getContractSimpleList(values.customerId); |
| | |
| | | value: item.id, |
| | | }; |
| | | }), |
| | | placeholder: 'è¯·éæ©åå', |
| | | placeholder: 'è¯·éæ©ååï¼å¯ä¸éï¼', |
| | | allowClear: true, |
| | | onChange: () => { |
| | | form.setFieldValue('price', undefined); |
| | | }, |
| | |
| | | }, |
| | | { |
| | | fieldName: 'discountedPrice', |
| | | label: '伿 åéé¢', |
| | | label: '伿 åå«ç¨éé¢', |
| | | component: 'InputNumber', |
| | | componentProps: { |
| | | class: '!w-full', |
| | | placeholder: '伿 åéé¢', |
| | | placeholder: '伿 åå«ç¨éé¢', |
| | | precision: 2, |
| | | formatter: erpPriceInputFormatter, |
| | | disabled: true, |
| | |
| | | }, |
| | | { |
| | | field: 'productPrice', |
| | | title: '产ååä»·', |
| | | title: 'å«ç¨åä»·(å
)', |
| | | fixed: 'right', |
| | | minWidth: 120, |
| | | slots: { default: 'productPrice' }, |
| | | }, |
| | | { |
| | | field: 'totalProductPrice', |
| | | fixed: 'right', |
| | | title: '产åéé¢', |
| | | minWidth: 120, |
| | | formatter: 'formatAmount2', |
| | | }, |
| | | { |
| | | fixed: 'right', |
| | |
| | | slots: { default: 'taxPercent' }, |
| | | }, |
| | | { |
| | | field: 'totalProductPrice', |
| | | fixed: 'right', |
| | | title: 'ä¸å«ç¨éé¢(å
)', |
| | | minWidth: 120, |
| | | formatter: 'formatAmount2', |
| | | }, |
| | | { |
| | | fixed: 'right', |
| | | field: 'taxPrice', |
| | | title: 'ç¨é¢', |
| | | title: 'ç¨é¢(å
)', |
| | | minWidth: 120, |
| | | formatter: 'formatAmount2', |
| | | }, |
| | | { |
| | | field: 'totalPrice', |
| | | fixed: 'right', |
| | | title: 'å计éé¢', |
| | | title: 'å«ç¨å计(å
)', |
| | | minWidth: 120, |
| | | formatter: 'formatAmount2', |
| | | }, |
| | |
| | | }, |
| | | { |
| | | field: 'totalProductPrice', |
| | | title: 'éé¢å计', |
| | | title: 'ä¸å«ç¨éé¢å计', |
| | | formatter: 'formatAmount2', |
| | | minWidth: 120, |
| | | }, |
| | |
| | | /** å¤çè¡æ°æ®åæ´ */ |
| | | function handleRowChange(row: any) { |
| | | // TODO èè¿ |
| | | recalcRow(row); |
| | | const index = tableData.value.findIndex((item) => item.seq === row.seq); |
| | | if (index === -1) { |
| | | tableData.value.push(row); |
| | |
| | | emit('update:items', [...tableData.value]); |
| | | } |
| | | |
| | | /** åå§åè¡æ°æ® */ |
| | | function initRow(row: ErpPurchaseInApi.PurchaseInItem) { |
| | | /** |
| | | * éç®è¡éé¢ï¼å价为**å«ç¨**åä»·ï¼ |
| | | * å«ç¨éé¢ = å«ç¨åä»· à æ°éï¼ç¨é¢ = å«ç¨éé¢ Ã ç¨çï¼ä¸å«ç¨éé¢ = å«ç¨éé¢ - ç¨é¢ |
| | | */ |
| | | function recalcRow(row: ErpPurchaseInApi.PurchaseInItem) { |
| | | if (row.productPrice && row.count) { |
| | | row.totalProductPrice = erpPriceMultiply(row.productPrice, row.count) ?? 0; |
| | | const taxInclusivePrice = erpPriceMultiply(row.productPrice, row.count) ?? 0; |
| | | row.taxPrice = |
| | | erpPriceMultiply(row.totalProductPrice, (row.taxPercent || 0) / 100) ?? 0; |
| | | row.totalPrice = row.totalProductPrice + row.taxPrice; |
| | | erpPriceMultiply(taxInclusivePrice, (row.taxPercent || 0) / 100) ?? 0; |
| | | row.totalProductPrice = taxInclusivePrice - row.taxPrice; |
| | | row.totalPrice = taxInclusivePrice; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * åå§åè¡æ°æ® |
| | | * å·²æåæ®çæç»è¡ï¼å¸¦ idï¼æ²¿ç¨å端è¿åçéé¢ï¼é¿å
åå²åæ®è¢«æ°å£å¾è¦çï¼ |
| | | * åªææªä¿åçæ°å¢è¡æææ°å£å¾éç®ã |
| | | */ |
| | | function initRow(row: ErpPurchaseInApi.PurchaseInItem) { |
| | | if (!row.id) { |
| | | recalcRow(row); |
| | | } |
| | | } |
| | | |
| | |
| | | <div class="flex space-x-4"> |
| | | <span>æ°éï¼{{ erpCountInputFormatter(summaries.count) }}</span> |
| | | <span> |
| | | éé¢ï¼{{ erpPriceInputFormatter(summaries.totalProductPrice) }} |
| | | ä¸å«ç¨éé¢ï¼{{ erpPriceInputFormatter(summaries.totalProductPrice) }} |
| | | </span> |
| | | <span>ç¨é¢ï¼{{ erpPriceInputFormatter(summaries.taxPrice) }}</span> |
| | | <span> |
| | | ç¨é¢å计ï¼{{ erpPriceInputFormatter(summaries.totalPrice) }} |
| | | å«ç¨å计ï¼{{ erpPriceInputFormatter(summaries.totalPrice) }} |
| | | </span> |
| | | </div> |
| | | </div> |
| | |
| | | { field: 'supplierName', title: 'ä¾åºå', minWidth: 120 }, |
| | | { field: 'orderTime', title: 'è®¢åæ¶é´', width: 120, formatter: 'formatDate' }, |
| | | { field: 'totalCount', title: 'å计æ°é', width: 100 }, |
| | | { field: 'totalPrice', title: 'å计éé¢', width: 100 }, |
| | | { field: 'totalPrice', title: 'å«ç¨å计', width: 100 }, |
| | | ]; |
| | | } |
| | | |
| | |
| | | <div>订åå·ï¼{{ selectedItem.no || '-' }}</div> |
| | | <div>ä¾åºåï¼{{ selectedItem.supplierName || '-' }}</div> |
| | | <div>è®¢åæ¶é´ï¼{{ selectedItem.orderTime || '-' }}</div> |
| | | <div>å计éé¢ï¼{{ selectedItem.totalPrice || '-' }} å
</div> |
| | | <div>å«ç¨å计ï¼{{ selectedItem.totalPrice || '-' }} å
</div> |
| | | </div> |
| | | </template> |
| | | <Input |
| | |
| | | return z |
| | | .number() |
| | | .min(0, '订éä¸è½å°äº0') |
| | | .max(values.totalPrice, '订éä¸è½å¤§äºä¼æ åéé¢'); |
| | | .max(values.totalPrice, '订éä¸è½å¤§äºä¼æ åå«ç¨éé¢'); |
| | | } |
| | | return z.number().min(0, '订éä¸è½å°äº0'); |
| | | }, |
| | |
| | | }, |
| | | { |
| | | fieldName: 'totalPrice', |
| | | label: '伿 åéé¢', |
| | | label: '伿 åå«ç¨éé¢', |
| | | component: 'InputNumber', |
| | | componentProps: { |
| | | class: '!w-full', |
| | | placeholder: '伿 åéé¢', |
| | | placeholder: '伿 åå«ç¨éé¢', |
| | | precision: 2, |
| | | formatter: erpPriceInputFormatter, |
| | | disabled: true, |
| | |
| | | }, |
| | | { |
| | | field: 'productPrice', |
| | | title: '产ååä»·', |
| | | title: 'å«ç¨åä»·(å
)', |
| | | minWidth: 120, |
| | | fixed: 'right', |
| | | slots: { default: 'productPrice' }, |
| | | }, |
| | | { |
| | | field: 'totalProductPrice', |
| | | title: 'éé¢', |
| | | minWidth: 120, |
| | | fixed: 'right', |
| | | formatter: 'formatAmount2', |
| | | }, |
| | | { |
| | | field: 'taxPercent', |
| | |
| | | slots: { default: 'taxPercent' }, |
| | | }, |
| | | { |
| | | field: 'totalProductPrice', |
| | | title: 'ä¸å«ç¨éé¢(å
)', |
| | | minWidth: 120, |
| | | fixed: 'right', |
| | | formatter: 'formatAmount2', |
| | | }, |
| | | { |
| | | field: 'taxPrice', |
| | | title: 'ç¨é¢', |
| | | title: 'ç¨é¢(å
)', |
| | | minWidth: 120, |
| | | fixed: 'right', |
| | | formatter: 'formatAmount2', |
| | | }, |
| | | { |
| | | field: 'totalPrice', |
| | | title: 'ç¨é¢å计', |
| | | title: 'å«ç¨å计(å
)', |
| | | minWidth: 120, |
| | | fixed: 'right', |
| | | formatter: 'formatAmount2', |
| | |
| | | }, |
| | | { |
| | | field: 'totalProductPrice', |
| | | title: 'éé¢å计', |
| | | title: 'ä¸å«ç¨éé¢å计', |
| | | formatter: 'formatAmount2', |
| | | minWidth: 120, |
| | | }, |
| | |
| | | render: (val) => erpCountInputFormatter(val) || '-', |
| | | }, |
| | | { |
| | | label: 'å计éé¢', |
| | | label: 'å«ç¨å计éé¢', |
| | | field: 'totalPrice', |
| | | render: (val) => erpPriceInputFormatter(val) || '-', |
| | | }, |
| | |
| | | |
| | | /** å¤çè¡æ°æ®åæ´ */ |
| | | function handleRowChange(row: any) { |
| | | recalcRow(row); |
| | | const index = tableData.value.findIndex((item) => item.seq === row.seq); |
| | | if (index === -1) { |
| | | tableData.value.push(row); |
| | |
| | | emit('update:items', [...tableData.value]); |
| | | } |
| | | |
| | | /** åå§åè¡æ°æ® */ |
| | | function initRow(row: ErpPurchaseOrderApi.PurchaseOrderItem) { |
| | | /** |
| | | * éç®è¡éé¢ï¼å价为**å«ç¨**åä»·ï¼ |
| | | * å«ç¨éé¢ = å«ç¨åä»· à æ°éï¼ç¨é¢ = å«ç¨éé¢ Ã ç¨çï¼ä¸å«ç¨éé¢ = å«ç¨éé¢ - ç¨é¢ |
| | | */ |
| | | function recalcRow(row: ErpPurchaseOrderApi.PurchaseOrderItem) { |
| | | if (row.productPrice && row.count) { |
| | | row.totalProductPrice = erpPriceMultiply(row.productPrice, row.count) ?? 0; |
| | | const taxInclusivePrice = erpPriceMultiply(row.productPrice, row.count) ?? 0; |
| | | row.taxPrice = |
| | | erpPriceMultiply(row.totalProductPrice, (row.taxPercent || 0) / 100) ?? 0; |
| | | row.totalPrice = row.totalProductPrice + row.taxPrice; |
| | | erpPriceMultiply(taxInclusivePrice, (row.taxPercent || 0) / 100) ?? 0; |
| | | row.totalProductPrice = taxInclusivePrice - row.taxPrice; |
| | | row.totalPrice = taxInclusivePrice; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * åå§åè¡æ°æ® |
| | | * å·²æåæ®çæç»è¡ï¼å¸¦ idï¼æ²¿ç¨å端è¿åçéé¢ï¼é¿å
åå²åæ®è¢«æ°å£å¾è¦çï¼ |
| | | * åªææªä¿åçæ°å¢è¡æææ°å£å¾éç®ã |
| | | */ |
| | | function initRow(row: ErpPurchaseOrderApi.PurchaseOrderItem) { |
| | | if (!row.id) { |
| | | recalcRow(row); |
| | | } |
| | | } |
| | | |
| | |
| | | <div class="flex space-x-4"> |
| | | <span>æ°éï¼{{ erpCountInputFormatter(summaries.count) }}</span> |
| | | <span> |
| | | éé¢ï¼{{ erpPriceInputFormatter(summaries.totalProductPrice) }} |
| | | ä¸å«ç¨éé¢ï¼{{ erpPriceInputFormatter(summaries.totalProductPrice) }} |
| | | </span> |
| | | <span>ç¨é¢ï¼{{ erpPriceInputFormatter(summaries.taxPrice) }}</span> |
| | | <span> |
| | | ç¨é¢å计ï¼{{ erpPriceInputFormatter(summaries.totalPrice) }} |
| | | å«ç¨å计ï¼{{ erpPriceInputFormatter(summaries.totalPrice) }} |
| | | </span> |
| | | </div> |
| | | </div> |
| | |
| | | }, |
| | | { |
| | | field: 'productPrice', |
| | | title: 'åä»·ï¼åèä»·ï¼', |
| | | title: 'å«ç¨åä»·(å
)', |
| | | minWidth: 120, |
| | | fixed: 'right', |
| | | slots: { default: 'productPrice' }, |
| | | }, |
| | | { |
| | | field: 'totalPrice', |
| | | title: 'é¢ä¼°éé¢', |
| | | minWidth: 120, |
| | | fixed: 'right', |
| | | formatter: 'formatAmount2', |
| | | }, |
| | | { |
| | | field: 'taxPercent', |
| | |
| | | minWidth: 100, |
| | | fixed: 'right', |
| | | slots: { default: 'taxPercent' }, |
| | | }, |
| | | { |
| | | field: 'totalPrice', |
| | | title: 'ä¸å«ç¨éé¢(å
)', |
| | | minWidth: 120, |
| | | fixed: 'right', |
| | | formatter: 'formatAmount2', |
| | | }, |
| | | { |
| | | field: 'taxPrice', |
| | | title: 'ç¨é¢(å
)', |
| | | minWidth: 120, |
| | | fixed: 'right', |
| | | formatter: 'formatAmount2', |
| | | }, |
| | | { |
| | | title: 'å«ç¨å计(å
)', |
| | | minWidth: 120, |
| | | fixed: 'right', |
| | | slots: { default: 'totalTaxInclusivePrice' }, |
| | | }, |
| | | { |
| | | field: 'demandTime', |
| | |
| | | }, |
| | | { |
| | | field: 'totalPrice', |
| | | title: 'é¢ä¼°éé¢', |
| | | title: 'å«ç¨éé¢', |
| | | formatter: 'formatAmount2', |
| | | minWidth: 120, |
| | | }, |
| | |
| | | }, |
| | | { |
| | | field: 'productPrice', |
| | | title: 'åä»·ï¼åèä»·ï¼', |
| | | minWidth: 120, |
| | | formatter: ({ cellValue }) => erpPriceInputFormatter(cellValue) || '-', |
| | | }, |
| | | { |
| | | field: 'totalPrice', |
| | | title: 'é¢ä¼°éé¢', |
| | | title: 'å«ç¨åä»·(å
)', |
| | | minWidth: 120, |
| | | formatter: ({ cellValue }) => erpPriceInputFormatter(cellValue) || '-', |
| | | }, |
| | |
| | | title: 'ç¨ç(%)', |
| | | minWidth: 90, |
| | | formatter: ({ cellValue }) => (cellValue ? `${cellValue}%` : '-'), |
| | | }, |
| | | { |
| | | field: 'totalPrice', |
| | | title: 'ä¸å«ç¨éé¢(å
)', |
| | | minWidth: 120, |
| | | formatter: ({ cellValue }) => erpPriceInputFormatter(cellValue) || '-', |
| | | }, |
| | | { |
| | | field: 'taxPrice', |
| | | title: 'ç¨é¢(å
)', |
| | | minWidth: 120, |
| | | formatter: ({ cellValue }) => erpPriceInputFormatter(cellValue) || '-', |
| | | }, |
| | | { |
| | | field: 'totalTaxInclusivePrice', |
| | | title: 'å«ç¨å计(å
)', |
| | | minWidth: 120, |
| | | formatter: ({ row }) => |
| | | erpPriceInputFormatter((row.totalPrice || 0) + (row.taxPrice || 0)) || '-', |
| | | }, |
| | | { field: 'demandTime', title: 'éæ±æ¥æ', minWidth: 110 }, |
| | | { |
| | |
| | | render: (val) => erpCountInputFormatter(val) || '-', |
| | | }, |
| | | { |
| | | label: 'å计éé¢', |
| | | label: 'å«ç¨å计éé¢', |
| | | field: 'totalPrice', |
| | | render: (val) => erpPriceInputFormatter(val) || '-', |
| | | }, |
| | |
| | | |
| | | const tableData = ref<ErpPurchaseRequestApi.PurchaseRequestItem[]>([]); |
| | | |
| | | /** è·åè¡¨æ ¼åè®¡æ°æ® */ |
| | | /** è·åè¡¨æ ¼åè®¡æ°æ®ï¼è¡ä¸ totalPrice 为ä¸å«ç¨éé¢ï¼å«ç¨å计éå ä¸ç¨é¢ï¼ */ |
| | | const summaries = computed(() => { |
| | | return { |
| | | count: tableData.value.reduce((sum, item) => sum + (item.count || 0), 0), |
| | | totalPrice: tableData.value.reduce( |
| | | (sum, item) => { |
| | | const price = erpPriceMultiply(item.productPrice || 0, item.count || 0) ?? 0; |
| | | return sum + price; |
| | | }, |
| | | (sum, item) => sum + (item.totalPrice || 0), |
| | | 0, |
| | | ), |
| | | taxPrice: tableData.value.reduce((sum, item) => sum + (item.taxPrice || 0), 0), |
| | | }; |
| | | }); |
| | | |
| | | /** å«ç¨å计 = ä¸å«ç¨éé¢ + ç¨é¢ */ |
| | | const totalTaxInclusivePrice = computed( |
| | | () => summaries.value.totalPrice + summaries.value.taxPrice, |
| | | ); |
| | | |
| | | /** è¡¨æ ¼é
ç½® */ |
| | | const [Grid, gridApi] = useVbenVxeGrid({ |
| | |
| | | handleRowChange(row); |
| | | } |
| | | |
| | | /** |
| | | * éç®è¡éé¢ï¼å价为**å«ç¨**åä»·ï¼ |
| | | * å«ç¨éé¢ = å«ç¨åä»· à æ°éï¼ç¨é¢ = å«ç¨éé¢ Ã ç¨çï¼ä¸å«ç¨éé¢ = å«ç¨éé¢ - ç¨é¢ |
| | | */ |
| | | function recalcRow(row: ErpPurchaseRequestApi.PurchaseRequestItem) { |
| | | if (row.productPrice && row.count) { |
| | | const taxInclusivePrice = erpPriceMultiply(row.productPrice, row.count) ?? 0; |
| | | row.taxPrice = |
| | | erpPriceMultiply(taxInclusivePrice, (row.taxPercent || 0) / 100) ?? 0; |
| | | row.totalPrice = taxInclusivePrice - row.taxPrice; |
| | | } |
| | | } |
| | | |
| | | /** å¤çè¡æ°æ®åæ´ */ |
| | | function handleRowChange(row: any) { |
| | | recalcRow(row); |
| | | const index = tableData.value.findIndex((item) => item.seq === row.seq); |
| | | if (index === -1) { |
| | | tableData.value.push(row); |
| | | } else { |
| | | tableData.value[index] = row; |
| | | } |
| | | // 计ç®é¢ä¼°éé¢ |
| | | if (row.productPrice && row.count) { |
| | | row.totalPrice = erpPriceMultiply(row.productPrice, row.count) ?? 0; |
| | | } |
| | | emit('update:items', [...tableData.value]); |
| | | } |
| | | |
| | | /** åå§åè¡æ°æ® */ |
| | | /** |
| | | * åå§åè¡æ°æ® |
| | | * å·²æåæ®çæç»è¡ï¼å¸¦ idï¼æ²¿ç¨å端è¿åçéé¢ï¼é¿å
åå²åæ®è¢«æ°å£å¾è¦çï¼ |
| | | * åªææªä¿åçæ°å¢è¡æææ°å£å¾éç®ã |
| | | */ |
| | | function initRow(row: ErpPurchaseRequestApi.PurchaseRequestItem) { |
| | | if (row.productPrice && row.count) { |
| | | row.totalPrice = erpPriceMultiply(row.productPrice, row.count) ?? 0; |
| | | if (!row.id) { |
| | | recalcRow(row); |
| | | } |
| | | } |
| | | |
| | |
| | | /> |
| | | <span v-else>{{ row.taxPercent ? `${row.taxPercent}%` : '-' }}</span> |
| | | </template> |
| | | <template #totalTaxInclusivePrice="{ row }"> |
| | | <span>{{ erpPriceInputFormatter((row.totalPrice || 0) + (row.taxPrice || 0)) }}</span> |
| | | </template> |
| | | <template #demandTime="{ row }"> |
| | | <DatePicker |
| | | v-if="!disabled" |
| | |
| | | <span class="font-medium text-foreground">å计ï¼</span> |
| | | <div class="flex space-x-4"> |
| | | <span>æ°éï¼{{ erpCountInputFormatter(summaries.count) }}</span> |
| | | <span>é¢ä¼°éé¢ï¼{{ erpPriceInputFormatter(summaries.totalPrice) }}</span> |
| | | <span>ä¸å«ç¨éé¢ï¼{{ erpPriceInputFormatter(summaries.totalPrice) }}</span> |
| | | <span>ç¨é¢ï¼{{ erpPriceInputFormatter(summaries.taxPrice) }}</span> |
| | | <span>å«ç¨å计ï¼{{ erpPriceInputFormatter(totalTaxInclusivePrice) }}</span> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | }, |
| | | { |
| | | fieldName: 'discountedPrice', |
| | | label: '伿 åéé¢', |
| | | label: '伿 åå«ç¨éé¢', |
| | | component: 'InputNumber', |
| | | componentProps: { |
| | | class: '!w-full', |
| | | placeholder: '伿 åéé¢', |
| | | placeholder: '伿 åå«ç¨éé¢', |
| | | precision: 2, |
| | | formatter: erpPriceInputFormatter, |
| | | disabled: true, |
| | |
| | | }, |
| | | { |
| | | field: 'productPrice', |
| | | title: '产ååä»·', |
| | | title: 'å«ç¨åä»·(å
)', |
| | | fixed: 'right', |
| | | minWidth: 120, |
| | | slots: { default: 'productPrice' }, |
| | | }, |
| | | { |
| | | field: 'totalProductPrice', |
| | | fixed: 'right', |
| | | title: '产åéé¢', |
| | | minWidth: 120, |
| | | formatter: 'formatAmount2', |
| | | }, |
| | | { |
| | | fixed: 'right', |
| | |
| | | slots: { default: 'taxPercent' }, |
| | | }, |
| | | { |
| | | field: 'totalProductPrice', |
| | | fixed: 'right', |
| | | title: 'ä¸å«ç¨éé¢(å
)', |
| | | minWidth: 120, |
| | | formatter: 'formatAmount2', |
| | | }, |
| | | { |
| | | fixed: 'right', |
| | | field: 'taxPrice', |
| | | title: 'ç¨é¢', |
| | | title: 'ç¨é¢(å
)', |
| | | minWidth: 120, |
| | | formatter: 'formatAmount2', |
| | | }, |
| | | { |
| | | field: 'totalPrice', |
| | | fixed: 'right', |
| | | title: 'å计éé¢', |
| | | title: 'å«ç¨å计(å
)', |
| | | minWidth: 120, |
| | | formatter: 'formatAmount2', |
| | | }, |
| | |
| | | }, |
| | | { |
| | | field: 'totalProductPrice', |
| | | title: 'éé¢å计', |
| | | title: 'ä¸å«ç¨éé¢å计', |
| | | formatter: 'formatAmount2', |
| | | minWidth: 120, |
| | | }, |
| | |
| | | /** å¤çè¡æ°æ®åæ´ */ |
| | | function handleRowChange(row: any) { |
| | | // TODO èè¿ |
| | | recalcRow(row); |
| | | const index = tableData.value.findIndex((item) => item.seq === row.seq); |
| | | if (index === -1) { |
| | | tableData.value.push(row); |
| | |
| | | emit('update:items', [...tableData.value]); |
| | | } |
| | | |
| | | /** åå§åè¡æ°æ® */ |
| | | function initRow(row: ErpPurchaseReturnApi.PurchaseReturnItem) { |
| | | /** |
| | | * éç®è¡éé¢ï¼å价为**å«ç¨**åä»·ï¼ |
| | | * å«ç¨éé¢ = å«ç¨åä»· à æ°éï¼ç¨é¢ = å«ç¨éé¢ Ã ç¨çï¼ä¸å«ç¨éé¢ = å«ç¨éé¢ - ç¨é¢ |
| | | */ |
| | | function recalcRow(row: ErpPurchaseReturnApi.PurchaseReturnItem) { |
| | | if (row.productPrice && row.count) { |
| | | row.totalProductPrice = erpPriceMultiply(row.productPrice, row.count) ?? 0; |
| | | const taxInclusivePrice = erpPriceMultiply(row.productPrice, row.count) ?? 0; |
| | | row.taxPrice = |
| | | erpPriceMultiply(row.totalProductPrice, (row.taxPercent || 0) / 100) ?? 0; |
| | | row.totalPrice = row.totalProductPrice + row.taxPrice; |
| | | erpPriceMultiply(taxInclusivePrice, (row.taxPercent || 0) / 100) ?? 0; |
| | | row.totalProductPrice = taxInclusivePrice - row.taxPrice; |
| | | row.totalPrice = taxInclusivePrice; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * åå§åè¡æ°æ® |
| | | * å·²æåæ®çæç»è¡ï¼å¸¦ idï¼æ²¿ç¨å端è¿åçéé¢ï¼é¿å
åå²åæ®è¢«æ°å£å¾è¦çï¼ |
| | | * åªææªä¿åçæ°å¢è¡æææ°å£å¾éç®ã |
| | | */ |
| | | function initRow(row: ErpPurchaseReturnApi.PurchaseReturnItem) { |
| | | if (!row.id) { |
| | | recalcRow(row); |
| | | } |
| | | } |
| | | |
| | |
| | | <div class="flex space-x-4"> |
| | | <span>æ°éï¼{{ erpCountInputFormatter(summaries.count) }}</span> |
| | | <span> |
| | | éé¢ï¼{{ erpPriceInputFormatter(summaries.totalProductPrice) }} |
| | | ä¸å«ç¨éé¢ï¼{{ erpPriceInputFormatter(summaries.totalProductPrice) }} |
| | | </span> |
| | | <span>ç¨é¢ï¼{{ erpPriceInputFormatter(summaries.taxPrice) }}</span> |
| | | <span> |
| | | ç¨é¢å计ï¼{{ erpPriceInputFormatter(summaries.totalPrice) }} |
| | | å«ç¨å计ï¼{{ erpPriceInputFormatter(summaries.totalPrice) }} |
| | | </span> |
| | | </div> |
| | | </div> |
| | |
| | | { field: 'customerName', title: '客æ·', minWidth: 120 }, |
| | | { field: 'orderTime', title: 'è®¢åæ¶é´', width: 120, formatter: 'formatDate' }, |
| | | { field: 'totalCount', title: 'å计æ°é', width: 100 }, |
| | | { field: 'totalPrice', title: 'å计éé¢', width: 100 }, |
| | | { field: 'totalPrice', title: 'å«ç¨å计', width: 100 }, |
| | | ]; |
| | | } |
| | | |
| | |
| | | <div>订åå·ï¼{{ selectedItem.no || '-' }}</div> |
| | | <div>客æ·ï¼{{ selectedItem.customerName || '-' }}</div> |
| | | <div>è®¢åæ¶é´ï¼{{ selectedItem.orderTime || '-' }}</div> |
| | | <div>å计éé¢ï¼{{ selectedItem.totalPrice || '-' }} å
</div> |
| | | <div>å«ç¨å计ï¼{{ selectedItem.totalPrice || '-' }} å
</div> |
| | | </div> |
| | | </template> |
| | | <Input |
| | |
| | | }, |
| | | { |
| | | fieldName: 'totalPrice', |
| | | label: '伿 åéé¢', |
| | | label: '伿 åå«ç¨éé¢', |
| | | component: 'InputNumber', |
| | | componentProps: { |
| | | class: '!w-full', |
| | | placeholder: '伿 åéé¢', |
| | | placeholder: '伿 åå«ç¨éé¢', |
| | | precision: 2, |
| | | formatter: erpPriceInputFormatter, |
| | | disabled: true, |
| | |
| | | return z |
| | | .number() |
| | | .min(0, '订éä¸è½å°äº0') |
| | | .max(values.totalPrice, 'æ¶å订éä¸è½å¤§äºä¼æ åéé¢'); |
| | | .max(values.totalPrice, 'æ¶å订éä¸è½å¤§äºä¼æ åå«ç¨éé¢'); |
| | | } |
| | | return z.number().min(0, '订éä¸è½å°äº0').optional(); |
| | | }, |
| | |
| | | }, |
| | | { |
| | | field: 'productPrice', |
| | | title: '产ååä»·', |
| | | title: 'å«ç¨åä»·(å
)', |
| | | minWidth: 120, |
| | | fixed: 'right', |
| | | slots: { default: 'productPrice' }, |
| | | }, |
| | | { |
| | | field: 'totalProductPrice', |
| | | title: 'éé¢', |
| | | minWidth: 120, |
| | | fixed: 'right', |
| | | formatter: 'formatAmount2', |
| | | }, |
| | | { |
| | | field: 'taxPercent', |
| | |
| | | slots: { default: 'taxPercent' }, |
| | | }, |
| | | { |
| | | field: 'totalProductPrice', |
| | | title: 'ä¸å«ç¨éé¢(å
)', |
| | | minWidth: 120, |
| | | fixed: 'right', |
| | | formatter: 'formatAmount2', |
| | | }, |
| | | { |
| | | field: 'taxPrice', |
| | | title: 'ç¨é¢', |
| | | title: 'ç¨é¢(å
)', |
| | | minWidth: 120, |
| | | fixed: 'right', |
| | | formatter: 'formatAmount2', |
| | | }, |
| | | { |
| | | field: 'totalPrice', |
| | | title: 'ç¨é¢å计', |
| | | title: 'å«ç¨å计(å
)', |
| | | minWidth: 120, |
| | | fixed: 'right', |
| | | formatter: 'formatAmount2', |
| | |
| | | }, |
| | | { |
| | | field: 'totalProductPrice', |
| | | title: 'éé¢å计', |
| | | title: 'ä¸å«ç¨éé¢å计', |
| | | formatter: 'formatAmount2', |
| | | minWidth: 120, |
| | | }, |
| | |
| | | render: (val) => erpCountInputFormatter(val) || '-', |
| | | }, |
| | | { |
| | | label: 'å计éé¢', |
| | | label: 'å«ç¨å计éé¢', |
| | | field: 'totalPrice', |
| | | render: (val) => erpPriceInputFormatter(val) || '-', |
| | | }, |
| | |
| | | |
| | | /** å¤çè¡æ°æ®åæ´ */ |
| | | function handleRowChange(row: any) { |
| | | recalcRow(row); |
| | | const index = tableData.value.findIndex((item) => item.seq === row.seq); |
| | | if (index === -1) { |
| | | tableData.value.push(row); |
| | |
| | | emit('update:items', [...tableData.value]); |
| | | } |
| | | |
| | | /** åå§åè¡æ°æ® */ |
| | | function initRow(row: ErpSaleOrderApi.SaleOrderItem) { |
| | | /** |
| | | * éç®è¡éé¢ï¼å价为**å«ç¨**åä»·ï¼ |
| | | * å«ç¨éé¢ = å«ç¨åä»· à æ°éï¼ç¨é¢ = å«ç¨éé¢ Ã ç¨çï¼ä¸å«ç¨éé¢ = å«ç¨éé¢ - ç¨é¢ |
| | | */ |
| | | function recalcRow(row: ErpSaleOrderApi.SaleOrderItem) { |
| | | if (row.productPrice && row.count) { |
| | | row.totalProductPrice = erpPriceMultiply(row.productPrice, row.count) ?? 0; |
| | | const taxInclusivePrice = erpPriceMultiply(row.productPrice, row.count) ?? 0; |
| | | row.taxPrice = |
| | | erpPriceMultiply(row.totalProductPrice, (row.taxPercent || 0) / 100) ?? 0; |
| | | row.totalPrice = row.totalProductPrice + row.taxPrice; |
| | | erpPriceMultiply(taxInclusivePrice, (row.taxPercent || 0) / 100) ?? 0; |
| | | row.totalProductPrice = taxInclusivePrice - row.taxPrice; |
| | | row.totalPrice = taxInclusivePrice; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * åå§åè¡æ°æ® |
| | | * å·²æåæ®çæç»è¡ï¼å¸¦ idï¼æ²¿ç¨å端è¿åçéé¢ï¼é¿å
åå²åæ®è¢«æ°å£å¾è¦çï¼ |
| | | * åªææªä¿åçæ°å¢è¡æææ°å£å¾éç®ã |
| | | */ |
| | | function initRow(row: ErpSaleOrderApi.SaleOrderItem) { |
| | | if (!row.id) { |
| | | recalcRow(row); |
| | | } |
| | | // é»è®¤éè¦ç产 |
| | | if (row.needProduction === undefined) { |
| | |
| | | <div class="flex space-x-4"> |
| | | <span>æ°éï¼{{ erpCountInputFormatter(summaries.count) }}</span> |
| | | <span> |
| | | éé¢ï¼{{ erpPriceInputFormatter(summaries.totalProductPrice) }} |
| | | ä¸å«ç¨éé¢ï¼{{ erpPriceInputFormatter(summaries.totalProductPrice) }} |
| | | </span> |
| | | <span>ç¨é¢ï¼{{ erpPriceInputFormatter(summaries.taxPrice) }}</span> |
| | | <span> |
| | | ç¨é¢å计ï¼{{ erpPriceInputFormatter(summaries.totalPrice) }} |
| | | å«ç¨å计ï¼{{ erpPriceInputFormatter(summaries.totalPrice) }} |
| | | </span> |
| | | </div> |
| | | </div> |
| | |
| | | } |
| | | |
| | | /** |
| | | * æç»è¡ï¼å端ä¸è¿åæç»è¡ç totalProductPrice/totalPriceï¼éæåä»·Ãæ°é计ç®ï¼ |
| | | * éé¢ = åä»· à æ°éï¼ç¨é¢ = éé¢ Ã ç¨çï¼å«ç¨éé¢ = éé¢ + ç¨é¢ï¼ |
| | | * æç»è¡ï¼ä¼å
ç¨å端è¿åå¼ï¼ç¼ºçæ¶æãå价为å«ç¨åä»·ã计ç®ï¼ |
| | | * å«ç¨éé¢ = å«ç¨åä»· à æ°éï¼ç¨é¢ = å«ç¨éé¢ Ã ç¨çï¼ä¸å«ç¨éé¢ = å«ç¨éé¢ - ç¨é¢ï¼ |
| | | */ |
| | | const printRows = computed(() => |
| | | (printData.value.items || []).map((item) => { |
| | | const totalProductPrice = |
| | | item.totalProductPrice ?? multiplyPrice(item.productPrice, item.count) ?? 0; |
| | | const taxInclusivePrice = multiplyPrice(item.productPrice, item.count); |
| | | const taxPrice = |
| | | item.taxPrice ?? multiplyPrice(totalProductPrice, (item.taxPercent ?? 0) / 100) ?? 0; |
| | | const totalPrice = item.totalPrice ?? totalProductPrice + taxPrice; |
| | | item.taxPrice ?? multiplyPrice(taxInclusivePrice, (item.taxPercent ?? 0) / 100) ?? 0; |
| | | const totalPrice = item.totalPrice ?? taxInclusivePrice ?? 0; |
| | | const totalProductPrice = item.totalProductPrice ?? totalPrice - taxPrice; |
| | | return { ...item, totalProductPrice, taxPrice, totalPrice }; |
| | | }), |
| | | ); |
| | | |
| | | /** æç»åè®¡ï¼æ°é/éé¢ä¼å
å订å头ï¼å端æå¨å¼ï¼ï¼ç¨é¢ä¸å«ç¨é颿æç»ç´¯å ï¼è®¢å头 totalPrice ä¸ºä¼æ åéé¢ï¼å¦å¨éé¢ä¿¡æ¯åºå±ç¤ºï¼ */ |
| | | /** æç»åè®¡ï¼æ°é/éé¢ä¼å
å订å头ï¼å端æå¨å¼ï¼ï¼ç¨é¢ä¸å«ç¨é颿æç»ç´¯å ï¼è®¢å头 totalPrice ä¸ºä¼æ åå«ç¨éé¢ï¼å¦å¨éé¢ä¿¡æ¯åºå±ç¤ºï¼ */ |
| | | const summaries = computed(() => { |
| | | const rows = printRows.value; |
| | | const count = rows.reduce((sum, item) => sum + (item.count || 0), 0); |
| | |
| | | <th |
| | | class="border border-solid border-[#dcdfe6] bg-[#f5f7fa] p-2 text-right font-bold" |
| | | > |
| | | 产ååä»·(å
) |
| | | </th> |
| | | <th |
| | | class="border border-solid border-[#dcdfe6] bg-[#f5f7fa] p-2 text-right font-bold" |
| | | > |
| | | éé¢(å
) |
| | | å«ç¨åä»·(å
) |
| | | </th> |
| | | <th |
| | | class="border border-solid border-[#dcdfe6] bg-[#f5f7fa] p-2 text-right font-bold" |
| | | > |
| | | ç¨ç(%) |
| | | </th> |
| | | <th |
| | | class="border border-solid border-[#dcdfe6] bg-[#f5f7fa] p-2 text-right font-bold" |
| | | > |
| | | ä¸å«ç¨éé¢(å
) |
| | | </th> |
| | | <th |
| | | class="border border-solid border-[#dcdfe6] bg-[#f5f7fa] p-2 text-right font-bold" |
| | |
| | | {{ formatPrice(item.productPrice) }} |
| | | </td> |
| | | <td class="border border-solid border-[#dcdfe6] p-2 text-right"> |
| | | {{ formatPrice(item.totalProductPrice) }} |
| | | {{ formatPrice(item.taxPercent) }} |
| | | </td> |
| | | <td class="border border-solid border-[#dcdfe6] p-2 text-right"> |
| | | {{ formatPrice(item.taxPercent) }} |
| | | {{ formatPrice(item.totalProductPrice) }} |
| | | </td> |
| | | <td class="border border-solid border-[#dcdfe6] p-2 text-right"> |
| | | {{ formatPrice(item.taxPrice) }} |
| | |
| | | class="border border-solid border-[#dcdfe6] bg-[#f5f7fa] p-2" |
| | | ></td> |
| | | <td |
| | | class="border border-solid border-[#dcdfe6] bg-[#f5f7fa] p-2" |
| | | ></td> |
| | | <td |
| | | class="border border-solid border-[#dcdfe6] bg-[#f5f7fa] p-2 text-right" |
| | | > |
| | | {{ formatPrice(summaries.totalProductPrice) }} |
| | | </td> |
| | | <td |
| | | class="border border-solid border-[#dcdfe6] bg-[#f5f7fa] p-2" |
| | | ></td> |
| | | <td |
| | | class="border border-solid border-[#dcdfe6] bg-[#f5f7fa] p-2 text-right" |
| | | > |
| | |
| | | > |
| | | <div>伿 ç(%)ï¼{{ formatPrice(printData.discountPercent) }}</div> |
| | | <div>仿¬¾ä¼æ (å
)ï¼{{ formatPrice(printData.discountPrice) }}</div> |
| | | <div>伿 åéé¢(å
)ï¼{{ formatPrice(printData.totalPrice) }}</div> |
| | | <div>伿 åå«ç¨éé¢(å
)ï¼{{ formatPrice(printData.totalPrice) }}</div> |
| | | <div>æ¶å订é(å
)ï¼{{ formatPrice(printData.depositPrice) }}</div> |
| | | </div> |
| | | |
| | |
| | | }, |
| | | { |
| | | fieldName: 'discountedPrice', |
| | | label: '伿 åéé¢', |
| | | label: '伿 åå«ç¨éé¢', |
| | | component: 'InputNumber', |
| | | componentProps: { |
| | | class: '!w-full', |
| | | placeholder: '伿 åéé¢', |
| | | placeholder: '伿 åå«ç¨éé¢', |
| | | precision: 2, |
| | | formatter: erpPriceInputFormatter, |
| | | disabled: true, |
| | |
| | | }, |
| | | { |
| | | field: 'productPrice', |
| | | title: '产ååä»·', |
| | | title: 'å«ç¨åä»·(å
)', |
| | | fixed: 'right', |
| | | minWidth: 120, |
| | | slots: { default: 'productPrice' }, |
| | | }, |
| | | { |
| | | field: 'totalProductPrice', |
| | | fixed: 'right', |
| | | title: '产åéé¢', |
| | | minWidth: 120, |
| | | formatter: 'formatAmount2', |
| | | }, |
| | | { |
| | | fixed: 'right', |
| | |
| | | slots: { default: 'taxPercent' }, |
| | | }, |
| | | { |
| | | field: 'totalProductPrice', |
| | | fixed: 'right', |
| | | title: 'ä¸å«ç¨éé¢(å
)', |
| | | minWidth: 120, |
| | | formatter: 'formatAmount2', |
| | | }, |
| | | { |
| | | fixed: 'right', |
| | | field: 'taxPrice', |
| | | title: 'ç¨é¢', |
| | | title: 'ç¨é¢(å
)', |
| | | minWidth: 120, |
| | | formatter: 'formatAmount2', |
| | | }, |
| | | { |
| | | field: 'totalPrice', |
| | | fixed: 'right', |
| | | title: 'å计éé¢', |
| | | title: 'å«ç¨å计(å
)', |
| | | minWidth: 120, |
| | | formatter: 'formatAmount2', |
| | | }, |
| | |
| | | }, |
| | | { |
| | | field: 'totalProductPrice', |
| | | title: 'éé¢å计', |
| | | title: 'ä¸å«ç¨éé¢å计', |
| | | formatter: 'formatAmount2', |
| | | minWidth: 120, |
| | | }, |
| | |
| | | |
| | | /** å¤çè¡æ°æ®åæ´ */ |
| | | function handleRowChange(row: any) { |
| | | recalcRow(row); |
| | | const index = tableData.value.findIndex((item) => item.seq === row.seq); |
| | | if (index === -1) { |
| | | tableData.value.push(row); |
| | |
| | | emit('update:items', [...tableData.value]); |
| | | } |
| | | |
| | | /** åå§åè¡æ°æ® */ |
| | | function initRow(row: ErpSaleOutApi.SaleOutItem) { |
| | | /** |
| | | * éç®è¡éé¢ï¼å价为**å«ç¨**åä»·ï¼ |
| | | * å«ç¨éé¢ = å«ç¨åä»· à æ°éï¼ç¨é¢ = å«ç¨éé¢ Ã ç¨çï¼ä¸å«ç¨éé¢ = å«ç¨éé¢ - ç¨é¢ |
| | | */ |
| | | function recalcRow(row: ErpSaleOutApi.SaleOutItem) { |
| | | if (row.productPrice && row.count) { |
| | | row.totalProductPrice = erpPriceMultiply(row.productPrice, row.count) ?? 0; |
| | | const taxInclusivePrice = erpPriceMultiply(row.productPrice, row.count) ?? 0; |
| | | row.taxPrice = |
| | | erpPriceMultiply(row.totalProductPrice, (row.taxPercent || 0) / 100) ?? 0; |
| | | row.totalPrice = row.totalProductPrice + row.taxPrice; |
| | | erpPriceMultiply(taxInclusivePrice, (row.taxPercent || 0) / 100) ?? 0; |
| | | row.totalProductPrice = taxInclusivePrice - row.taxPrice; |
| | | row.totalPrice = taxInclusivePrice; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * åå§åè¡æ°æ® |
| | | * å·²æåæ®çæç»è¡ï¼å¸¦ idï¼æ²¿ç¨å端è¿åçéé¢ï¼é¿å
åå²åæ®è¢«æ°å£å¾è¦çï¼ |
| | | * åªææªä¿åçæ°å¢è¡æææ°å£å¾éç®ã |
| | | */ |
| | | function initRow(row: ErpSaleOutApi.SaleOutItem) { |
| | | if (!row.id) { |
| | | recalcRow(row); |
| | | } |
| | | } |
| | | |
| | |
| | | <div class="flex space-x-4"> |
| | | <span>æ°éï¼{{ erpCountInputFormatter(summaries.count) }}</span> |
| | | <span> |
| | | éé¢ï¼{{ erpPriceInputFormatter(summaries.totalProductPrice) }} |
| | | ä¸å«ç¨éé¢ï¼{{ erpPriceInputFormatter(summaries.totalProductPrice) }} |
| | | </span> |
| | | <span>ç¨é¢ï¼{{ erpPriceInputFormatter(summaries.taxPrice) }}</span> |
| | | <span> |
| | | ç¨é¢å计ï¼{{ erpPriceInputFormatter(summaries.totalPrice) }} |
| | | å«ç¨å计ï¼{{ erpPriceInputFormatter(summaries.totalPrice) }} |
| | | </span> |
| | | </div> |
| | | </div> |
| | |
| | | }, |
| | | { |
| | | fieldName: 'discountedPrice', |
| | | label: '伿 åéé¢', |
| | | label: '伿 åå«ç¨éé¢', |
| | | component: 'InputNumber', |
| | | componentProps: { |
| | | class: '!w-full', |
| | | placeholder: '伿 åéé¢', |
| | | placeholder: '伿 åå«ç¨éé¢', |
| | | precision: 2, |
| | | formatter: erpPriceInputFormatter, |
| | | disabled: true, |
| | |
| | | }, |
| | | { |
| | | field: 'productPrice', |
| | | title: '产ååä»·', |
| | | title: 'å«ç¨åä»·(å
)', |
| | | fixed: 'right', |
| | | minWidth: 120, |
| | | slots: { default: 'productPrice' }, |
| | | }, |
| | | { |
| | | field: 'totalProductPrice', |
| | | fixed: 'right', |
| | | title: '产åéé¢', |
| | | minWidth: 120, |
| | | formatter: 'formatAmount2', |
| | | }, |
| | | { |
| | | fixed: 'right', |
| | |
| | | slots: { default: 'taxPercent' }, |
| | | }, |
| | | { |
| | | field: 'totalProductPrice', |
| | | fixed: 'right', |
| | | title: 'ä¸å«ç¨éé¢(å
)', |
| | | minWidth: 120, |
| | | formatter: 'formatAmount2', |
| | | }, |
| | | { |
| | | fixed: 'right', |
| | | field: 'taxPrice', |
| | | title: 'ç¨é¢', |
| | | title: 'ç¨é¢(å
)', |
| | | minWidth: 120, |
| | | formatter: 'formatAmount2', |
| | | }, |
| | | { |
| | | field: 'totalPrice', |
| | | fixed: 'right', |
| | | title: 'å计éé¢', |
| | | title: 'å«ç¨å计(å
)', |
| | | minWidth: 120, |
| | | formatter: 'formatAmount2', |
| | | }, |
| | |
| | | }, |
| | | { |
| | | field: 'totalProductPrice', |
| | | title: 'éé¢å计', |
| | | title: 'ä¸å«ç¨éé¢å计', |
| | | formatter: 'formatAmount2', |
| | | minWidth: 120, |
| | | }, |
| | |
| | | |
| | | /** å¤çè¡æ°æ®åæ´ */ |
| | | function handleRowChange(row: any) { |
| | | recalcRow(row); |
| | | const index = tableData.value.findIndex((item) => item.seq === row.seq); |
| | | if (index === -1) { |
| | | tableData.value.push(row); |
| | |
| | | emit('update:items', [...tableData.value]); |
| | | } |
| | | |
| | | /** åå§åè¡æ°æ® */ |
| | | function initRow(row: ErpSaleReturnApi.SaleReturnItem) { |
| | | /** |
| | | * éç®è¡éé¢ï¼å价为**å«ç¨**åä»·ï¼ |
| | | * å«ç¨éé¢ = å«ç¨åä»· à æ°éï¼ç¨é¢ = å«ç¨éé¢ Ã ç¨çï¼ä¸å«ç¨éé¢ = å«ç¨éé¢ - ç¨é¢ |
| | | */ |
| | | function recalcRow(row: ErpSaleReturnApi.SaleReturnItem) { |
| | | if (row.productPrice && row.count) { |
| | | row.totalProductPrice = erpPriceMultiply(row.productPrice, row.count) ?? 0; |
| | | const taxInclusivePrice = erpPriceMultiply(row.productPrice, row.count) ?? 0; |
| | | row.taxPrice = |
| | | erpPriceMultiply(row.totalProductPrice, (row.taxPercent || 0) / 100) ?? 0; |
| | | row.totalPrice = row.totalProductPrice + row.taxPrice; |
| | | erpPriceMultiply(taxInclusivePrice, (row.taxPercent || 0) / 100) ?? 0; |
| | | row.totalProductPrice = taxInclusivePrice - row.taxPrice; |
| | | row.totalPrice = taxInclusivePrice; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * åå§åè¡æ°æ® |
| | | * å·²æåæ®çæç»è¡ï¼å¸¦ idï¼æ²¿ç¨å端è¿åçéé¢ï¼é¿å
åå²åæ®è¢«æ°å£å¾è¦çï¼ |
| | | * åªææªä¿åçæ°å¢è¡æææ°å£å¾éç®ã |
| | | */ |
| | | function initRow(row: ErpSaleReturnApi.SaleReturnItem) { |
| | | if (!row.id) { |
| | | recalcRow(row); |
| | | } |
| | | } |
| | | |
| | |
| | | <div class="flex space-x-4"> |
| | | <span>æ°éï¼{{ erpCountInputFormatter(summaries.count) }}</span> |
| | | <span> |
| | | éé¢ï¼{{ erpPriceInputFormatter(summaries.totalProductPrice) }} |
| | | ä¸å«ç¨éé¢ï¼{{ erpPriceInputFormatter(summaries.totalProductPrice) }} |
| | | </span> |
| | | <span>ç¨é¢ï¼{{ erpPriceInputFormatter(summaries.taxPrice) }}</span> |
| | | <span> |
| | | ç¨é¢å计ï¼{{ erpPriceInputFormatter(summaries.totalPrice) }} |
| | | å«ç¨å计ï¼{{ erpPriceInputFormatter(summaries.totalPrice) }} |
| | | </span> |
| | | </div> |
| | | </div> |
| | |
| | | label: 'ç产订å', |
| | | component: markRaw(ProWorkOrderSelect), |
| | | componentProps: { |
| | | placeholder: 'è¯·éæ©ç产订å', |
| | | allowClear: true, |
| | | placeholder: 'è¯·éæ©ç产订åï¼éå¡«ï¼', |
| | | status: MesProWorkOrderStatusEnum.CONFIRMED, |
| | | // 订ååæ´æ¶æ¸
空çäº§ä»»å¡ |
| | | onChange: () => formApi?.setFieldValue('taskId', undefined), |
| | | }, |
| | | rules: 'selectRequired', |
| | | dependencies: { |
| | | triggerFields: ['sourceDocId'], |
| | | componentProps: (values) => ({ |
| | | allowClear: true, |
| | | disabled: !!values.sourceDocId, |
| | | placeholder: 'è¯·éæ©ç产订å', |
| | | placeholder: 'è¯·éæ©ç产订åï¼éå¡«ï¼', |
| | | status: MesProWorkOrderStatusEnum.CONFIRMED, |
| | | onChange: () => formApi?.setFieldValue('taskId', undefined), |
| | | }), |
| | |
| | | label: 'å·¥ä½', |
| | | component: markRaw(MdWorkstationSelect), |
| | | componentProps: { |
| | | placeholder: 'è¯·éæ©å·¥ä½', |
| | | allowClear: true, |
| | | placeholder: 'è¯·éæ©å·¥ä½ï¼éå¡«ï¼', |
| | | }, |
| | | rules: 'selectRequired', |
| | | dependencies: { |
| | | triggerFields: ['sourceDocId'], |
| | | componentProps: (values) => ({ |
| | | allowClear: true, |
| | | disabled: !!values.sourceDocId, |
| | | placeholder: 'è¯·éæ©å·¥ä½', |
| | | placeholder: 'è¯·éæ©å·¥ä½ï¼éå¡«ï¼', |
| | | }), |
| | | }, |
| | | }, |
| | |
| | | autoSelect: 'first', |
| | | labelField: 'templateName', |
| | | valueField: 'templateId', |
| | | disabled: formType !== 'create' || !values.workOrderId, |
| | | params: values.workOrderId |
| | | ? { |
| | | qcType: 2, |
| | | workOrderId: values.workOrderId, |
| | | taskId: values.taskId, |
| | | } |
| | | : {}, |
| | | placeholder: values.workOrderId |
| | | ? 'è¯·éæ©è´¨æ£æ¹æ¡' |
| | | : '请å
éæ©ç产订å', |
| | | disabled: formType !== 'create', |
| | | // æªéç产订å/çäº§ä»»å¡æ¶ï¼å端æãè¿ç¨æ£éªãç§ç±»è¿åå
¨é¨å¯ç¨æ¹æ¡ï¼ä¸åè¦æ±å
éç产订åï¼ |
| | | params: { |
| | | qcType: 2, |
| | | ...(values.workOrderId ? { workOrderId: values.workOrderId } : {}), |
| | | ...(values.taskId ? { taskId: values.taskId } : {}), |
| | | }, |
| | | placeholder: 'è¯·éæ©è´¨æ£æ¹æ¡', |
| | | }), |
| | | }, |
| | | }, |