From 96455706619a0a2a96a836714e106f4c7a3bfd40 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期三, 04 三月 2020 13:18:26 +0800
Subject: [PATCH] 2020-03-04

---
 src/components/tabview/index.jsx                           |    4 
 src/tabviews/tableshare/mutilform/index.jsx                |   12 +-
 src/tabviews/subtable/subTable/index.jsx                   |   17 +++
 src/tabviews/subtable/index.scss                           |    9 ++
 src/templates/subtableconfig/source.jsx                    |    6 +
 src/components/header/index.jsx                            |    4 -
 src/tabviews/formtab/formgroup/index.jsx                   |    8 +
 src/templates/comtableconfig/source.jsx                    |    6 +
 src/tabviews/managetable/index.jsx                         |    1 
 src/tabviews/tableshare/mutilform/index.scss               |   14 +++
 src/tabviews/subtable/index.jsx                            |   62 ++++++++++-----
 src/tabviews/commontable/index.jsx                         |    6 +
 src/tabviews/commontable/mainTable/index.jsx               |    2 
 src/templates/tableshare/verifycard/index.jsx              |    1 
 src/templates/tableshare/verifycard/billcodeform/index.jsx |   16 ++-
 src/tabviews/formtab/formgroup/index.scss                  |   14 +++
 src/utils/utils.js                                         |   23 ++++-
 17 files changed, 153 insertions(+), 52 deletions(-)

diff --git a/src/components/header/index.jsx b/src/components/header/index.jsx
index f60641f..78bd106 100644
--- a/src/components/header/index.jsx
+++ b/src/components/header/index.jsx
@@ -361,10 +361,6 @@
     this.loadmenu()
   }
 
-  UNSAFE_componentWillReceiveProps () {
-
-  }
-
   shouldComponentUpdate (nextProps, nextState) {
     return !is(fromJS(this.props), fromJS(nextProps)) || !is(fromJS(this.state), fromJS(nextState))
   }
diff --git a/src/components/tabview/index.jsx b/src/components/tabview/index.jsx
index 25bef0f..abace19 100644
--- a/src/components/tabview/index.jsx
+++ b/src/components/tabview/index.jsx
@@ -89,7 +89,7 @@
     } else if (view.type === 'TabForm') {
       return (<Comps.TabForm MenuNo={view.MenuNo} MenuID={view.MenuID} MenuName={view.MenuName} key={view.MenuID} param={view.param}/>)
     } else if (view.type === 'FormTab') {
-      return (<Comps.FormTab MenuNo={view.MenuNo} MenuID={view.MenuID} MenuName={view.MenuName} key={view.MenuID} param={view.param}/>)
+      return (<Comps.FormTab MenuNo={view.MenuNo} MenuID={view.MenuID} MenuName={view.MenuName} menuType={view.param.menuType} key={view.MenuID} param={view.param}/>)
     } else if (view.type === 'iframe') {
       return (<Comps.Iframe key={view.MenuID} title={view.MenuName} MenuName={view.MenuName} url={service + view.LinkUrl}/>)
     } else {
@@ -171,7 +171,7 @@
           Comps.RoleManage = asyncComponent(() => import('@/tabviews/rolemanage'))
         } else if (!Comps.TabForm && newtab.type === 'TabForm') {
           Comps.TabForm = asyncComponent(() => import('@/tabviews/tabform'))
-        } else if (!Comps.TabForm && newtab.type === 'FormTab') {
+        } else if (!Comps.FormTab && newtab.type === 'FormTab') {
           Comps.FormTab = asyncComponent(() => import('@/tabviews/formtab'))
         }
       }
