|
|
@@ -0,0 +1,636 @@
|
|
|
+<template>
|
|
|
+ <div>
|
|
|
+ <el-breadcrumb class="heading">
|
|
|
+ <el-breadcrumb-item :to="{ path: '/' }">平台首页</el-breadcrumb-item>
|
|
|
+ <el-breadcrumb-item :to="{ path: '/oilsupplier/addtionaudit/techlist' }">增项审批</el-breadcrumb-item>
|
|
|
+ <el-breadcrumb-item>编辑</el-breadcrumb-item>
|
|
|
+ </el-breadcrumb>
|
|
|
+ <el-card class="box-card">
|
|
|
+ <div slot="header">
|
|
|
+ <span>
|
|
|
+ <i class="icon icon-table2"></i> 编辑
|
|
|
+ </span>
|
|
|
+ <span style="float: right;">
|
|
|
+ <el-button type="primary" size="mini" @click="AuditEntity">提交审批</el-button>
|
|
|
+ <router-link :to="'/oilsupplier/addtionaudit/techlist'">
|
|
|
+ <el-button type="primary" size="mini" style="margin-left: 8px">返回</el-button>
|
|
|
+ </router-link>
|
|
|
+ </span>
|
|
|
+ </div>
|
|
|
+ <div>
|
|
|
+ <el-card class="box-card">
|
|
|
+ <div slot="header">
|
|
|
+ <span><i class="icon icon-table2"></i> 增项信息</span>
|
|
|
+ <el-button style="float: right; padding: 3px 0" type="text" @click="saveEntity()">保存信息</el-button>
|
|
|
+ </div>
|
|
|
+ <el-form label-width="150px" ref="EntityForm" :rules="appendRules" :model="formData">
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="推荐单位名称" prop="checkSelectedRecUnitName">
|
|
|
+ <el-cascader ref="tjdwCascader" :options="organizeTreeList" :props="organizeTreeProps" change-on-select :show-all-levels="false"
|
|
|
+ v-model="selectedOrgList" @change="getCode2" placeholder="请选择推荐单位" style="width: 100%">
|
|
|
+ </el-cascader>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="供应方公司名称" prop="checkSelectedSupplier">
|
|
|
+ <el-select v-model="supplierOptions" filterable @change="getInfo" placeholder="请选择供应方公司" style="width: 100%">
|
|
|
+ <el-option
|
|
|
+ v-for="item in supplierList"
|
|
|
+ :key="item.SupplierId"
|
|
|
+ :label="item.SupplierName"
|
|
|
+ :value="item.SupplierId">
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <!-- <el-col :span="12">
|
|
|
+ <el-form-item label="推荐单位编码" prop="RecUnitId">
|
|
|
+ <el-input v-model="formData.RecUnitId" placeholder="请输入推荐单位编码"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col> -->
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-form-item label="备注" prop="Remark">
|
|
|
+ <el-input type="textarea" v-model="formData.Remark" placeholder="请输入"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </el-form>
|
|
|
+ </el-card>
|
|
|
+ <!-- 增项分类列表 -->
|
|
|
+ <el-card class="box-card" style="margin-top: 10px;">
|
|
|
+ <div slot="header">
|
|
|
+ <span><i class="icon icon-table2"></i> 增项分类</span>
|
|
|
+ <el-button style="float: right; padding: 3px 0" type="text" @click="addSortData()">添加</el-button>
|
|
|
+ </div>
|
|
|
+ <el-table :data="entityList" border height="calc(100vh - 345px)" style="width: 100%" @sort-change="orderby">
|
|
|
+ <el-table-column label="操作" min-width="100" align="center" fixed>
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-button type="text" title="编辑" size="medium" icon="el-icon-edit" @click="editSortData(scope.row)"></el-button>
|
|
|
+ <el-button type="text" title="删除" size="medium" icon="el-icon-delete" @click="deleteData(scope.row.Id)"></el-button>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="SortFlag" label="分类标记" v-if="1==2" show-overflow-tooltip></el-table-column>
|
|
|
+ <el-table-column prop="Code" label="分类编码" show-overflow-tooltip></el-table-column>
|
|
|
+ <el-table-column prop="Name" label="分类名称" show-overflow-tooltip></el-table-column>
|
|
|
+ <el-table-column prop="Remark" label="备注" show-overflow-tooltip></el-table-column>
|
|
|
+ </el-table>
|
|
|
+ <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="currentPage"
|
|
|
+ :page-sizes="[10, 15, 20, 25]" :page-size="size" layout="total, sizes, prev, pager, next, jumper" :total="currentItemCount">
|
|
|
+ </el-pagination>
|
|
|
+ </el-card>
|
|
|
+ </div>
|
|
|
+ </el-card>
|
|
|
+ <!-- 增项分类添加、修改 -->
|
|
|
+ <el-dialog :title="dialogTitle" :visible.sync="dialogVisible" width="800px">
|
|
|
+ <el-form label-width="150px" ref="dialogFormData" :rules="sortEntityFormRules" :model="dialogFormData" >
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="分类名称" prop="checkSelectedOptList">
|
|
|
+ <el-cascader ref="cascader" :options="optionsList" style="width:100%" :props="orgtreeprops" change-on-select :show-all-levels="false"
|
|
|
+ v-model="selectedOptList" @change="getCode" placeholder="请选择分类">
|
|
|
+ </el-cascader>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="分类编码" prop="Code">
|
|
|
+ <el-input v-model="dialogFormData.Code" placeholder="请输入分类编码" disabled></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-form-item label="备注" prop="Remark">
|
|
|
+ <el-input type="textarea" v-model="dialogFormData.Remark" placeholder="请输入备注" style="width: 100%"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </el-form>
|
|
|
+ <span slot="footer" class="dialog-footer">
|
|
|
+ <el-button size="mini" @click="cancelOption()">取 消</el-button>
|
|
|
+ <el-button size="mini" type="primary" @click="ensureOption()">确 定</el-button>
|
|
|
+ </span>
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+ import {
|
|
|
+ mapGetters
|
|
|
+ } from 'vuex'
|
|
|
+ import api from '@/api/oilsupplier/supplierappendsub'
|
|
|
+ import api2 from '@/api/oilsupplier/supplierappend'
|
|
|
+ import apiCert from '@/api/oilsupplier/suppliercert'
|
|
|
+
|
|
|
+ export default {
|
|
|
+ computed: {
|
|
|
+ ...mapGetters({
|
|
|
+ authUser: 'authUser'
|
|
|
+ })
|
|
|
+ },
|
|
|
+ name: 'oilsuppliercertappendsub',
|
|
|
+
|
|
|
+ data() {
|
|
|
+ var CheckSelectedOption = (rule, value, callback) => {
|
|
|
+ if (this.selectedOrgList && this.selectedOrgList.length < 1) {
|
|
|
+ callback(new Error('请选择推荐单位'))
|
|
|
+ } else {
|
|
|
+ callback()
|
|
|
+ }
|
|
|
+ }
|
|
|
+ var CheckSelectedOption2 = (rule, value, callback) => {
|
|
|
+ if (this.selectedOptList && this.selectedOptList.length < 1) {
|
|
|
+ callback(new Error('请选择增项'))
|
|
|
+ } else {
|
|
|
+ callback()
|
|
|
+ }
|
|
|
+ }
|
|
|
+ var CheckSelectedOption3 = (rule, value, callback) => {
|
|
|
+ if (this.supplierOptions === '') {
|
|
|
+ callback(new Error('请选择供应方公司'))
|
|
|
+ } else {
|
|
|
+ callback()
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return {
|
|
|
+ supplierList: [], //供应方公司列表
|
|
|
+ supplierOptions: '', //已选择的供应方公司列表
|
|
|
+ // serviceType: '', //服务类型()
|
|
|
+ optionsList: [], //增项分类层级列表
|
|
|
+ selectedOptList: [], //已选择的增项分类列表
|
|
|
+ orgtreeprops: {
|
|
|
+ value: 'id',
|
|
|
+ label: 'Name',
|
|
|
+ children: 'children'
|
|
|
+ },
|
|
|
+ organizeTreeList: [], //推荐单位层级列表
|
|
|
+ selectedOrgList: [], //已选择的单位列表
|
|
|
+ organizeTreeProps: {
|
|
|
+ value: 'id',
|
|
|
+ label: 'Fullname',
|
|
|
+ children: 'children'
|
|
|
+ },
|
|
|
+ organizeform: {
|
|
|
+ IsInnerOrganize: 1,
|
|
|
+ parentid: 0,
|
|
|
+ fullname: '',
|
|
|
+ description: '',
|
|
|
+ id: 0
|
|
|
+ },
|
|
|
+ //增项信息表
|
|
|
+ formData: {
|
|
|
+ Id: '',
|
|
|
+ SupplierId: 1,
|
|
|
+ SupplierCertId: 1,
|
|
|
+ RecUnitFlag: '',//推荐单位的级联Id标记
|
|
|
+ RecUnitId: '', //推荐单位编码
|
|
|
+ RecUnitName: '', //推荐单位名称
|
|
|
+ AppendType: '', //增项类别(1 物资类,2 基建类,3 技术服务类)
|
|
|
+ Remark: '',//备注
|
|
|
+ },
|
|
|
+ dialogVisible: false,//增项分类dialog
|
|
|
+ dialogTitle: '',
|
|
|
+ dialogFormData: {
|
|
|
+ Id: '',
|
|
|
+ SupplierId: 1,//供方表ID
|
|
|
+ SupplierCertId: 1,//供方证书表ID
|
|
|
+ SupplierCertAppendId: '',//增项信息表ID
|
|
|
+ SubClassId: 2,//分类表主键(物资类或基建类或技术服务类)
|
|
|
+ SortFlag: '',//分类标记
|
|
|
+ Code: '',//分类编码
|
|
|
+ Name: '',//分类名称
|
|
|
+ Remark: '',//备注
|
|
|
+ },
|
|
|
+ //列表数据
|
|
|
+ entityList: [],
|
|
|
+ //分页参数
|
|
|
+ size: 10,
|
|
|
+ currentPage: 1,
|
|
|
+ currentItemCount: 0,
|
|
|
+ //列表排序
|
|
|
+ Column: {
|
|
|
+ Order: '',
|
|
|
+ Prop: ''
|
|
|
+ },
|
|
|
+ //增项表单规则
|
|
|
+ appendRules: {
|
|
|
+ checkSelectedRecUnitName: [{
|
|
|
+ required: true,
|
|
|
+ validator: CheckSelectedOption,
|
|
|
+ trigger: 'blur'
|
|
|
+ }],
|
|
|
+ checkSelectedSupplier: [{
|
|
|
+ required: true,
|
|
|
+ validator: CheckSelectedOption3,
|
|
|
+ trigger: 'blur'
|
|
|
+ }],
|
|
|
+ },
|
|
|
+ //增项分类表单规则
|
|
|
+ sortEntityFormRules: {
|
|
|
+ checkSelectedOptList: [{
|
|
|
+ required: true,
|
|
|
+ validator: CheckSelectedOption2,
|
|
|
+ trigger: 'blur'
|
|
|
+ }],
|
|
|
+ },
|
|
|
+ Id: '', //传的参数
|
|
|
+ editFlag: '', //编辑操作标记
|
|
|
+ }
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ // this.serviceType = this.$route.params.opera //获取服务类型
|
|
|
+ this.Id = this.$route.query.Id
|
|
|
+ this.editFlag = this.$route.query.editFlag
|
|
|
+ if(this.editFlag == '1' && this.Id !== '') {
|
|
|
+ this.getEntityById()
|
|
|
+ this.dialogFormData.SupplierCertAppendId = this.Id
|
|
|
+ this.getSortList()
|
|
|
+ }
|
|
|
+ this.getOrgTreeList() //获取推荐单位层级列表
|
|
|
+ this.getTechTreeList() //获取技术服务类层级列表
|
|
|
+ this.getSupplierList() //获取供应方公司列表
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+
|
|
|
+ //获取推荐单位列表
|
|
|
+ getOrgTreeList() {
|
|
|
+ let _this = this
|
|
|
+ let params = {
|
|
|
+ IsInnerOrganize: this.organizeform.IsInnerOrganize
|
|
|
+ }
|
|
|
+ _this.$axios.get('organizes/list', {
|
|
|
+ params
|
|
|
+ })
|
|
|
+ .then(res => {
|
|
|
+ _this.organizeTreeList = window.toolfun_gettreejson(res.data.items, 'Id', 'Parentid', 'Id,Fullname')
|
|
|
+ })
|
|
|
+ .catch(err => {
|
|
|
+ console.error(err)
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+ //获取供应方公司列表
|
|
|
+ getSupplierList() {
|
|
|
+ let _this = this
|
|
|
+ _this.$axios.get('/suppliercertappend/getsupplier/' + '3', {})
|
|
|
+ .then(res => {
|
|
|
+ _this.supplierList = res.data
|
|
|
+ })
|
|
|
+ .catch(err => {
|
|
|
+ console.error(err)
|
|
|
+ })
|
|
|
+ },
|
|
|
+ //提交审批
|
|
|
+ AuditEntity() {
|
|
|
+ apiCert.auditEntityappend(this.Id, this.$axios).then(res => {
|
|
|
+ if (res.data.code === 0) {
|
|
|
+ //保存成功后,初始化数据,变成修改
|
|
|
+ this.initDatas()
|
|
|
+ this.$message({
|
|
|
+ type: 'success',
|
|
|
+ message: res.data.message
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ this.$message({
|
|
|
+ type: 'warning',
|
|
|
+ message: res.data.message
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }).catch(err => {
|
|
|
+ console.error(err)
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
+ //获取技术服务类层级列表
|
|
|
+ getTechTreeList() {
|
|
|
+ let _this = this
|
|
|
+ this.$axios.get('technologyservice/businesslist', {})
|
|
|
+ .then(res => {
|
|
|
+ _this.optionsList = window.toolfun_gettreejson(res.data.items, 'Id', 'ParentId', 'Id,Name')
|
|
|
+ })
|
|
|
+ .catch(err => {
|
|
|
+ console.error(err)
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+ //获取SupplierId和SupplierCertId
|
|
|
+ getInfo(vId) {//这个vId也就是value值
|
|
|
+ let obj = {}
|
|
|
+ obj = this.supplierList.find((item)=>{
|
|
|
+ return item.SupplierId === vId;//筛选出匹配数据
|
|
|
+ })
|
|
|
+ this.formData.SupplierId = parseInt(obj.SupplierId)
|
|
|
+ this.formData.SupplierCertId = parseInt(obj.SupplierCertId)
|
|
|
+ },
|
|
|
+
|
|
|
+ //获取分类级联Id
|
|
|
+ getCode(item) {
|
|
|
+ let sortFlagStr = item.toString()
|
|
|
+ this.dialogFormData.SortFlag = sortFlagStr
|
|
|
+ this.getCodeById(item[item.length-1]) //根据分类Id获取Code
|
|
|
+ },
|
|
|
+
|
|
|
+ //根据分类Id获取Code
|
|
|
+ getCodeById(Id) {
|
|
|
+ let _this = this
|
|
|
+ this.$axios.get('technologyservice/getcode/' + Id, {})
|
|
|
+ .then(res => {
|
|
|
+ _this.dialogFormData.Code = res.data.items[0].Code
|
|
|
+ })
|
|
|
+ .catch(err => {
|
|
|
+ console.error(err)
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+ //获取推荐单位级联Id
|
|
|
+ getCode2(item) {
|
|
|
+ let codeStr = item.toString()
|
|
|
+ this.formData.RecUnitFlag = codeStr
|
|
|
+ },
|
|
|
+
|
|
|
+ //获取需要修改的增项信息
|
|
|
+ getEntityById() {
|
|
|
+ let _this = this
|
|
|
+ api2.getEntityById(_this.Id, _this.$axios).then(res => {
|
|
|
+ _this.formData = res.data
|
|
|
+ //显示原推荐单位
|
|
|
+ if (_this.formData.RecUnitFlag != null) {
|
|
|
+ let arr = _this.formData.RecUnitFlag.split(',')
|
|
|
+ let arr2 = []
|
|
|
+ for (let i = 0; i < arr.length; i++) {
|
|
|
+ arr2.push(parseInt(arr[i]))
|
|
|
+ }
|
|
|
+ _this.selectedOrgList = arr2
|
|
|
+ }
|
|
|
+ //显示公司名
|
|
|
+ _this.supplierOptions = _this.formData.SupplierId.toString()
|
|
|
+ }).catch(err => {
|
|
|
+ console.error(err)
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+ //保存增项信息
|
|
|
+ saveEntity() {
|
|
|
+ let _this = this
|
|
|
+ this.$refs['EntityForm'].validate((valid) => {
|
|
|
+ if (valid) {
|
|
|
+ let arr = _this.$refs['tjdwCascader'].currentLabels
|
|
|
+ _this.formData.RecUnitName = arr[arr.length - 1] //获取推荐单位名
|
|
|
+ if(_this.editFlag == '1' && _this.Id !== '') {
|
|
|
+ _this.updateData()
|
|
|
+ } else {
|
|
|
+ _this.addAppend()
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+ //更新增项信息
|
|
|
+ updateData() {
|
|
|
+ let _this = this
|
|
|
+ api2.updateEntity(_this.Id, _this.formData, _this.$axios).then(res => {
|
|
|
+ if (res.data.code === 0) {
|
|
|
+ this.$message({
|
|
|
+ type: 'success',
|
|
|
+ message: res.data.message
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ this.$message({
|
|
|
+ type: 'warning',
|
|
|
+ message: res.data.message
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }).catch(err => {
|
|
|
+ console.error(err)
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+ //获取增项分类表
|
|
|
+ getSortList() {
|
|
|
+ //分页及列表条件
|
|
|
+ let params = {
|
|
|
+ _currentPage: this.currentPage,
|
|
|
+ _size: this.size,
|
|
|
+ Order: this.Column.Order,
|
|
|
+ Prop: this.Column.Prop,
|
|
|
+ SupplierCertAppendId: this.dialogFormData.SupplierCertAppendId,
|
|
|
+ };
|
|
|
+ //访问接口
|
|
|
+ api.getList(params, this.$axios).then(res => {
|
|
|
+ this.entityList = res.data.items
|
|
|
+ this.currentItemCount = res.data.currentItemCount
|
|
|
+ }).catch(err => {
|
|
|
+ console.error(err)
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+ //添加增项信息
|
|
|
+ addAppend() {
|
|
|
+ let _this = this
|
|
|
+ _this.formData.AppendType = '3'
|
|
|
+ _this.$axios.post('/suppliercertappend/addappend/', _this.formData)
|
|
|
+ .then(res => {
|
|
|
+ if (res.data.code === 0) {
|
|
|
+ _this.dialogFormData.SupplierCertAppendId = res.data.item //接收插入数据后返回的Id
|
|
|
+ _this.$message({
|
|
|
+ type: 'success',
|
|
|
+ message: res.data.message,
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ _this.$message({
|
|
|
+ type: 'warning',
|
|
|
+ message: res.data.message
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .catch(err => {
|
|
|
+ console.error(err)
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+ //添加增项分类
|
|
|
+ addSortData() {
|
|
|
+ let _this = this
|
|
|
+ //先判断是否保存了增项信息
|
|
|
+ if(this.checkAppendSave()) {
|
|
|
+ _this.dialogTitle = '添加'
|
|
|
+ _this.dialogVisible = true
|
|
|
+ _this.selectedOptList = [] //置空,防止先修改再添加时的已选分类信息保留
|
|
|
+ _this.dialogFormData.Id = ''
|
|
|
+ _this.dialogFormData.SortFlag = ''
|
|
|
+ _this.dialogFormData.Code = ''
|
|
|
+ _this.dialogFormData.Remark = ''
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ //编辑增项分类
|
|
|
+ editSortData(row) {
|
|
|
+ let _this = this
|
|
|
+ _this.dialogTitle = '编辑'
|
|
|
+ _this.dialogVisible = true
|
|
|
+ _this.dialogFormData = row
|
|
|
+ //显示原增项结构
|
|
|
+ if (_this.dialogFormData.SortFlag != null) {
|
|
|
+ let arr = _this.dialogFormData.SortFlag.split(',')
|
|
|
+ let arr2 = []
|
|
|
+ for (let i = 0; i < arr.length; i++) {
|
|
|
+ arr2.push(parseInt(arr[i]))
|
|
|
+ }
|
|
|
+ _this.selectedOptList = arr2
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ //取消
|
|
|
+ cancelOption() {
|
|
|
+ let _this = this
|
|
|
+ _this.dialogVisible = false
|
|
|
+ },
|
|
|
+
|
|
|
+ //确定
|
|
|
+ ensureOption() {
|
|
|
+ this.$refs['dialogFormData'].validate((valid) => {
|
|
|
+ if (valid) {
|
|
|
+ let _this = this
|
|
|
+ if (_this.dialogTitle == '添加') {
|
|
|
+ let arr = []
|
|
|
+ arr = _this.$refs['cascader'].currentLabels //_this.$refs['cascader'].currentLabels获取当前级联选项的id对应的value
|
|
|
+ _this.dialogFormData.Name = arr[arr.length - 1]
|
|
|
+ _this.dialogFormData.SupplierCertAppendId = parseInt(_this.dialogFormData.SupplierCertAppendId)
|
|
|
+ _this.addSortAppend()
|
|
|
+ }
|
|
|
+ if (_this.dialogTitle == '编辑') {
|
|
|
+ let arr = []
|
|
|
+ arr = _this.$refs['cascader'].currentLabels
|
|
|
+ _this.dialogFormData.Name = arr[arr.length - 1]
|
|
|
+ api.updateEntity(_this.dialogFormData.Id, _this.dialogFormData, _this.$axios).then(res => {
|
|
|
+ if (res.data.code === 0) {
|
|
|
+ this.$message({
|
|
|
+ type: 'success',
|
|
|
+ message: res.data.message
|
|
|
+ });
|
|
|
+ //关闭dialog
|
|
|
+ _this.dialogVisible = false
|
|
|
+ //更新列表
|
|
|
+ this.getSortList()
|
|
|
+ } else {
|
|
|
+ this.$message({
|
|
|
+ type: 'warning',
|
|
|
+ message: res.data.message
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }).catch(err => {
|
|
|
+ console.error(err)
|
|
|
+ })
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+ //判断是否保存了增项信息
|
|
|
+ checkAppendSave() {
|
|
|
+ if (this.dialogFormData.SupplierCertAppendId == '' && this.editFlag == null) {
|
|
|
+ this.$message({
|
|
|
+ type: 'error',
|
|
|
+ message: '无法执行该命令,请先保存增项信息!'
|
|
|
+ })
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ return true
|
|
|
+ },
|
|
|
+
|
|
|
+ //添加增项分类信息
|
|
|
+ addSortAppend() {
|
|
|
+ let _this = this
|
|
|
+ _this.$axios.post('/suppliercertappendsub/addappendsub/', _this.dialogFormData)
|
|
|
+ .then(res => {
|
|
|
+ if (res.data.code === 0) {
|
|
|
+ _this.$message({
|
|
|
+ type: 'success',
|
|
|
+ message: res.data.message,
|
|
|
+ })
|
|
|
+ //关闭dialog
|
|
|
+ _this.dialogVisible = false
|
|
|
+ //更新增项分类表
|
|
|
+ _this.getSortList()
|
|
|
+ } else {
|
|
|
+ _this.$message({
|
|
|
+ type: 'warning',
|
|
|
+ message: res.data.message
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .catch(err => {
|
|
|
+ console.error(err)
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+ //删除增项分类信息
|
|
|
+ deleteData(Id) {
|
|
|
+ let _this = this
|
|
|
+ _this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning'
|
|
|
+ }).then(() => {
|
|
|
+ api.deleteEntity(Id, _this.$axios)
|
|
|
+ .then(res => {
|
|
|
+ // response
|
|
|
+ if (res.data.code === 0) {
|
|
|
+ _this.$message({
|
|
|
+ type: 'success',
|
|
|
+ message: res.data.message
|
|
|
+ })
|
|
|
+ // 更新列表
|
|
|
+ this.getSortList()
|
|
|
+ } else {
|
|
|
+ _this.$message({
|
|
|
+ type: 'warning',
|
|
|
+ message: res.data.message
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .catch(() => {})
|
|
|
+ })
|
|
|
+ .catch(() => {})
|
|
|
+ },
|
|
|
+
|
|
|
+ //列表排序功能
|
|
|
+ orderby(column) {
|
|
|
+ if (column.order == 'ascending') {
|
|
|
+ this.Column.Order = 'asc'
|
|
|
+ } else if (column.order == 'descending') {
|
|
|
+ this.Column.Order = 'desc'
|
|
|
+ }
|
|
|
+ this.Column.Prop = column.prop
|
|
|
+ this.initData()
|
|
|
+ },
|
|
|
+ //分页功能
|
|
|
+ handleCurrentChange(value) {
|
|
|
+ this.currentPage = value
|
|
|
+ this.initData()
|
|
|
+ },
|
|
|
+ handleSizeChange(value) {
|
|
|
+ this.size = value
|
|
|
+ this.currentPage = 1
|
|
|
+ this.initData()
|
|
|
+ },
|
|
|
+
|
|
|
+ jstimehandle(val) {
|
|
|
+ if (val === '') {
|
|
|
+ return '----'
|
|
|
+ } else if (val === '0001-01-01T08:00:00+08:00') {
|
|
|
+ return '----'
|
|
|
+ } else if (val === '5000-01-01T23:59:59+08:00') {
|
|
|
+ return '永久'
|
|
|
+ } else {
|
|
|
+ val = val.replace('T', ' ')
|
|
|
+ return val.substring(0, 10)
|
|
|
+ }
|
|
|
+ },
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+</script>
|