Crunchy
2023-12-07 6d213775d14a63d18d9eb17b44ba14bd3bb220da
src/views/quality/Packaging_ledger/pack-fromadd.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,171 @@
<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"
        @handleSelectionChange="handleSelectionChange"
        :prelang="prelang"
        :options="options"
        :ajaxFun="ajaxFun"
        :paramObj="packageBoxIddata"
        :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 { dataadd,saveList } from '@/api/quality/Packaging_ledger'
import ttable from '@/views/common/ztt-table.vue'
  export default {
    props:{
        currshowlist: {
            type: Boolean,
            default: false
        },
        packageBoxIddata:{
            type: Object
        },
    },
    data() {
      return {
        datalist:[],
        datalistid:"",
        ajaxFun: dataadd,
        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: true, //
          seqNo: true,
          isShowHide: true, // æ˜¯å¦æ˜¾ç¤ºæ˜¾å½±æŒ‰é’®
          isSearch: true, // é«˜çº§æŸ¥è¯¢æŒ‰é’®
          defaultOrderBy: { column: 'createTime', direction: 'desc' }
        },
        table: {
          total: 0,
          currentPage: 1,
          pageSize: 20,
          data: [],
          // æ ‡é¢˜
          column: [
            {
              minWidth: 'code',
              prop: 'product',
              label: '产品',
              sort: true,
              isTrue: true,
              isSearch: true,
              searchInfoType: 'text'
            },
            {
              minWidth: '120',
              prop: 'productNo',
              label: '产品编号',
              sort: true,
              isTrue: true,
              isSearch: true,
              searchInfoType: 'text'
            },
            {
              minWidth: '140',
              prop: 'specs',
              label: '规格型号',
              sort: true,
              isTrue: true,
              isSearch: true,
              searchInfoType: 'text',
            },
            {
              minWidth: '120',
              prop: 'unit',
              label: '单位',
              sort: true,
              isTrue: true,
              isSearch: true,
              searchInfoType: 'datetimerange'
            },
          ],
        },
        addOrUpdateVisible: false
      }
    },
    components: {
      ttable
    },
    watch: {
      currshowlist() {
        console.log(22211);
        this.innerVisible = this.currshowlist
      }
    },
    computed: {
    //   ...mapGetters(['permissions'])
    },
    created() {
      this.getParamType()
    },
    methods: {
         // èŽ·å–æ•°æ®åˆ—è¡¨
        getData() {
        this.$refs.paramTable.getDataList()
        },
        handleSelectionChange(val){
            let data = val
            data.forEach(el => {
                this.datalistid = el
            });
        },
      saveSelectRow() {
        console.log(this.packageBoxIddata,"123");
        // saveList ({customerId:this.datalistid.id,contractNo:this.datalistid.contractNo}).then((res =>{
        //     console.log(res);
        //     if (res.status === 200) {
        //         this.$message.success('新增成功')
        //     }else{
        //         this.$message.error('创建失败')
        //     }
        // }))
        this.innerVisible = false
        //   this.$emit('handleSelectionChange',this.innerVisible )
      },
      handleSelectionChange(val){
        this.datalist = val
        console.log(this.datalist,"数据");
      },
      saveSelectRow(){
        this.$emit('handleSelectionChange',this.datalist )
        this.innerVisible = false
      }
    }
  }
  </script>