diff --git a/src/tabviews/commontable/index.jsx b/src/tabviews/commontable/index.jsx
index dbdb145..b54d89d 100644
--- a/src/tabviews/commontable/index.jsx
+++ b/src/tabviews/commontable/index.jsx
@@ -721,6 +721,7 @@
         type: btn.tabTemplate,
         selected: true,
         param: {
+          menuType: 'main',
           parentId: this.props.MenuID,
           btn: btn,
           data: data[0] || null,
@@ -877,6 +878,7 @@
               ref="mainButton"
               BID=""
               type="main"
+              menuType="main"
               setting={setting}
               actions={actions}
               dict={this.state.dict}
@@ -931,6 +933,7 @@
                         {_tab.type === 'SubTable' ?
                           <SubTable
                             Tab={_tab}
+                            menuType="main"
                             MenuID={_tab.linkTab}
                             SupMenuID={this.props.MenuID}
                             refreshtabs={this.state.refreshtabs}
@@ -967,6 +970,7 @@
           >
             {<SubTabTable 
               BID={''}
+              menuType="main"
               SupMenuID={this.props.MenuID}
               MenuID={this.state.popAction.linkTab}
               BData={this.state.BIDs['mainTabledata'] || ''}
@@ -997,7 +1001,7 @@
           </Modal>
           {viewlost ? <NotFount msg={this.state.lostmsg} /> : null}
         </div> : null}
-        {view === 'formtab' ? <FormTab MenuID={this.state.tabBtn.uuid} param={this.state.tabParam} refresh={this.refreshbyformtab}/> : null}
+        {view === 'formtab' ? <FormTab menuType="main" MenuID={this.state.tabBtn.uuid} param={this.state.tabParam} refresh={this.refreshbyformtab}/> : null}
       </div>
     )
   }
diff --git a/src/tabviews/commontable/mainTable/index.jsx b/src/tabviews/commontable/mainTable/index.jsx
index edca5f5..3fd499f 100644
--- a/src/tabviews/commontable/mainTable/index.jsx
+++ b/src/tabviews/commontable/mainTable/index.jsx
@@ -160,7 +160,7 @@
         <div className={match ? item.color : ''}>
           <div className="background"></div>
           <div className="content" style={{ minWidth: (item.Width || 120) + 'px' }}>
-            <Paragraph copyable ellipsis={{ rows: 3, expandable: true }}>{content}</Paragraph>
+            {content ? <Paragraph copyable ellipsis={{ rows: 3, expandable: true }}>{content}</Paragraph> : null }
           </div>
         </div>
       )
diff --git a/src/tabviews/formtab/formgroup/index.jsx b/src/tabviews/formtab/formgroup/index.jsx
index 96d7240..840a8fe 100644
--- a/src/tabviews/formtab/formgroup/index.jsx
+++ b/src/tabviews/formtab/formgroup/index.jsx
@@ -355,6 +355,7 @@
                   showSearch
                   filterOption={(input, option) => option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0}
                   onChange={(value, option) => {this.selectChange(item, value, option)}}
+                  disabled={item.readonly === 'true'}
                 >
                   {item.options.map(option =>
                     <Select.Option id={option.key} data={hasSubField ? option : ''} title={option.Text} key={option.key} value={option.Value}>{option.Text}</Select.Option>
@@ -382,6 +383,7 @@
                   showSearch
                   mode="multiple"
                   filterOption={(input, option) => option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0}
+                  disabled={item.readonly === 'true'}
                 >
                   {item.options.map(option =>
                     <Select.Option id={option.key} title={option.Text} key={option.key} value={option.Value}>{option.Text}</Select.Option>
@@ -411,7 +413,7 @@
                   }
                 ]
               })(
-                <DatePicker />
+                <DatePicker disabled={item.readonly === 'true'} />
               )}
             </Form.Item>
           </Col>
@@ -436,7 +438,7 @@
                   }
                 ]
               })(
-                <MonthPicker />
+                <MonthPicker disabled={item.readonly === 'true'} />
               )}
             </Form.Item>
           </Col>
@@ -462,7 +464,7 @@
                   }
                 ]
               })(
-                <DatePicker showTime />
+                <DatePicker showTime disabled={item.readonly === 'true'} />
               )}
             </Form.Item>
           </Col>
diff --git a/src/tabviews/formtab/formgroup/index.scss b/src/tabviews/formtab/formgroup/index.scss
index 691b786..bb8c383 100644
--- a/src/tabviews/formtab/formgroup/index.scss
+++ b/src/tabviews/formtab/formgroup/index.scss
@@ -33,4 +33,18 @@
     color: #1890ff;
     border-bottom: 1px solid #d9d9d9;
   }
