king
2023-01-29 99c9aed75c0bf5356e3170b7070ed00d7ba653ca
src/tabviews/custom/components/module/voucher/index.jsx
@@ -24,7 +24,6 @@
    disableAdd: false,
    disableSave: false,
    typeOptions: [],
    subjects: [],
    charType: '',
    charInt: '',
    vouDate: null,
@@ -45,6 +44,8 @@
    if (BData) {
      BID = BData.$BID || ''
    }
    window.GLOB.CacheVoucher.delete(config.uuid)
    this.setState({
      config: fromJS(config).toJS(),
@@ -100,7 +101,7 @@
  }
  loadData = () => {
    const { book } = this.state
    const { book, config } = this.state
    if (!book) return
@@ -126,8 +127,62 @@
        typeOptions: typeOptions,
        charType: typeOptions[0] ? typeOptions[0].voucher_class : '',
        charInt: typeOptions[0] ? typeOptions[0].voucher_char_int : '',
        subjects: res.subjects || [],
      })
      let names = {}
      let supplier = []
      let customer = []
      let department = []
      let project = []
      let inventory = []
      let employee = []
      let cash_flow = []
      res.sup && res.sup.forEach(item => {
        names[item.sup_type_code] = item.sup_type_name
      })
      res.supplier && res.supplier.forEach(item => {
        supplier.push({value: item.suppliercode, label: item.suppliername})
      })
      res.customer && res.customer.forEach(item => {
        customer.push({value: item.customercode, label: item.customername})
      })
      res.co_pro && res.co_pro.forEach(item => {
        department.push({value: item.co_pro_code, label: item.co_pro_name})
      })
      res.pm && res.pm.forEach(item => {
        project.push({value: item.projectcode, label: item.projectname})
      })
      res.materiel && res.materiel.forEach(item => {
        inventory.push({value: item.productcode, label: item.productname})
      })
      res.workers && res.workers.forEach(item => {
        employee.push({value: item.workercode, label: item.workername})
      })
      res.cash_flow && res.cash_flow.forEach(item => {
        cash_flow.push({value: item.cash_flow_code, label: item.cash_flow_name})
      })
      let message = {
        subjects: res.subjects || [],
        names: names,
        supplier: supplier,
        customer: customer,
        department: department,
        project: project,
        inventory: inventory,
        employee: employee,
        cash_flow: cash_flow,
      }
      window.GLOB.CacheVoucher.set(config.uuid, message)
      setTimeout(() => {
        this.getVoucher()
@@ -162,7 +217,7 @@
  }
  render() {
    const { config, disableSave, disableAdd, typeOptions, charType, charInt, data, vouDate, subjects } = this.state
    const { config, disableSave, disableAdd, typeOptions, charType, charInt, data, vouDate } = this.state
    return (
      <div className="menu-voucher-wrap" style={config.style}>
@@ -192,7 +247,7 @@
              <Button type="link" className="" onClick={this.triggerprint}>备注</Button>
            </div>
          </div>
          <VoucherTable config={config} subjects={subjects} data={data}/>
          <VoucherTable config={config} data={data}/>
        </div> : null}
        {config.wrap.type === 'check' ? <div className="voucher-body">
          <div className="pre-wrap">