Crunchy
2023-12-07 6d213775d14a63d18d9eb17b44ba14bd3bb220da
src/views/quality/Packaging_ledger/pack-from.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,174 @@
<template>
    <el-dialog
      width="60%"
      title="新增"
      top="5vh"
      :visible.sync="innerVisible"
      :show="currshowlist"
      @close="$emit('update:currshowlist', false)"
      append-to-body
      class="part-dialog"
    >
      <ttable
        :table="table"
        @currentChange="Getdata"
        :prelang="prelang"
        :options="options"
        :ajaxFun="ajaxFun"
        :bottomOffset="350"
        ref="paramTable"
      >
        <template #toolbar></template>
      </ttable>
      <div slot="footer" class="dialog-footer">
        <el-button @click="innerVisible = false">取 æ¶ˆ</el-button>
        <el-button type="primary" @click="saveSelectRow">ç¡® å®š</el-button>
      </div>
    </el-dialog>
  </template>
  <script>
import { customerpage,pagedataadd } from '@/api/quality/Packaging_ledger'
import ttable from '@/views/common/ztt-table.vue'
  export default {
    props:{
        currshowlist: {
            type: Boolean,
            default: false
        },
    },
    data() {
      return {
        datalistid:{},
        ajaxFun: customerpage,
        currentRow: false,
        typeOptions: [],
        innerVisible: false,
        listLoading: true,
        multipleSelection: [],
        isShowQuery: false,
        uploadInfo: {
          // æ˜¯å¦å±•示上传EXCEL以及对应的url
          isShow: false,
          url: ''
        },
        prelang: 'operation',
        options: {
          height: 300, // é»˜è®¤é«˜åº¦-为了表头固定
          stripe: true, // æ˜¯å¦ä¸ºæ–‘马纹 table
          highlightCurrentRow: false, // æ˜¯å¦è¦é«˜äº®å½“前行
          border: true, // æ˜¯å¦æœ‰çºµå‘边框
          lazy: false, // æ˜¯å¦éœ€è¦æ‡’加载
          fit: true, // åˆ—的宽度是否自撑开
          multiSelect: false, //
          isEdit:false,
          seqNo: true,
          isShowHide: true, // æ˜¯å¦æ˜¾ç¤ºæ˜¾å½±æŒ‰é’®
          isSearch: true, // é«˜çº§æŸ¥è¯¢æŒ‰é’®
          defaultOrderBy: { column: 'createTime', direction: 'desc' }
        },
        table: {
          total: 0,
          currentPage: 1,
          pageSize: 20,
          data: [],
          // æ ‡é¢˜
          column: [
            {
              minWidth: 'code',
              prop: 'contractNo',
              label: '合同号',
              sort: true,
              isTrue: true,
              isSearch: true,
              searchInfoType: 'text'
            },
            {
              minWidth: '120',
              prop: 'customerName',
              label: '客户名称',
              sort: true,
              isTrue: true,
              isSearch: true,
              searchInfoType: 'text'
            },
            {
              minWidth: '140',
              prop: 'customerNo',
              label: '客户编码',
              sort: true,
              isTrue: true,
              isSearch: true,
              searchInfoType: 'text',
            },
            {
              minWidth: '120',
              prop: 'deliveryDate',
              label: '交货日期',
              sort: true,
              isTrue: true,
              isSearch: true,
              searchInfoType: 'datetimerange'
            },
            {
              minWidth: '120',
              prop: 'entityName',
              label: '工程名称',
              sort: true,
              isTrue: true,
              isSearch: true,
              searchInfoType: 'text'
            },
          ],
        },
        addOrUpdateVisible: false
      }
    },
    components: {
      ttable
    },
    watch: {
      currshowlist() {
        console.log(22211);
        this.innerVisible = this.currshowlist
        if (this.currshowlist) {
          this.$nextTick(() => {
            this.getData()
          })
        }
      }
    },
    computed: {
    //   ...mapGetters(['permissions'])
    },
    created() {
      this.getParamType()
    },
    methods: {
         // èŽ·å–æ•°æ®åˆ—è¡¨
        // getData() {
        // this.$refs.paramTable.getDataList()
        // },
        Getdata(val){
            console.log(val);
            this.datalistid = val
        },
      saveSelectRow() {
        let packageBox = {
            customerId:this.datalistid.id,
            contractNo:this.datalistid.contractNo
        }
        pagedataadd (packageBox).then((res =>{
            if (res.status === 200) {
                this.$message.success('新增成功')
                this.$emit('refreshDataList')
            }else{
                this.$message.error('创建失败')
            }
        }))
        this.innerVisible = false
          this.$emit('wayapi',this.innerVisible )
      },
    }
  }
  </script>