From f3d4db769ba9b51b799d981511a710fd443d0e08 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期一, 21 四月 2025 12:18:03 +0800
Subject: [PATCH] Merge branch 'master' into positec

---
 src/menu/components/module/invoice/index.jsx |  104 +++++++++++++++++++++++++++++++++++++++++++++------
 1 files changed, 91 insertions(+), 13 deletions(-)

diff --git a/src/menu/components/module/invoice/index.jsx b/src/menu/components/module/invoice/index.jsx
index 0885bec..b553ab7 100644
--- a/src/menu/components/module/invoice/index.jsx
+++ b/src/menu/components/module/invoice/index.jsx
@@ -1,14 +1,15 @@
 import React, {Component} from 'react'
 import PropTypes from 'prop-types'
 import { is, fromJS } from 'immutable'
-import { Popover, Button } from 'antd'
-import { EditOutlined, ToolOutlined, DeleteOutlined, FontColorsOutlined, EllipsisOutlined, SettingOutlined } from '@ant-design/icons'
+import { Popover, Button, Modal } from 'antd'
+import { EditOutlined, ToolOutlined, DeleteOutlined, LeftOutlined, FontColorsOutlined, EllipsisOutlined, SettingOutlined } from '@ant-design/icons'
 import moment from 'moment'
 
 import Utils from '@/utils/utils.js'
 import asyncIconComponent from '@/utils/asyncIconComponent'
 import { getTables, checkComponent } from '@/utils/utils-custom.js'
 import MKEmitter from '@/utils/events.js'
+import VerifyCard from './verifycard'
 import getWrapForm from './options'
 
 import './index.scss'
