loulijun2021
2022-07-16 392f9468875a8721c17c4e15c288333017cac4a1
src/views/xtsz/bmgz.vue
@@ -101,7 +101,7 @@
          >
            <template slot-scope="{row}">
              <div class="operationClass">
                <el-button type="text" @click="edit('edit',row)">修改</el-button>
                <el-button type="text" @click="edit('edit',row)">编辑</el-button>
                <!--                <el-button type="text" @click="del(row)">删除</el-button>-->
              </div>
            </template>
@@ -139,6 +139,7 @@
          <el-select
            v-model="dialogForm.filingdate"
            style="width: 220px"
            filterable
            placeholder="请选择"
            :popper-append-to-body="false"
          >
@@ -152,9 +153,13 @@
        </el-form-item>
        <el-form-item label="自增位数" prop="incbit">
          <!--          @change="handleChange"-->
          <el-input-number v-model="dialogForm.incbit" :min="1" :max="100" label="描述文字" />
          <!--          <el-input-number v-model="dialogForm.incbit" :min="1" :max="100" label="描述文字" />-->
          <!--          <el-input v-model="dialogForm.incbit" style="width: 220px" />-->
          <el-input
            v-model="dialogForm.incbit"
            oninput="value=value.replace(/[^0-9]/g,'')"
            style="width: 220px"
          />
        </el-form-item>
        <el-form-item label="编码预览">
          {{ encodingPre }}
@@ -177,7 +182,7 @@
const SER_HZ = /^[\u4e00-\u9fa5]+$/
export default {
  name: 'Zzjg',
  name: 'BMGZ',
  components: {
    Pagination
  },
@@ -235,17 +240,17 @@
  },
  watch: {
    dialogForm: {
      handler(newVlaue, oldValue) {
      handler(newValue, oldValue) {
        const date = new Date()
        let newDate = ''
        if (newVlaue.filingdate === 'YMD') {
          newDate = date.getFullYear() + '' + (date.getMonth() + 1 + '').padStart(2, '0') + '' + (date.getDate() + '').padStart(2, '0')
        } else if (newVlaue.filingdate === 'YM') {
          newDate = date.getFullYear() + '' + (date.getMonth() + 1 + '').padStart(2, '0')
        } else if (newVlaue.filingdate === 'Y') {
          newDate = date.getFullYear() + ''
        if (newValue.filingdate === 'YMD') {
          newDate = date.getFullYear().toString().substring(2, 4) + '' + (date.getMonth() + 1 + '').padStart(2, '0') + '' + (date.getDate() + '').padStart(2, '0')
        } else if (newValue.filingdate === 'YM') {
          newDate = date.getFullYear().toString().substring(2, 4) + '' + (date.getMonth() + 1 + '').padStart(2, '0')
        } else if (newValue.filingdate === 'Y') {
          newDate = date.getFullYear().toString().substring(2, 4) + ''
        }
        this.encodingPre = newVlaue.prefix + '' + newDate + '' + (1 + '').padStart(newVlaue.incbit, '0')
        this.encodingPre = newValue.prefix + '' + newDate + '' + (1 + '').padStart(newValue.incbit, '0')
      },
      immediate: true,
      deep: true