sqywDetail.js 7.01 KB
import filter from '@/utils/filter.js'
import store from '@/store/index.js'
let vm = null

const sendThis = (_this) => {
  vm = _this
}
class data extends filter {
  constructor() {
    super()
  }
  djqxCol () {
    return [
      {
        width: '60',
        renderHeader: (h, scope) => {
          return <i class="el-icon-plus pointer" onClick={() => { vm.addDjqx() }} style="color:#409EFF"></i>
        },
        render: (h, scope) => {
          return (
            <i class="el-icon-minus pointer" onClick={() => { vm.removeDjqx(scope.$index, scope.row) }}></i>
          )
        }
      },
      {
        width: '60',
        label: '序号',
        type: 'index'
      },
      {
        label: '是否启用登记情形',
        prop: 'enabled',
        width: '141',
        render: (h, scope) => {
          return (
            <el-radio-group value={scope.row[scope.column.property]} onInput={(val) => { scope.row[scope.column.property] = val }}>
              <el-radio label={'1'}>启用</el-radio>
              <el-radio label={'0'}>禁用</el-radio>
            </el-radio-group>
          )
        }
      },
      {
        prop: 'nodecode',
        width: '105',
        label: '登记情形编码',
        render: (h, scope) => {
          return (
            <div>
              <el-input placeholder="登记情形编码" class={{ repeat: scope.row.repeat }} value={scope.row[scope.column.property]}
                onInput={(val) => { scope.row[scope.column.property] = val }} onBlur={() => { vm.nodecodeBlur(scope.$index, scope.row) }} maxlength="8">
              </el-input>
            </div>
          )
        }
      },
      {
        prop: 'nodename',
        label: '登记情形名称',
        render: (h, scope) => {
          return (
            <div>
              <el-input placeholder="登记情形名称" value={scope.row[scope.column.property]} onInput={(val) => { scope.row[scope.column.property] = val }}></el-input>
            </div>
          )
        }
      },
      {
        prop: 'sfqydjyymb',
        label: '是否启用模板',
        width: '140',
        render: (h, scope) => {
          return (
            <el-radio-group value={scope.row[scope.column.property]} onInput={(val) => { scope.row[scope.column.property] = val }}>
              <el-radio label={'1'}>启用</el-radio>
              <el-radio label={'0'}>禁用</el-radio>
            </el-radio-group>
          )
        }
      },
      {
        prop: 'djyy',
        label: '登记原因模板',
        render: (h, scope) => {
          return (
            <div>
              <el-input placeholder="登记原因模板" value={scope.row[scope.column.property]} onInput={(val) => { scope.row[scope.column.property] = val }}></el-input>
            </div>

          )
        }
      },
      {
        label: '移动',
        width: '100',
        render: (h, scope) => {
          return (
            <div>
              <el-button type='text' disabled={scope.$index == 0} onClick={() => { vm.moveUpward(scope.$index, scope.row, 'djqx') }}>上移</el-button>
              <el-button type='text' disabled={(scope.$index + 1) == vm.form.djqx.length} onClick={() => { vm.moveDown(scope.$index, scope.row, 'djqx') }}>下移</el-button >
            </div>
          )
        }
      }
    ]
  }

  clxxCol () {
    return [
      {
        width: '60',
        renderHeader: (h, scope) => {
          return <i class="el-icon-plus pointer" onClick={() => { vm.addClxx() }} style="color:#409EFF"></i>
        },
        render: (h, scope) => {
          return (
            <i class="el-icon-minus pointer" onClick={() => { vm.removeClxx(scope.$index, scope.row) }}></i>
          )
        }
      },
      {
        width: '60',
        label: '序号',
        type: 'index'
      },
      {
        label: '是否必填',
        prop: 'isrequired',
        width: '110',
        render: (h, scope) => {
          return (
            <el-radio-group value={scope.row[scope.column.property]} onInput={(val) => {
              scope.row[scope.column.property] = val
            }}>
              <el-radio label={'0'}></el-radio>
              <el-radio label={'1'}></el-radio>
            </el-radio-group>
          )
        }
      },
      {
        prop: 'clbm',
        label: '材料编码',
        width: '100',
        render: (h, scope) => {
          return (
            <el-input placeholder="材料编码" value={scope.row[scope.column.property]}
              onInput={(val) => { scope.row[scope.column.property] = val }} maxlength="8"></el-input>
          )
        }
      },
      {
        prop: 'clmc',
        label: '材料名称',
        render: (h, scope) => {
          return (
            <el-input placeholder="材料名称" value={scope.row[scope.column.property]}
              onInput={(val) => { scope.row[scope.column.property] = val }}></el-input>
          )
        }
      },
      {
        prop: 'cllx',
        label: '材料类型',
        width: '115',
        render: (h, scope) => {
          return (
            <el-select value={scope.row[scope.column.property]}
              onChange={(val) => { scope.row[scope.column.property] = val }} clearable>
              {
                store.getters.dictData['A40'].map(option => {
                  return (
                    <el-option label={option.dname} value={option.dcode}></el-option>
                  )
                })
              }
            </el-select>
          )
        }
      },
      {
        label: '是否公共材料',
        prop: 'sfggcl',
        width: '110',
        render: (h, scope) => {
          return (
            <el-radio-group value={scope.row[scope.column.property]} onInput={(val) => { scope.row[scope.column.property] = val }}>
              <el-radio label={'1'}></el-radio>
              <el-radio label={'0'}></el-radio>
            </el-radio-group>
          )
        }
      },
      {
        prop: 'djqxbm',
        label: '登记情形',
        width: '180',
        render: (h, scope) => {
          return (
            <el-select disabled={scope.row.sfggcl == '1'} value={scope.row[scope.column.property]}
              onChange={(val) => { scope.row[scope.column.property] = val }} clearable>
              {
                vm.form.djqx.map(option => {
                  return (
                    <el-option label={option.nodename} value={option.nodecode}></el-option>
                  )
                })
              }
            </el-select>
          )
        }
      },
      {
        label: '移动',
        width: '90',
        render: (h, scope) => {
          return (
            <div>
              <el-button type='text' disabled={scope.$index == 0} onClick={() => { vm.moveUpward(scope.$index, scope.row, 'clxx') }}>上移</el-button>
              <el-button type='text' disabled={(scope.$index + 1) == vm.form.clxx.length} onClick={() => { vm.moveDown(scope.$index, scope.row, 'clxx') }}>下移</el-button >
            </div>
          )
        }
      }
    ]
  }

}
let datas = new data()
export {
  datas,
  sendThis
}