lilei 7 月之前
父节点
当前提交
593846db09

+ 1 - 0
src/components/Select/index.js

@@ -66,6 +66,7 @@ export default {
         if (res.status == 200) {
           _this.origDataList = res.data.list
           _this.dataList = res.data.list.filter(item => _this.notIn.indexOf(item.code) < 0)
+          _this.$emit('loaded',_this.dataList)
         }
       })
     },

+ 28 - 3
src/config/router.config.js

@@ -4103,7 +4103,7 @@ export const asyncRouterMap = [
             children: [
               {
                 path: 'list',
-                name: 'M_erpMessageList',
+                name: 'erpMessageManagementList',
                 component: () => import(/* webpackChunkName: "setting" */ '@/views/setting/erpMessageManagement/list.vue'),
                 meta: {
                   title: 'ERP数据同步列表',
@@ -4128,7 +4128,7 @@ export const asyncRouterMap = [
             children: [
               {
                 path: 'list',
-                name: 'M_erpAllotSettingsList',
+                name: 'erpAllotSettingsList',
                 component: () => import(/* webpackChunkName: "setting" */ '@/views/setting/erpAllotSettings/list.vue'),
                 meta: {
                   title: 'ERP调拨配置',
@@ -4139,6 +4139,31 @@ export const asyncRouterMap = [
               }
             ]
           },
+          {
+            path: '/setting/dataValidManagement',
+            redirect: '/setting/dataValidManagement/list',
+            name: 'dataValidManagement',
+            component: BlankLayout,
+            meta: {
+              title: '数据校验管理',
+              icon: 'sketch',
+              permission: 'M_erpMessageList'
+            },
+            hideChildrenInMenu: true,
+            children: [
+              {
+                path: 'list',
+                name: 'dataValidManagementList',
+                component: () => import(/* webpackChunkName: "setting" */ '@/views/setting/dataValidManagement/list.vue'),
+                meta: {
+                  title: '数据校验管理',
+                  icon: 'sketch',
+                  hidden: true,
+                  permission: 'M_erpMessageList'
+                }
+              }
+            ]
+          },
           {
             path: '/setting/checkDingTask',
             redirect: '/setting/checkDingTask/list',
@@ -4153,7 +4178,7 @@ export const asyncRouterMap = [
             children: [
               {
                 path: 'list',
-                name: 'M_dingAuditUpdate',
+                name: 'checkDingTaskList',
                 component: () => import(/* webpackChunkName: "setting" */ '@/views/setting/checkDingTask/list.vue'),
                 meta: {
                   title: '钉钉审批',

+ 167 - 0
src/views/setting/dataValidManagement/editModal.vue

@@ -0,0 +1,167 @@
+<template>
+  <a-modal
+    centered
+    class="handleManage-modal"
+    :footer="null"
+    :maskClosable="false"
+    title="处理"
+    v-model="isShow"
+    @cancel="isShow=false"
+    :width="800">
+    <!-- 表单 -->
+    <div>
+      <a-spin :spinning="spinning" tip="Loading...">
+        <a-form-model
+          id="handleManage-form"
+          ref="ruleForm"
+          :model="form"
+          :rules="rules"
+          :label-col="formItemLayout.labelCol"
+          :wrapper-col="formItemLayout.wrapperCol"
+        >
+          <a-form-model-item label="处理状态" prop="handleResult">
+            <a-select placeholder="请选择处理状态" id="erpMessageManagement-handleResult" v-model="form.handleResult">
+              <a-select-option value="finish" id="erpMessageManagement-handleResult-finish">
+                处理成功
+              </a-select-option>
+              <a-select-option value="fail" id="erpMessageManagement-handleResult-fail">
+                处理失败
+              </a-select-option>
+            </a-select>
+          </a-form-model-item>
+          <a-form-model-item label="处理描述" prop="handleRemark">
+            <a-textarea
+              id="handleManage-name"
+              :maxLength="100"
+              v-model.trim="form.handleRemark"
+              @change="filterEmpty"
+              placeholder="请输入处理描述(最多100个字符)"
+              allowClear />
+          </a-form-model-item>
+        </a-form-model>
+        <div class="btn-cont">
+          <a-button id="handleManage-cancel" @click="isShow = false" style="margin-right: 15px;">取消</a-button>
+          <a-button type="primary" id="handleManage-save" @click="handleSave">保存</a-button>
+        </div>
+      </a-spin>
+    </div>
+  </a-modal>
+</template>
+
+<script>
+import { commonMixin } from '@/utils/mixin'
+// 组件
+import { VSelect } from '@/components'
+// 接口
+import { allocateTypeSave } from '@/api/allocateType'
+export default {
+  name: 'ValidEditModal',
+  mixins: [commonMixin],
+  components: { VSelect },
+  props: {
+    openModal: { //  弹框显示状态
+      type: Boolean,
+      default: false
+    },
+    itemSn: {
+      type: [Number, String],
+      default: ''
+    },
+    nowData: {
+      type: Object,
+      default: null
+    }
+  },
+  data () {
+    return {
+      isShow: this.openModal, //  是否打开弹框
+      spinning: false,
+      // form 表单
+      formItemLayout: {
+        labelCol: { span: 6 },
+        wrapperCol: { span: 16 }
+      },
+      // 提交参数
+      form: {
+        handleRemark: '', // 处理描述
+        handleResult: undefined // 处理状态
+      },
+      // 表单验证规则
+      rules: {
+        handleResult: [
+          { required: true, message: '请选择处理状态', trigger: 'change' }
+        ],
+        handleRemark: [
+          { required: true, message: '请输入处理描述', trigger: 'change' }
+        ]
+      }
+    }
+  },
+  methods: {
+    // 处理描述 去空格
+    filterEmpty () {
+      let str = this.form.name
+      str = str.replace(/\ +/g, '')
+      str = str.replace(/[ ]/g, '')
+      str = str.replace(/[\r\n]/g, '')
+      this.form.name = str
+    },
+    //  保存
+    handleSave () {
+      const _this = this
+      this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          const form = _this.form
+          form.id = _this.itemSn ? _this.itemSn : null
+          _this.spinning = true
+          allocateTypeSave(form).then(res => {
+            if (res.status == 200) {
+              _this.$message.success(res.message)
+              _this.$emit('close', 1)
+              _this.spinning = false
+            } else {
+              _this.spinning = false
+            }
+          })
+        } else {
+          return false
+        }
+      })
+    }
+  },
+  watch: {
+    //  父页面传过来的弹框状态
+    openModal (newValue, oldValue) {
+      this.isShow = newValue
+    },
+    //  重定义的弹框状态
+    isShow (newValue, oldValue) {
+      if (!newValue) {
+        this.$emit('close', 0)
+        this.$refs.ruleForm.resetFields()
+      }
+    },
+    itemSn (newValue, oldValue) {
+      if (this.isShow && newValue) { //  编辑
+        this.form.handleResult = this.nowData && this.nowData.handleResult ? this.nowData.handleResult : ''
+        this.form.handleRemark = this.nowData && this.nowData.handleRemark ? this.nowData.handleRemark : ''
+      } else { //  添加
+        this.form.handleRemark = ''
+        this.form.handleResult = undefined
+      }
+    }
+  }
+}
+</script>
+
+<style lang="less">
+  .handleManage-modal{
+    .ant-modal-body {
+      padding: 40px 40px 24px;
+    }
+    .btn-cont {
+      text-align: center;
+      margin: 35px 0 10px;
+    }
+  }
+</style>

+ 243 - 0
src/views/setting/dataValidManagement/list.vue

@@ -0,0 +1,243 @@
+<template>
+  <div>
+    <a-card size="small" :bordered="false" class="erpMessageManagement-wrap searchBoxNormal">
+      <!-- 搜索条件 -->
+      <div ref="tableSearch" class="table-page-search-wrapper">
+        <a-form layout="inline" id="erpMessageManagement-form" @keyup.enter.native="$refs.table.refresh(true)">
+          <a-row :gutter="15">
+            <a-col :md="6" :sm="24">
+              <a-form-item label="同步时间">
+                <rangeDate ref="rangeDate" id="erpMessageManagement-rangeDate" @change="dateChange" />
+              </a-form-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-item label="处理状态">
+                <a-select placeholder="请选择处理状态" id="erpMessageManagement-handleResult" v-model="queryParam.handleResult">
+                  <a-select-option value="finish" id="erpMessageManagement-handleResult-finish">
+                    处理成功
+                  </a-select-option>
+                  <a-select-option value="fail" id="erpMessageManagement-handleResult-fail">
+                    处理失败
+                  </a-select-option>
+                </a-select>
+              </a-form-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-item label="业务编码">
+                <a-input id="erpMessageManagement-bizId" v-model.trim="queryParam.bizId" allowClear placeholder="请输入完整的业务编码"/>
+              </a-form-item>
+            </a-col>
+            <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
+              <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="erpMessageManagement-refresh">查询</a-button>
+              <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="erpMessageManagement-reset">重置</a-button>
+            </a-col>
+          </a-row>
+        </a-form>
+      </div>
+    </a-card>
+    <!-- 列表 -->
+    <a-card size="small" :bordered="false">
+      <a-spin :spinning="spinning" tip="Loading...">
+        <s-table
+          class="sTable fixPagination"
+          id="erpMessageManagement-table"
+          ref="table"
+          :style="{ height: tableHeight+70+'px' }"
+          size="small"
+          :rowKey="(record) => record.id"
+          :columns="columns"
+          :data="loadData"
+          :scroll="{ y: tableHeight }"
+          :defaultLoadData="false"
+          bordered>
+          <!-- 同步状态 -->
+          <template slot="syncStatus" slot-scope="text, record">
+            <span v-if="record.handleResult&&record.handleResult=='finish'">处理成功</span>
+            <span v-else-if="record.handleResult&&record.handleResult=='wait'">等待处理</span>
+            <span v-else style="color:#ed1c24;">处理失败</span>
+          </template>
+          <!-- 错误信息 -->
+          <template slot="errInfo" slot-scope="text, record">
+            <div v-if="record.errInfo">
+              <a-popover trigger="hover">
+                <template slot="content">
+                  {{ record.errInfo }}
+                </template>
+                <div>{{ record.errInfo }}</div>
+              </a-popover>
+            </div>
+            <div v-else>--</div>
+          </template>
+          <!-- 操作 -->
+          <template slot="action" slot-scope="text, record">
+            <div>
+              <a-button
+                size="small"
+                type="link"
+                class="button-info"
+                @click="handleCli(record)"
+                :id="'erpMessageManagement-handle-btn'+record.id">处理</a-button>
+              <a-button
+                size="small"
+                type="link"
+                class="button-info"
+                @click="handleAgainVeriy(record)"
+                :id="'erpMessageManagement-reOperate-btn'+record.id">重新验证</a-button>
+            </div>
+          </template>
+        </s-table>
+      </a-spin>
+    </a-card>
+    <!-- 新增/编辑 -->
+    <editModal :openModal="openModal" :nowData="nowData" :itemSn="itemSn" @close="closeModal" />
+  </div>
+</template>
+
+<script>
+import { commonMixin } from '@/utils/mixin'
+// 组件
+import { STable, VSelect } from '@/components'
+import rangeDate from '@/views/common/rangeDate.vue'
+import editModal from './editModal.vue'
+// 接口
+import { queryReceivePage, handle } from '@/api/mqmsg'
+export default {
+  name: 'DataValidManagementList',
+  mixins: [commonMixin],
+  components: { STable, VSelect, rangeDate, editModal },
+  data () {
+    return {
+      spinning: false,
+      disabled: false, //  查询、重置按钮是否可操作
+      tableHeight: 0, // 列表高度
+      // 查询参数
+      queryParam: {
+        createDateStart: '', // 同步开始时间
+        createDateEnd: '', // 同步结束时间
+        handleResult: undefined, // 处理状态
+        bizType: 'KdMidSpareInputs', // 业务类型
+        bizId: undefined// 业务编码
+      },
+      // 表头
+      columns: [
+        { title: '序号', dataIndex: 'no', width: '3.5%', align: 'center' },
+        { title: '业务编号', dataIndex: 'bizId', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '校验时间', dataIndex: 'createDate', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '业务名称', dataIndex: 'lastHandleDate0', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '错误信息', scopedSlots: { customRender: 'errInfo' }, width: '15%', align: 'center', ellipsis: true },
+        { title: '校验内容', dataIndex: 'lastHandleDate1', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '校验结果', dataIndex: 'lastHandleDate2', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '校验内容', dataIndex: 'lastHandleDate3', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '处理状态', scopedSlots: { customRender: 'syncStatus' }, width: '10%', align: 'center' },
+        { title: '处理描述', dataIndex: 'lastHandleDate4', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '处理时间', dataIndex: 'lastHandleDate', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: '7%', align: 'center' }
+      ],
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.disabled = true
+        this.spinning = true
+        // 获取列表数据 有分页
+        return queryReceivePage(Object.assign(parameter, this.queryParam)).then(res => {
+          let data
+          if (res.status == 200) {
+            data = res.data
+            // 计算表格序号
+            const no = (data.pageNo - 1) * data.pageSize
+            for (var i = 0; i < data.list.length; i++) {
+              data.list[i].no = no + i + 1
+            }
+            this.disabled = false
+          }
+          this.spinning = false
+          return data
+        })
+      },
+      openModal: false, //  新增编辑调拨类型  弹框
+      itemSn: '', //  当前sn
+      nowData: null //  当前记录数据
+    }
+  },
+  methods: {
+    //  同步时间  change
+    dateChange (date) {
+      this.queryParam.createDateStart = date[0] ? date[0] : ''
+      this.queryParam.createDateEnd = date[1] ? date[1] : ''
+    },
+    //  重置
+    resetSearchForm () {
+      this.queryParam.handleResult = undefined
+      this.queryParam.createDateStart = ''
+      this.queryParam.createDateEnd = ''
+      this.queryParam.bizId = undefined
+      this.$refs.rangeDate.resetDate()
+      this.$refs.table.refresh(true)
+    },
+    // 处理
+    handleCli (row) {
+      this.itemSn = row ? row.id : null
+      this.nowData = row
+      this.openModal = true
+    },
+    // 重新同步
+    handleAgainVeriy (row) {
+      const _this = this
+      this.$confirm({
+        title: '提示',
+        content: '重新验证会保留原数据,并重新生成一条无处理状态与处理描述的相同数据,确认重新验证吗?',
+        centered: true,
+        onOk () {
+          _this.spinning = true
+          handle({ id: row.id }).then(res => {
+            if (res.status == 200) {
+              _this.$message.success(res.message)
+              _this.$refs.table.refresh()
+            }
+            _this.spinning = false
+          })
+        }
+      })
+    },
+    // 初始化
+    pageInit () {
+      const _this = this
+      this.$nextTick(() => { // 页面渲染完成后的回调
+        _this.setTableH()
+      })
+    },
+    // 计算表格高度
+    setTableH () {
+      const tableSearchH = this.$refs.tableSearch.offsetHeight
+      this.tableHeight = window.innerHeight - tableSearchH - 200
+    }
+  },
+  watch: {
+    '$store.state.app.winHeight' (newValue, oldValue) { //  窗口变更时,需同时更改表格高度
+      this.setTableH()
+    }
+  },
+  mounted () {
+    if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
+      this.pageInit()
+      this.resetSearchForm()
+    }
+  },
+  activated () {
+    // 如果是新页签打开,则重置当前页面
+    if (this.$store.state.app.isNewTab) {
+      this.pageInit()
+      this.resetSearchForm()
+    }
+    // 仅刷新列表,不重置页面
+    if (this.$store.state.app.updateList) {
+      this.pageInit()
+      this.$refs.table.refresh()
+    }
+  }
+}
+</script>
+<style lang="less" scope>
+   .ant-table-tbody .ant-table-row{
+       height:42px !important;
+    }
+</style>

+ 175 - 0
src/views/setting/erpAllotSettings/editModal.vue

@@ -0,0 +1,175 @@
+<template>
+  <a-modal
+    centered
+    class="transferTypeManagementEdit-modal"
+    :footer="null"
+    :maskClosable="false"
+    :title="modalTit"
+    v-model="isShow"
+    @cancel="isShow=false"
+    :width="800">
+    <!-- 表单 -->
+    <div>
+      <a-spin :spinning="spinning" tip="Loading...">
+        <a-form-model
+          id="transferTypeManagementEdit-form"
+          ref="ruleForm"
+          :model="form"
+          :rules="rules"
+          :label-col="formItemLayout.labelCol"
+          :wrapper-col="formItemLayout.wrapperCol"
+        >
+          <a-form-model-item label="调拨类别" prop="allocateCategory">
+            <allocateType id="transferTypeManagementEdit-allocateCategory" v-model="allocateType" @change="changeCategory" :level="2" placeholder="请选择调拨类别"></allocateType>
+          </a-form-model-item>
+          <a-form-model-item label="调拨类型名称" prop="name">
+            <a-input
+              id="transferTypeManagementEdit-name"
+              :maxLength="30"
+              v-model.trim="form.name"
+              @change="filterEmpty"
+              placeholder="请输入调拨类型名称(最多30个字符)"
+              allowClear />
+          </a-form-model-item>
+        </a-form-model>
+        <div class="btn-cont">
+          <a-button id="transferTypeManagementEdit-cancel" @click="isShow = false" style="margin-right: 15px;">取消</a-button>
+          <a-button type="primary" id="transferTypeManagementEdit-save" @click="handleSave">保存</a-button>
+        </div>
+      </a-spin>
+    </div>
+  </a-modal>
+</template>
+
+<script>
+import { commonMixin } from '@/utils/mixin'
+// 组件
+import { VSelect } from '@/components'
+import allocateType from '@/views/common/allocateType'
+// 接口
+import { allocateTypeSave } from '@/api/allocateType'
+export default {
+  name: 'TransferTypeManagementEditModal',
+  mixins: [commonMixin],
+  components: { VSelect, allocateType },
+  props: {
+    openModal: { //  弹框显示状态
+      type: Boolean,
+      default: false
+    },
+    itemSn: {
+      type: [Number, String],
+      default: ''
+    },
+    nowData: {
+      type: Object,
+      default: null
+    }
+  },
+  computed: {
+    // 弹窗标题
+    modalTit () {
+      return (this.itemSn ? '编辑' : '新增') + '调拨类型'
+    }
+  },
+  data () {
+    return {
+      isShow: this.openModal, //  是否打开弹框
+      spinning: false,
+      // form 表单
+      formItemLayout: {
+        labelCol: { span: 6 },
+        wrapperCol: { span: 16 }
+      },
+      allocateType: [], // 调拨类别
+      // 提交参数
+      form: {
+        name: '', // 调拨类型名称
+        allocateCategory: undefined, //  调拨类别
+        treeLevel: 3
+      },
+      // 表单验证规则
+      rules: {
+        allocateCategory: [
+          { required: true, message: '请选择调拨类别', trigger: 'change' }
+        ],
+        name: [
+          { required: true, message: '请输入调拨类型名称', trigger: 'change' }
+        ]
+      }
+    }
+  },
+  methods: {
+    // 调拨类型名称 去空格
+    filterEmpty () {
+      let str = this.form.name
+      str = str.replace(/\ +/g, '')
+      str = str.replace(/[ ]/g, '')
+      str = str.replace(/[\r\n]/g, '')
+      this.form.name = str
+    },
+    // 调拨类别 change
+    changeCategory (v, opt) {
+      this.form.allocateCategory = v && v[1] ? v[1] : ''
+    },
+    //  保存
+    handleSave () {
+      const _this = this
+      this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          const form = _this.form
+          form.allocateTypeSn = _this.itemSn ? _this.itemSn : null
+          _this.spinning = true
+          allocateTypeSave(form).then(res => {
+            if (res.status == 200) {
+              _this.$message.success(res.message)
+              _this.$emit('close', 1)
+              _this.spinning = false
+            } else {
+              _this.spinning = false
+            }
+          })
+        } else {
+          return false
+        }
+      })
+    }
+  },
+  watch: {
+    //  父页面传过来的弹框状态
+    openModal (newValue, oldValue) {
+      this.isShow = newValue
+    },
+    //  重定义的弹框状态
+    isShow (newValue, oldValue) {
+      if (!newValue) {
+        this.$emit('close', 0)
+        this.$refs.ruleForm.resetFields()
+        this.allocateType = []
+      }
+    },
+    itemSn (newValue, oldValue) {
+      if (this.isShow && newValue) { //  编辑
+        this.form.name = this.nowData && this.nowData.name ? this.nowData.name : ''
+        this.form.allocateCategory = this.nowData.allocateType[1]
+        this.allocateType = this.nowData.allocateType
+      } else { //  添加
+        this.form.name = ''
+        this.form.allocateCategory = undefined
+      }
+    }
+  }
+}
+</script>
+
+<style lang="less">
+  .transferTypeManagementEdit-modal{
+    .ant-modal-body {
+      padding: 40px 40px 24px;
+    }
+    .btn-cont {
+      text-align: center;
+      margin: 35px 0 10px;
+    }
+  }
+</style>

+ 131 - 20
src/views/setting/erpAllotSettings/list.vue

@@ -1,5 +1,20 @@
 <template>
   <a-card size="small" :bordered="false" class="erpAllotSettings-wrap">
+    <!-- 操作按钮 -->
+    <div ref="tableSearch" class="table-operator-nobor">
+      <a-button
+        id="transferTypeManagementList-add"
+        type="primary"
+        v-if="$hasPermissions('B_transferTypeManagement_add')"
+        @click="handleEdit()">新增</a-button>
+      <v-select
+        size="small"
+        code="ERP_PRICE_TYPE"
+        ref="erpPriceType"
+        v-show="false"
+        @loaded="loadedOk"
+      ></v-select>
+    </div>
     <a-spin :spinning="spinning" tip="Loading...">
       <!-- 列表 -->
       <s-table
@@ -8,31 +23,56 @@
         ref="table"
         :style="{ height: tableHeight+60+'px'}"
         size="small"
-        :rowKey="(record) => record.id"
+        :rowKey="(record) => record.allocateTypeSn"
+        rowName="allocateTypeSn"
         :columns="columns"
         :showPagination="false"
         :data="loadData"
         :scroll="{ y: tableHeight }"
         :defaultLoadData="false"
         childrenColumnName="sonList"
+        :expandedRowKeys="expandedRowKeys"
         bordered>
         <template slot="titles" slot-scope="text, record">
           {{ record.name }}
         </template>
         <!-- 操作 -->
         <template slot="action" slot-scope="text, record">
-          <v-select
+          <a-button
+            size="small"
+            type="link"
+            class="button-info"
+            @click="handleEdit(record)"
+            v-if="record.root==1 && $hasPermissions('B_transferTypeManagement_edit')"
+            :id="'erpAllotSet-edit-btn-'+record.id">编辑</a-button>
+          <a-button
+            size="small"
+            type="link"
+            class="button-error"
+            @click="handleDel(record)"
+            v-if="record.root==1 && $hasPermissions('B_transferTypeManagement_del')"
+            :id="'erpAllotSet-del-btn-'+record.id">删除</a-button>
+        </template>
+        <!-- 价格类型 -->
+        <template slot="priceType" slot-scope="text, record">
+          <a-select
             v-if="record.root==1"
             size="small"
-            style="width:30%;"
-            code="ERP_PRICE_TYPE"
+            style="width:50%;"
             :id="'erpAllotSettings-erpPriceType'+record.id"
             v-model="record.erpPriceType"
-            placeholder="请选择"
-            @change="e=>handleType(record,e)"></v-select>
+            placeholder="请选择价格类型"
+            @change="e=>handleType(record,e)"
+          >
+            <a-select-option v-for="item in erpPriceTypeList" :key="item.code" :value="item.code">
+              {{ item.dispName }}
+            </a-select-option>
+          </a-select>
         </template>
       </s-table>
     </a-spin>
+    <!-- 新增/编辑 -->
+    <editModal :openModal="openModal" :nowData="nowData" :itemSn="itemSn" @close="closeModal" />
   </a-card>
 </template>
 
@@ -40,20 +80,22 @@
 import { commonMixin } from '@/utils/mixin'
 // 组件
 import { STable, VSelect } from '@/components'
+import editModal from './editModal.vue'
 // 接口
-import { allocateTypeTreeList, allocateTypeSave } from '@/api/allocateType.js'
+import { allocateTypeTreeList, allocateTypeSave, allocateTypeDel } from '@/api/allocateType.js'
 export default {
   name: 'ErpAllotSettings',
   mixins: [commonMixin],
-  components: { STable, VSelect },
+  components: { STable, VSelect, editModal },
   data () {
     return {
       spinning: false,
       tableHeight: 0, // 表格高度
       // 表头
       columns: [
-        { title: '费用/调拨类型', scopedSlots: { customRender: 'titles' }, width: '70%', align: 'left' },
-        { title: '同步ERP价格类型', scopedSlots: { customRender: 'action' }, width: '30%', align: 'center' }
+        { title: '费用/调拨类型/类型名称', scopedSlots: { customRender: 'titles' }, width: '60%', align: 'left' },
+        { title: '同步ERP价格类型', scopedSlots: { customRender: 'priceType' }, width: '20%', align: 'center' },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: '20%', align: 'center' }
       ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
@@ -62,24 +104,93 @@ export default {
         return allocateTypeTreeList(parameter).then(res => {
           let data
           if (res.status == 200) {
-            const newData = this.findChild(res.data)
-            data = newData
+            this.allData = res.data
+            data = this.findChild(res.data)
           }
           this.spinning = false
           return data
         })
       },
-      itemId: null // 当前行数据id
+      allData: [], // 所有数据
+      openModal: false, //  新增编辑调拨类型  弹框
+      itemSn: '', //  当前sn
+      nowData: null, //  当前记录数据
+      expandedRowKeys: [],
+      erpPriceTypeList: []
     }
   },
   methods: {
+    loadedOk (data) {
+      this.erpPriceTypeList = data
+    },
+    //  新增/编辑
+    handleEdit (row) {
+      console.log(row)
+      this.itemSn = row ? row.allocateTypeSn : null
+      this.nowData = {
+        name: row ? row.name : '',
+        allocateTypeSn: row ? row.allocateTypeSn : '',
+        allocateType: []
+      }
+      // 编辑时
+      if (row) {
+        this.findParent(this.allData, row ? row.allocateTypeSn : '')
+      } else {
+        this.openModal = true
+      }
+    },
+    // 查找父节点
+    findParent (treeList, sn) {
+      const _this = this
+      treeList.forEach(item => {
+        if (item.sonList && item.sonList.length > 0) {
+          _this.nowData.allocateType.push(item.allocateTypeSn)
+          _this.findParent(item.sonList, sn)
+        } else {
+          if (item.allocateTypeSn == sn) {
+            _this.openModal = true
+            return false
+          }
+        }
+      })
+    },
+    //  删除
+    handleDel (row) {
+      const _this = this
+      _this.$confirm({
+        title: '提示',
+        content: '删除后原数据不可恢复,是否删除?',
+        centered: true,
+        onOk () {
+          _this.spinning = true
+          allocateTypeDel({ sn: row.allocateTypeSn }).then(res => {
+            if (res.status == 200) {
+              _this.$message.success(res.message)
+              _this.$refs.table.refresh()
+              _this.spinning = false
+            } else {
+              _this.spinning = false
+            }
+          })
+        }
+      })
+    },
+    //  关闭弹框
+    closeModal (flag) {
+      this.itemSn = ''
+      this.openModal = false
+      if (flag == 1) {
+        this.$refs.table.refresh(true)
+      }
+    },
     // 查找树的子节点
     findChild (treeList) {
       treeList.forEach(item => {
         if (item.sonList && item.sonList.length > 0) {
           this.findChild(item.sonList)
+          this.expandedRowKeys.push(item.allocateTypeSn)
         } else {
-          item.root = this.$hasPermissions('B_erpAllotSettings_erpPriceType') ? 1 : 0
+          item.root = item.treeLevel == 3 && this.$hasPermissions('B_erpAllotSettings_erpPriceType') ? 1 : 0
         }
       })
       return treeList
@@ -101,14 +212,17 @@ export default {
     },
     // 初始化
     pageInit () {
-      const _this = this
       this.$nextTick(() => { // 页面渲染完成后的回调
-        _this.setTableH()
+        this.setTableH()
       })
+      setTimeout(() => {
+        this.$refs.table.refresh(true)
+      }, 100)
     },
     // 计算表格高度
     setTableH () {
-      this.tableHeight = window.innerHeight - 180
+      const tableSearchH = this.$refs.tableSearch.offsetHeight
+      this.tableHeight = window.innerHeight - tableSearchH - 165
     }
   },
   watch: {
@@ -119,19 +233,16 @@ export default {
   mounted () {
     if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
       this.pageInit()
-      this.$refs.table.refresh()
     }
   },
   activated () {
     // 如果是新页签打开,则重置当前页面
     if (this.$store.state.app.isNewTab) {
       this.pageInit()
-      this.$refs.table.refresh()
     }
     // 仅刷新列表,不重置页面
     if (this.$store.state.app.updateList) {
       this.pageInit()
-      this.$refs.table.refresh()
     }
   },
   beforeRouteEnter (to, from, next) {