From 5ea9c480262010a8ee08b3c94377013a42263ffc Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期一, 01 四月 2024 11:40:02 +0800
Subject: [PATCH] 2024-04-01

---
 src/tabviews/custom/components/module/voucher/index.jsx  |   18 +++++++++++-------
 src/tabviews/custom/components/module/voucher/index.scss |   11 ++++++++++-
 public/manifest.json                                     |    2 +-
 src/menu/components/share/actioncomponent/formconfig.jsx |    4 ++--
 4 files changed, 24 insertions(+), 11 deletions(-)

diff --git a/public/manifest.json b/public/manifest.json
index f3adf88..590c25c 100644
--- a/public/manifest.json
+++ b/public/manifest.json
@@ -6,5 +6,5 @@
   "display": "standalone",
   "theme_color": "#000000",
   "background_color": "#ffffff",
-  "mk_version": "20240302"
+  "mk_version": "20240401"
 }
diff --git a/src/menu/components/share/actioncomponent/formconfig.jsx b/src/menu/components/share/actioncomponent/formconfig.jsx
index 5b0f0bd..0ac75b8 100644
--- a/src/menu/components/share/actioncomponent/formconfig.jsx
+++ b/src/menu/components/share/actioncomponent/formconfig.jsx
@@ -1354,7 +1354,7 @@
       type: 'radio',
       key: 'permission',
       label: '鏉冮檺楠岃瘉',
-      initVal: setting.permission || 'true',
+      initVal: card.permission || 'true',
       required: false,
       options: [
         {value: 'true', text: '缁ф壙鑿滃崟'},
@@ -2478,7 +2478,7 @@
       type: 'radio',
       key: 'permission',
       label: '鏉冮檺楠岃瘉',
-      initVal: setting.permission || 'true',
+      initVal: card.permission || 'true',
       required: false,
       options: [
         {value: 'true', text: '鍚敤'},
diff --git a/src/tabviews/custom/components/module/voucher/index.jsx b/src/tabviews/custom/components/module/voucher/index.jsx
index ec558e4..0fd7ac5 100644
--- a/src/tabviews/custom/components/module/voucher/index.jsx
+++ b/src/tabviews/custom/components/module/voucher/index.jsx
@@ -38,6 +38,7 @@
     remark: '',
     attachments: 0,
     vouAduited: false,
+    vouReadOnly: false,
     attachlist: [],
     oriAttachs: [],
     tempTypes: [],
@@ -353,7 +354,8 @@
           attachlist: files,
           vouDate: res.fibvoucherdate ? moment(res.fibvoucherdate, 'YYYY-MM-DD') : null,
           charType: res.voucher_class || 'keeping',
-          vouAduited: res.voucher_status === 'true',
+          vouAduited: res.voucher_status === 'true' || res.read_only === 'true',
+          vouReadOnly: res.read_only === 'true',
           charName: res.voucher_char,
           charInt: res.voucher_char_int,
           // orgcode: res.orgcode,
@@ -1253,22 +1255,24 @@
   }
 
   render() {
-    const { type, status, loading, config, orgcode, typeOptions, tempTypes, charType, charInt, data, vouDate, username, remark, attachments, title, attachlist, tempTypeClass, vouAduited } = this.state
+    const { type, status, loading, config, orgcode, typeOptions, tempTypes, charType, charInt, data, vouDate, username, remark, attachments, title, attachlist, tempTypeClass, vouAduited, vouReadOnly, voucherCode } = this.state
 
     if (type === 'checkVoucher') {
       return (
         <div className="menu-voucher-wrap" style={config.style}>
           <div className="voucher-header" style={{padding: `10px ${config.wrap.space || 0}px`}}>
-            {!vouAduited ?<Button disabled={status === 'empty' || status === 'saved'} onClick={() => this.triggersave()}>淇濆瓨</Button> : null}
+            {!vouAduited ? <Button disabled={status === 'empty' || status === 'saved'} onClick={() => this.triggersave()}>淇濆瓨</Button> : null}
             {/* <PrintVoucher ID={config.uuid + 'print'} data={data} orgname={orgname} vouDate={vouDate} charName={charName} charInt={charInt} attachments={attachments} disabled={status !== 'saved'}/> */}
             <Button disabled={status !== 'saved'} onClick={this.triggerPrint}>鎵撳嵃</Button>
-            {vouAduited ?
-              <Button onClick={this.triggerUnAduit}>鍙栨秷瀹℃牳</Button> :
-              <Button onClick={this.triggerAduit}>瀹℃牳</Button>}
+            {vouAduited && !vouReadOnly ? <Button onClick={this.triggerUnAduit}>鍙栨秷瀹℃牳</Button> : null}
+            {!vouAduited && !vouReadOnly ? <Button onClick={this.triggerAduit}>瀹℃牳</Button> : null}
             <Button onClick={this.triggerclose}>鍏抽棴</Button>
           </div>
           <div className="voucher-body" style={{padding: `0px ${config.wrap.space || 0}px`}}>
             <div className="pre-wrap">
+              <div className="voucher-number">
+                鍑瘉鍙凤細{voucherCode}
+              </div>
               <div className="voucher-code">
                 <Select value={charType} disabled={vouAduited} dropdownClassName="mk-vcode-dropdown" onChange={(val, option) => this.setState({status: 'change', charType: val, charName: option.props.charname, charInt: option.props.charint})}>
                   {typeOptions.map(option =>
@@ -1281,7 +1285,7 @@
                 鏃ユ湡锛�<DatePicker value={vouDate} disabled={vouAduited} onChange={this.changeVouDate}/>
               </div>
               <div className="voucher-text">
-                <Input value={title} placeholder="鍑瘉鏂囨湰" disabled={vouAduited} autoComplete="off" onChange={(e) => this.setState({status: 'change', title: e.target.value})}/>
+                <Input value={title} placeholder={vouAduited ? '' : '鍑瘉鏂囨湰'} disabled={vouAduited} autoComplete="off" onChange={(e) => this.setState({status: 'change', title: e.target.value})}/>
               </div>
               <div className="voucher-affix">
                 闄勫崟鎹� <InputNumber precision={0} disabled={vouAduited} value={attachments || 0} autoComplete="off" onChange={this.changeAttach}/> 寮�
diff --git a/src/tabviews/custom/components/module/voucher/index.scss b/src/tabviews/custom/components/module/voucher/index.scss
index 0849306..b3e1c34 100644
--- a/src/tabviews/custom/components/module/voucher/index.scss
+++ b/src/tabviews/custom/components/module/voucher/index.scss
@@ -34,6 +34,11 @@
     }
   }
   .voucher-body {
+    .voucher-number {
+      display: inline-block;
+      white-space: nowrap;
+      margin-right: 15px;
+    }
     .voucher-code {
       display: inline-block;
       width: 160px;
@@ -65,6 +70,10 @@
     }
     .pre-wrap {
       padding: 10px 0px;
+
+      .ant-input.ant-input-disabled, .ant-input-number.ant-input-number-disabled, .ant-select.ant-select-disabled {
+        color: rgba(0, 0, 0, 0.65);
+      }
     }
     .voucher-date {
       display: inline-block;
@@ -74,7 +83,7 @@
     }
     .voucher-text {
       display: inline-block;
-      width: calc(56% - 350px);
+      width: calc(68% - 545px);
       margin-left: 12px;
     }
     .voucher-affix {

--
Gitblit v1.8.0