+  .ant-input-disabled {
+    color: rgba(0, 0, 0, 0.65)!important;
+    cursor: default!important;
+  }
+  .ant-input-number-input {
+    color: rgba(0, 0, 0, 0.65)!important;
+    cursor: default!important;
+  }
+  .ant-select-disabled {
+    color: rgba(0, 0, 0, 0.65)!important;
+    .ant-select-selection--multiple .ant-select-selection__choice {
+      color: rgba(0, 0, 0, 0.65)!important;
+    }
+  }
 }
\ No newline at end of file
diff --git a/src/tabviews/managetable/index.jsx b/src/tabviews/managetable/index.jsx
index 5f2cdf3..6dbb816 100644
--- a/src/tabviews/managetable/index.jsx
+++ b/src/tabviews/managetable/index.jsx
@@ -707,6 +707,7 @@
         type: btn.tabTemplate,
         selected: true,
         param: {
+          menuType: 'HS',
           parentId: this.props.MenuID,
           btn: btn,
           data: data[0] || null,
diff --git a/src/tabviews/subtable/index.jsx b/src/tabviews/subtable/index.jsx
index 7c4d767..a941e3b 100644
--- a/src/tabviews/subtable/index.jsx
+++ b/src/tabviews/subtable/index.jsx
@@ -2,7 +2,7 @@
 import PropTypes from 'prop-types'
 import {connect} from 'react-redux'
 import { is, fromJS } from 'immutable'
-import { notification, Spin, Modal, Button} from 'antd'
+import { notification, Spin, Modal, Button, Switch} from 'antd'
 import moment from 'moment'
 import Api from '@/api'
 import SubTable from './subTable'
@@ -54,7 +54,8 @@
     configMap: {},        // 椤甸潰閰嶇疆淇℃伅锛氫笅鎷夈�佹寜閽瓑
     popAction: false,     // 寮规椤甸潰锛屾寜閽俊鎭�
     popData: false,       // 寮规椤甸潰锛屾墍閫夌殑琛ㄦ牸鏁版嵁
-    visible: false        // 寮规鏄剧ず闅愯棌鎺у埗
+    visible: false,       // 寮规鏄剧ず闅愯棌鎺у埗
+    pickup: false,         // 瀛愯〃鏁版嵁闅愯棌鏄剧ず鍒囨崲
   }
 
   /**
@@ -335,6 +336,7 @@
           return item
         }),
         total: result.total,
+        pickup: false,
         loading: false
       })
     } else {
@@ -611,6 +613,17 @@
     })
   }
 
+  /**
+   * @description 鏁版嵁灞曞紑鍚堝苟鍒囨崲
+   */
+  pickupChange = () => {
+    const { pickup } = this.state
+
+    this.setState({
+      pickup: !pickup
+    })
+  }
+
   popclose = () => {
     this.setState({
       visible: false
@@ -618,13 +631,13 @@
     this.refreshbyaction(this.state.popAction, 'pop')
   }
 
-  UNSAFE_componentWillMount () {
+  UNSAFE_componentWillMount() {
     // 缁勪欢鍔犺浇鏃讹紝鑾峰彇鑿滃崟鏁版嵁
     this.loadconfig()
   }
 
-  shouldComponentUpdate (nextProps, nextState) {
-    return !is(fromJS(this.props), fromJS(nextProps)) || !is(fromJS(this.state), fromJS(nextState))
+  shouldComponentUpdate (nextProps, nextState) { // handleMainTable 鍑芥暟鍒ゆ柇鏃朵笉鐩哥瓑
+    return !is(fromJS({...this.props, handleMainTable: '', handleTableId: ''}), fromJS({...nextProps, handleMainTable: '', handleTableId: ''})) || !is(fromJS(this.state), fromJS(nextState))
   }
 
   /**
@@ -637,7 +650,7 @@
   }
 
   render() {
-    const { setting, searchlist, actions, columns, loadingview, viewlost } = this.state
+    const { setting, searchlist, actions, columns, loadingview, viewlost, pickup } = this.state
 
     return (
       <div className="subtable" id={'subtable' + this.props.MenuID}>
@@ -669,20 +682,29 @@
             gettableselected={this.gettableselected}
           />
         }
-        {columns &&
-          <SubTable
-            ref="subTable"
-            dict={this.state.dict}
-            MenuID={this.props.MenuID}
-            setting={setting}
-            columns={columns}
-            data={this.state.data}
-            total={this.state.total}
-            loading={this.state.loading}
-            refreshdata={this.refreshbytable}
-            buttonTrigger={this.buttonTrigger}
-            handleTableId={this.handleTableId}
-          />
+        {/* {this.state.data && this.state.data.length > 0 ?
+          <Switch title="鏀惰捣" className="subtable-pickup" checkedChildren="寮�" unCheckedChildren="鍏�" defaultChecked={pickup} onChange={this.pickupChange} /> : null
+        } */}
+        {columns ?
+          <div className="subtable-box">
+            {this.state.data && this.state.data.length > 0 ?
+              <Switch title="鏀惰捣" className="subtable-pickup" checkedChildren="寮�" unCheckedChildren="鍏�" defaultChecked={pickup} onChange={this.pickupChange} /> : null
+            }
+            <SubTable
+              ref="subTable"
+              pickup={pickup}
+              setting={setting}
+              columns={columns}
+              dict={this.state.dict}
+              data={this.state.data}
+              total={this.state.total}
+              MenuID={this.props.MenuID}
+              loading={this.state.loading}
+              refreshdata={this.refreshbytable}
+              buttonTrigger={this.buttonTrigger}
+              handleTableId={this.handleTableId}
+            />
+          </div> : null
         }
         <Modal
           className="popview-modal"
diff --git a/src/tabviews/subtable/index.scss b/src/tabviews/subtable/index.scss
index 74096d3..ff14f6f 100644
--- a/src/tabviews/subtable/index.scss
+++ b/src/tabviews/subtable/index.scss
@@ -29,6 +29,15 @@
     left: calc(50% - 22px);
     top: 100px;
   }
+  .subtable-box {
+    position: relative;
+    .subtable-pickup {
+      position: absolute;
+      right: 5px;
+      top: -25px;
+      z-index: 10;
+    }
+  }
 }
 .popview-modal {
   .ant-modal-body {
diff --git a/src/tabviews/subtable/subTable/index.jsx b/src/tabviews/subtable/subTable/index.jsx
index 6aea1fa..502df0d 100644
--- a/src/tabviews/subtable/subTable/index.jsx
+++ b/src/tabviews/subtable/subTable/index.jsx
@@ -1,5 +1,6 @@
 import React, {Component} from 'react'
 import PropTypes from 'prop-types'
+import { is, fromJS } from 'immutable'
 import { Table, message, Button, Typography } from 'antd'
 import './index.scss'
 
@@ -16,7 +17,8 @@
     loading: PropTypes.bool,       // 琛ㄦ牸鍔犺浇涓�
     refreshdata: PropTypes.func,   // 琛ㄦ牸涓帓搴忓垪銆侀〉鐮佺殑鍙樺寲鏃跺埛鏂�
     buttonTrigger: PropTypes.func, // 琛ㄦ牸涓寜閽Е鍙戞搷浣�
-    handleTableId: PropTypes.func  // 鎺у埗琛ㄦ牸鏁版嵁鍒囨崲鏃讹紝鏇存柊鍦ㄤ富琛ㄤ腑鐨刬d
+    handleTableId: PropTypes.func, // 鎺у埗琛ㄦ牸鏁版嵁鍒囨崲鏃讹紝鏇存柊鍦ㄤ富琛ㄤ腑鐨刬d
+    pickup: PropTypes.any          // 鏁版嵁灞曞紑鍚堝苟鎺у埗
   }
 
   state = {
@@ -142,7 +144,7 @@
         <div className={match ? item.color : ''}>
           <div className="background"></div>
           <div className="content" style={{ minWidth: (item.Width || 120) + 'px' }}>
-            <Paragraph copyable ellipsis={{ rows: 3, expandable: true }}>{content}</Paragraph>
+            {content ? <Paragraph copyable ellipsis={{ rows: 3, expandable: true }}>{content}</Paragraph> : null}
           </div>
         </div>
       )
@@ -313,6 +315,10 @@
     this.props.handleTableId(_id, _data)
   }
 
+  shouldComponentUpdate (nextProps, nextState) {
+    return !is(fromJS(this.props), fromJS(nextProps)) || !is(fromJS(this.state), fromJS(nextState))
+  }
+
   render() {
     let { selectedRowKeys } = this.state
 
@@ -325,6 +331,11 @@
       }
     }
 