@@ -25,7 +26,8 @@
 
   state = {
     card: null,
-    date: moment().format('YYYY骞碝M鏈�')
+    date: moment().format('YYYY骞碝M鏈�'),
+    btn: null
   }
 
   UNSAFE_componentWillMount () {
@@ -35,20 +37,22 @@
       let _card = {
         uuid: card.uuid,
         type: card.type,
-        format: 'object',   // 缁勪欢灞炴�� - 鏁版嵁鏍煎紡
+        format: 'array',    // 缁勪欢灞炴�� - 鏁版嵁鏍煎紡
         pageable: false,    // 缁勪欢灞炴�� - 鏄惁鍙垎椤�
         switchable: false,  // 缁勪欢灞炴�� - 鏁版嵁鏄惁鍙垏鎹�
         width: card.width || 24,
         name: '鍙戠エ',
         subtype: card.subtype,
+        fixedCol: true,
         wrap: { name: '鍙戠エ', width: card.width || 24, datatype: 'static' },
         style: { paddingLeft: '20px', paddingRight: '20px', paddingTop: '10px', paddingBottom: '10px' },
-        setting: { interType: 'system' },
+        setting: { interType: 'system', primaryKey: 'ID' },
         columns: [],
         scripts: [],
         buyer: {
           pageable: true,
           format: 'array',
+          fixedCol: true,
           subtype: 'invTable',
           setting: { interType: 'system' },
           columns: [],
@@ -61,6 +65,7 @@
         detail: {
           pageable: true,
           format: 'array',
+          fixedCol: true,
           subtype: 'invTable',
           setting: { interType: 'system' },
           columns: [],
@@ -69,7 +74,9 @@
             {field: 'productname', label: '鍟嗗搧鍚嶇О', initval: '', type: 'text', match: 'like', uuid: Utils.getuuid()},
             {field: 'productcode', label: '鍟嗗搧缂栫爜', initval: '', type: 'text', match: 'like', uuid: Utils.getuuid()},
           ],
-        }
+        },
+        billSaveBtn: {type: 'billsave', parId: card.uuid, intertype: 'system', label: '淇濆瓨鍗曟嵁'},
+        billOutBtn: {type: 'billout', parId: card.uuid, intertype: 'custom', label: '鎻愪氦寮�绁�', procMode: 'system'},
       }
 
       let buys = [
@@ -98,7 +105,12 @@
         ['鍗曚环', 'unitprice', 'Decimal(18,10)'],
         ['绋庡姟鍒嗙被缂栫爜', 'tax_classify_code'],
         ['绋庡姟鍒嗙被鍚嶇О', 'tax_classify_name'],
-        ['绋庣巼', 'tax_rate'],
+        ['涓�鑸撼绋庝汉绋庣巼', 'general_tax_rate', 'Decimal(18,2)'],
+        ['灏忚妯$撼绋庝汉寰佹敹鐜�', 'small_tax_rate', 'Decimal(18,2)'],
+        ['鏄惁浜彈浼樻儬鏀跨瓥', 'free_tax_mark'],
+        ['浼樻儬鏀跨瓥绫诲瀷', 'vat_special_management'],
+        ['寰佺◣椤圭洰', 'tax_item'],
+        ['璁$◣鏂规硶', 'tax_method'],
       ]
 
       details.forEach((cell, index) => {
@@ -106,7 +118,10 @@
       })
 
       let cols = [
+        ['ID', 'ID'],
+        ['寮�绁ㄧ敵璇峰崟鍙�', 'io'],
         ['鍙戠エ绉嶇被', 'invoice_type'],
+        ['寮�绁ㄧ被鍨�', 'business_type', 'Nvarchar(20)'],
         ['璐拱鏂瑰悕绉�', 'from_to_name'],
         ['璐拱鏂圭◣鍙�', 'from_to_tax_no'],
         ['璐拱鏂瑰湴鍧�', 'from_to_addr', 'Nvarchar(100)'],
@@ -126,6 +141,8 @@
         ['鏀舵浜�', 'payee'],
         ['澶嶆牳浜�', 'reviewer'],
         ['寮�绁ㄤ汉', 'drawer'],
+        ['jskey', 'jskey'],
+        ['琛屽彿', 'invoice_lp'],
         ['鍟嗗搧缂栫爜', 'productcode'],
         ['鍟嗗搧鍚嶇О', 'productname'],
         ['瑙勬牸鍨嬪彿', 'spec'],
@@ -137,6 +154,14 @@
         ['绋庡姟鍒嗙被鍚嶇О', 'tax_classify_name'],
         ['绋庣巼', 'tax_rate', 'Decimal(18,2)'],
         ['绋庨', 'tax_amount', 'Decimal(18,2)'],
+        ['鏄惁浜彈浼樻儬鏀跨瓥', 'free_tax_mark'],
+        ['浼樻儬鏀跨瓥绫诲瀷', 'vat_special_management'],
+        ['寰佺◣椤圭洰', 'tax_item'],
+        ['璁$◣鏂规硶', 'tax_method'],
+        ['鍙戠エ鍙风爜', 'invoice_no'],
+        ['鍙戠エ浠g爜', 'invoice_code'],
+        ['寮�绁ㄦ棩鏈�', 'invoice_date'],
+        ['鍙(true)', 'read_only'],
       ]
 
       cols.forEach((cell, index) => {
@@ -146,9 +171,6 @@
       this.updateComponent(_card)
     } else {
       let _card = fromJS(card).toJS()
-
-      // _card.buyer.format = 'array'
-      // _card.detail.format = 'array'
 
       this.setState({
         card: _card
@@ -188,6 +210,8 @@
     card.$c_ds = card.wrap.datatype === 'dynamic'
     card.errors = checkComponent(card)
 
+    delete card.$c_ds
+
     if (card.errors.length === 0) {
       if (card.buyer.setting.interType === 'system' && card.buyer.setting.execute !== 'false' && !card.buyer.setting.dataresource) {
         card.errors.push({ level: 0, detail: '-璐拱鏂� 鏈缃暟鎹簮锛�'})
@@ -201,6 +225,14 @@
       } else if (card.detail.setting.interType === 'system' && card.detail.setting.execute === 'false' && card.detail.scripts.filter(script => script.status !== 'false').length === 0) {
         card.errors.push({ level: 0, detail: '-鏄庣粏 鏁版嵁婧愪腑鏃犲彲鐢ㄨ剼鏈紒'})
       }
+    }
+
+    if (!card.billSaveBtn.scripts || card.billSaveBtn.scripts.length === 0) {
+      card.errors.push({ level: 0, detail: '鏈坊鍔犲崟鎹繚瀛樿剼鏈紒'})
+    // } else if (!card.billOutBtn.scripts || card.billOutBtn.scripts.length === 0) {
+    //   card.errors.push({ level: 0, detail: '鏈坊鍔犳彁浜ゅ紑绁ㄥ墠缃剼鏈紒'})
+    // } else if (card.billSaveBtn.cbScripts.length === 0) {
+    //   card.errors.push({ level: 0, detail: '鏈坊鍔犳彁浜ゅ紑绁ㄥ洖璋冭剼鏈紒'})
     }
 
     if (card.errors.length === 0) {
@@ -238,8 +270,20 @@
     this.updateComponent({...this.state.card, wrap: res})
   }
 
+  verifySubmit = () => {
+    this.verifyRef.handleConfirm().then(res => {
+      if (res.type === 'billout') {
+        this.updateComponent({...this.state.card, billOutBtn: res})
+      } else {
+        this.updateComponent({...this.state.card, billSaveBtn: res})
+      }
+
+      this.setState({ btn: null })
+    })
+  }
+
   render() {
-    const { card, date } = this.state
+    const { card, date, btn } = this.state
 
     let style = {...card.style}
     if (card.wrap.invColor) {
@@ -261,8 +305,22 @@
           <ToolOutlined />
         </Popover>
         <div className="inv-action">
-          <Button className="mk-bill">淇濆瓨鍗曟嵁</Button>
-          <Button className="mk-submit">鎻愪氦寮�绁�</Button>
+          {card.wrap.backBtn === 'show' ? <Button className="mk-back"><LeftOutlined />杩斿洖</Button> : null}
+          <Button className="mk-addinv">鏂板鍙戠エ</Button>
+          <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={
+            <div className="mk-popover-control">
+              <EditOutlined style={{color: '#1890ff'}} onClick={() => this.setState({btn: card.billSaveBtn})} title="缂栬緫"/>
+            </div>
+          } trigger="hover">
+            <Button className="mk-bill">淇濆瓨鍗曟嵁</Button>
+          </Popover>
+          <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={
+            <div className="mk-popover-control">
+              <EditOutlined style={{color: '#1890ff'}} onClick={() => this.setState({btn: card.billOutBtn})} title="缂栬緫"/>
+            </div>
+          } trigger="hover">
+            <Button className="mk-submit">鎻愪氦寮�绁�</Button>
+          </Popover>
         </div>
         <div className="inv-header">
           <div className="mk-select">璇烽�夋嫨鍙戠エ绉嶇被</div>
@@ -411,6 +469,26 @@
             <span className="content">寮�绁ㄤ汉</span>
           </div>
         </div>
+        <Modal
+          wrapClassName="mk-pop-modal"
+          visible={btn !== null}
+          width={'90vw'}
+          maskClosable={false}
+          okText="鎻愪氦"
+          onOk={this.verifySubmit}
+          onCancel={() => {
+            if (this.verifyRef.handleCancel) {
+              this.verifyRef.handleCancel().then(() => {
+                this.setState({ btn: null })
+              })
+            } else {
+              this.setState({ btn: null })
+            }
+          }}
+          destroyOnClose
+        >
+          <VerifyCard card={btn} wrappedComponentRef={(inst) => this.verifyRef = inst}/>
+        </Modal>
       </div>
     )
   }

--
Gitblit v1.8.0