+    let _data = this.props.data ? this.props.data : []
+    if (this.props.pickup) {
+      _data = _data.filter((item, index) => selectedRowKeys.includes(index))
+    }
+
     return (
       <div className="sub-table">
         <Table
@@ -332,7 +343,7 @@
           bordered={true}
           rowSelection={rowSelection}
           columns={this.state.columns}
-          dataSource={this.props.data ? this.props.data : []}
+          dataSource={_data}
           loading={this.props.loading}
           scroll={{ x: '100%', y: false }}
           onRow={(record, index) => {
diff --git a/src/tabviews/tableshare/mutilform/index.jsx b/src/tabviews/tableshare/mutilform/index.jsx
index 0fa09e1..6babeea 100644
--- a/src/tabviews/tableshare/mutilform/index.jsx
+++ b/src/tabviews/tableshare/mutilform/index.jsx
@@ -111,10 +111,10 @@
           item.linkSubField = item.linkSubField.filter(_item => _fields.includes(_item))
         }
       }
-      
+
       if (item.type === 'linkMain' && BData && BData.hasOwnProperty(item.field)) {
         item.initval = BData[item.field]
-      } else if (_readin && !/^date/.test(item.type) && this.props.data && this.props.data.hasOwnProperty(item.field)) {
+      } else if (item.type !== 'linkMain' && _readin && !/^date/.test(item.type) && this.props.data && this.props.data.hasOwnProperty(item.field)) {
         item.initval = this.props.data[item.field]
       }
 
@@ -354,6 +354,7 @@
                   showSearch
                   filterOption={(input, option) => option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0}
                   onChange={(value, option) => {this.selectChange(item, value, option)}}
+                  disabled={item.readonly === 'true'}
                 >
                   {item.options.map(option =>
                     <Select.Option id={option.key} data={hasSubField ? option : ''} title={option.Text} key={option.key} value={option.Value}>{option.Text}</Select.Option>
@@ -381,6 +382,7 @@
                   showSearch
                   mode="multiple"
                   filterOption={(input, option) => option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0}
+                  disabled={item.readonly === 'true'}
                 >
                   {item.options.map(option =>
                     <Select.Option id={option.key} title={option.Text} key={option.key} value={option.Value}>{option.Text}</Select.Option>
@@ -409,7 +411,7 @@
                   }
                 ]
               })(
-                <DatePicker />
+                <DatePicker disabled={item.readonly === 'true'} />
               )}
             </Form.Item>
           </Col>
@@ -433,7 +435,7 @@
                   }
                 ]
               })(
-                <MonthPicker />
+                <MonthPicker disabled={item.readonly === 'true'} />
               )}
             </Form.Item>
           </Col>
@@ -458,7 +460,7 @@
                 ]
               })(
                 // <DatePicker showTime getCalendarContainer={() => document.getElementById('form-box')} />
-                <DatePicker showTime />
+                <DatePicker showTime disabled={item.readonly === 'true'} />
               )}
             </Form.Item>
           </Col>
diff --git a/src/tabviews/tableshare/mutilform/index.scss b/src/tabviews/tableshare/mutilform/index.scss
index 62fcc66..919cf39 100644
--- a/src/tabviews/tableshare/mutilform/index.scss
+++ b/src/tabviews/tableshare/mutilform/index.scss
@@ -33,4 +33,18 @@
     color: #1890ff;
     border-bottom: 1px solid #d9d9d9;
   }
+  .ant-input-disabled {
+    color: rgba(0, 0, 0, 0.65)!important;
+    cursor: default!important;
+  }
+  .ant-input-number-input {
+    color: rgba(0, 0, 0, 0.65)!important;
+    cursor: default!important;
+  }
+  .ant-select-disabled {
+    color: rgba(0, 0, 0, 0.65)!important;
+    .ant-select-selection--multiple .ant-select-selection__choice {
+      color: rgba(0, 0, 0, 0.65)!important;
+    }
+  }
 }
\ No newline at end of file
diff --git a/src/templates/comtableconfig/source.jsx b/src/templates/comtableconfig/source.jsx
index 7280caf..7bd38c1 100644
--- a/src/templates/comtableconfig/source.jsx
+++ b/src/templates/comtableconfig/source.jsx
@@ -320,6 +320,12 @@
     },
     {
       type: 'columns',
+      label: CommonDict['header.form.textarea'],
+      subType: 'textarea',
+      url: ''
+    },
+    {
+      type: 'columns',
       label: CommonDict['header.form.colspan'],
       subType: 'colspan',
       url: ''
diff --git a/src/templates/subtableconfig/source.jsx b/src/templates/subtableconfig/source.jsx
index 57e811f..d0de914 100644
--- a/src/templates/subtableconfig/source.jsx
+++ b/src/templates/subtableconfig/source.jsx
@@ -270,6 +270,12 @@
     },
     {
       type: 'columns',
+      label: CommonDict['header.form.textarea'],
+      subType: 'textarea',
+      url: ''
+    },
+    {
+      type: 'columns',
       label: CommonDict['header.form.colspan'],
       subType: 'colspan',
       url: ''
diff --git a/src/templates/tableshare/verifycard/billcodeform/index.jsx b/src/templates/tableshare/verifycard/billcodeform/index.jsx
index d140531..ee1770f 100644
--- a/src/templates/tableshare/verifycard/billcodeform/index.jsx
+++ b/src/templates/tableshare/verifycard/billcodeform/index.jsx
@@ -8,6 +8,7 @@
 class UniqueForm extends Component {
   static propTpyes = {
     dict: PropTypes.object,         // 瀛楀吀椤�
+    btn: PropTypes.object,          // 鎸夐挳淇℃伅
     fields: PropTypes.array,        // 琛ㄥ崟
     billcodes: PropTypes.array,     // 琛ㄥ崟
     columns: PropTypes.array,       // 琛ㄥ崟
@@ -38,12 +39,15 @@
         fieldMap.set(_field.field, true)
       }
     })
-    this.props.columns.forEach(_field => {
-      if (_field.type === 'text' && !fieldMap.has(_field.field)) {
-        _billFields.push(_field)
-        fieldMap.set(_field.field, true)
-      }
-    })
+
+    if (this.props.btn.Ot !== 'notRequired') {
+      this.props.columns.forEach(_field => {
+        if (_field.type === 'text' && !fieldMap.has(_field.field)) {
+          _billFields.push(_field)
+          fieldMap.set(_field.field, true)
+        }
+      })
+    }
 
     let _usedfields = this.props.billcodes.map(item => item.field)
 
diff --git a/src/templates/tableshare/verifycard/index.jsx b/src/templates/tableshare/verifycard/index.jsx
index 6ad62f0..b53fb4e 100644
--- a/src/templates/tableshare/verifycard/index.jsx
+++ b/src/templates/tableshare/verifycard/index.jsx
@@ -1088,6 +1088,7 @@
           <TabPane tab="鍗曞彿鐢熸垚" key="4">
             <BillcodeForm
               fields={fields}
+              btn={this.props.card}
               billcodes={verify.billcodes}
               columns={this.props.columns}
               dict={this.props.dict}
diff --git a/src/utils/utils.js b/src/utils/utils.js
index a5aa2dd..b5c9245 100644
--- a/src/utils/utils.js
+++ b/src/utils/utils.js
@@ -607,13 +607,13 @@
     // 闇�瑕佸0鏄庣殑鍙橀噺闆�
     // let _vars = ['tbid', 'ErrorCode', 'retmsg', 'BillCode', 'BVoucher', 'FIBVoucherDate', 'FiYear', 'UserName', 'FullName', 'ID', 'BID', 'LoginUID', 'SessionUid', 'UserID', 'Appkey']
     // let _vars = ['tbid', 'errorcode', 'retmsg', 'billcode', 'bvoucher', 'fibvoucherdate', 'fiyear', 'username', 'fullname', 'id', 'bid', 'loginuid', 'sessionuid', 'userid', 'appkey']
-    let _vars = ['tbid', 'errorcode', 'retmsg', 'billcode', 'bvoucher', 'fibvoucherdate', 'fiyear', 'username', 'fullname']
+    let _vars = ['tbid', 'errorcode', 'retmsg', 'billcode', 'bvoucher', 'fibvoucherdate', 'fiyear', 'username', 'fullname', 'modulardetailcode']
 
     // 涓婚敭瀛楁
     let primaryKey = setting.primaryKey || 'id'
 
     // 绯荤粺鍙橀噺澹版槑涓庤缃垵濮嬪��
-    let _sql = `Declare @tbid nvarchar(50),@ErrorCode nvarchar(50),@retmsg nvarchar(4000),@BillCode nvarchar(50),@BVoucher nvarchar(50),@FIBVoucherDate nvarchar(50), @FiYear nvarchar(50), @UserName nvarchar(50),@FullName nvarchar(50)
+    let _sql = `Declare @tbid nvarchar(50),@ErrorCode nvarchar(50),@retmsg nvarchar(4000),@BillCode nvarchar(50),@BVoucher nvarchar(50),@FIBVoucherDate nvarchar(50), @FiYear nvarchar(50), @UserName nvarchar(50),@FullName nvarchar(50),@ModularDetailCode nvarchar(50)
       `
 
     // let _initvars = ['ID', 'BID', 'LoginUID', 'SessionUid', 'UserID', 'Appkey'] // 宸茶祴鍊煎瓧娈甸泦
@@ -828,16 +828,24 @@
     if (verify.billcodes && verify.billcodes.length > 0) {
       verify.billcodes.forEach(item => {
         let _ModularDetailCode = ''
-        if (item.TypeCharOne === 'Lp' || item.TypeCharOne === 'BN') {
+        let _lpline = ''
+        if (item.TypeCharOne === 'Lp') {
+          if (item.linkField === 'BID' && BID) { // 鏇挎崲bid
+            _lpline = `set @ModularDetailCode= 'Lp'+ right('${btn.uuid}'+@BID@,48)`
+          } else {
+            _lpline = `set @ModularDetailCode= 'Lp'+ right('${btn.uuid}'+@${item.linkField},48)`
+          }
+          _ModularDetailCode = '@ModularDetailCode'
+        } else if (item.TypeCharOne === 'BN') {
           let _val = ''
           if (item.linkField === 'BID' && BID) { // 鏇挎崲bid
             _val = BID
           } else if (data && data.hasOwnProperty(item.linkField)) {
             _val = data[item.linkField]
           }
-          _ModularDetailCode = item.TypeCharOne + _val
+          _ModularDetailCode = `'${item.TypeCharOne + _val}'`
         } else {
-          _ModularDetailCode = item.ModularDetailCode
+          _ModularDetailCode = `'${item.ModularDetailCode}'`
         }
 
         let _declare = ''
@@ -849,9 +857,10 @@
         }
 
         _sql += `${_declare}
-          select @BillCode='', @${_key}=''
+          select @BillCode='', @${_key}='', @ModularDetailCode=''
+          ${_lpline}
           exec s_get_BillCode
-            @ModularDetailCode='${_ModularDetailCode}',
+            @ModularDetailCode=${_ModularDetailCode},
             @Type=${item.Type},
             @TypeCharOne='${item.TypeCharOne}',
             @TypeCharTwo ='${item.TypeCharTwo}',

--
Gitblit v1.8.0