TblTradePurchaseInfoList.vue 11.9 KB
<template>
  <a-card :bordered="false" >
    <!-- 查询区域 -->
    <div class="table-page-search-wrapper">
      <a-form layout="inline" @keyup.enter.native="searchQuery">
        <a-row :gutter="24">
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <a-form-item label="物料长描述">
              <a-input placeholder="请输入物料长描述" v-model="queryParam.miaoshu"></a-input>
            </a-form-item>
          </a-col>
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
              <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
              <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
              <a @click="handleToggleSearch" style="margin-left: 8px">
                {{ toggleSearchStatus ? '收起' : '展开' }}
                <a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>
              </a>
            </span>
          </a-col>
        </a-row>
      </a-form>
    </div>
    <!-- 查询区域-END -->
    
    <!-- table区域-begin -->
    <div>
      <j-vxe-table
        keep-source
        ref="table"
        :columns="columns"
        :dataSource="dataSource"
        :pagination="ipagination"
        :loading="loading"
        :maxHeight="300"
        :rowNumber="true"
        :rowSelection="false"
        :toolbar="true"
        :toolbarConfig="toolbarConfig"
        @save="save"
      >

        <template slot="htmlSlot" slot-scope="text">
          <div v-html="text"></div>
        </template>
        <template slot="imgSlot" slot-scope="text,record">
          <span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span>
          <img v-else :src="getImgView(text)" :preview="record.id" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/>
        </template>
        <template slot="fileSlot" slot-scope="text">
          <span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
          <a-button
            v-else
            :ghost="true"
            type="primary"
            icon="download"
            size="small"
            @click="downloadFile(text)">
            下载
          </a-button>
        </template>

      </j-vxe-table>
    </div>

    <tbl-trade-bid-sub-modal ref="modalForm" @ok="modalFormOk"/>
  </a-card>
</template>

<script>
  import { getAction,postAction } from '@api/manage'
  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  import TblTradeBidSubModal from './modules/TblTradeBidSubModal'
  import '@/assets/less/TableExpand.less'
  
  import { JVxeTableModelMixin } from '@/mixins/JVxeTableModelMixin.js'
  import { JVXETypes } from '@/components/jeecg/JVxeTable'
  import { getRefPromise,VALIDATE_FAILED} from '@/components/jeecg/JVxeTable/utils/vxeUtils.js'
  import { validateDuplicateValue } from '@/utils/util'
  import JFormContainer from '@/components/jeecg/JFormContainer'

  export default {
    name: "TblTradeBidSubList",
    mixins:[JeecgListMixin],
    components: {
      TblTradeBidSubModal
    },
    data () {
      return {
        description: '采买表管理页面',
        toolbarConfig:{
          // prefix 前缀;suffix 后缀;
          slots: ['prefix', 'suffix'],
          // add 新增按钮;remove 删除按钮;clearSelection 清空选择按钮;collapse 展开收起
          btn: ['save', 'remove', 'clearSelection'],
        },
        // 表头
        columns: [
          {
            title: '采购项目编号/协议编号',
            key: 'xjbswjh',
            type: JVXETypes.input,
            disabled: true,
            width:"200px",
            placeholder: '请输入${title}',
            defaultValue:'',
          },
          {
            title:'物料编码',
            align:"center",
            key: 'wlbm',
            disabled: true,
            type: JVXETypes.input,
            width:"200px",
            placeholder: '请输入${title}',
            defaultValue:'',
          },
          {
            title: '物料长描述',
            align: 'center',
            key: 'miaoshu',
            disabled: true,
            type: JVXETypes.input,
            width:"200px",
            placeholder: '请输入${title}',
            defaultValue:'',
          },
          {
            title: '单位',
            align: 'center',
            key: 'jldw',
            disabled: true,
            type: JVXETypes.input,
            width:"200px",
            placeholder: '请输入${title}',
            defaultValue:'',
          },
          {
            title: '品牌',
            align: 'center',
            key: 'pinpai',
            type: JVXETypes.input,
            disabled: true,
            width:"200px",
            placeholder: '请输入${title}',
            defaultValue:'',
          },
          {
            title: '数量',
            align: 'center',
            key: 'sl',
            type: JVXETypes.input,
            disabled: true,
            width:"200px",
            placeholder: '请输入${title}',
            defaultValue:'',
          },
          {
            title:'渠道',
            align:"center",
            key: 'qudao',
            disabled: true,
            type: JVXETypes.select,
            options:[{value:'合同',text:'合同'},{value:'线上',text:'线上'},{value:'线下',text:'线下'}],
            width:"100px",
            placeholder: '请输入${title}',
            defaultValue:'',
          },
          {
            title:'合同号/订单号',
            align:"center",
            key: 'hth',
            disabled: true,
            type: JVXETypes.input,
            width:"200px",
            placeholder: '请输入${title}',
            defaultValue:'',
          },
          {
            title:'厂商/渠道平台',
            align:"center",
            key: 'cs',
            disabled: true,
            type: JVXETypes.input,
            width:"200px",
            placeholder: '请输入${title}',
            defaultValue:'',
          },
          {
            title:'物流单号',
            align:"center",
            key: 'wldh',
            disabled: true,
            type: JVXETypes.input,
            width:"200px",
            placeholder: '请输入${title}',
            defaultValue:'',
          },
          {
            title:'预计到厂时间',
            align:"center",
            key: 'yjdcsj',
            disabled: true,
            type: JVXETypes.date,
            width:"150px",
            placeholder: '请输入${title}',
            defaultValue:'',
          },
          // {
          //   title:'数量',
          //   align:"center",
          //   key: 'cgsl',
          //   type: JVXETypes.inputNumber,
          //   width:"200px",
          //   placeholder: '请输入${title}',
          //   defaultValue:'',
          // },
          {
            title:'单价(元)',
            align:"center",
            key: 'cgdj',
            disabled: true,
            type: JVXETypes.inputNumber,
            width:"200px",
            placeholder: '请输入${title}',
            defaultValue:'',
          },
          {
            title:'金额(元)',
            align:"center",
            key: 'cgje',
            disabled: true,
            type: JVXETypes.inputNumber,
            width:"200px",
            placeholder: '请输入${title}',
            defaultValue:'',
          },
          {
            title:'已入库数量',
            align:"center",
            key: 'yrksl',
            disabled: true,
            type: JVXETypes.inputNumber,
            width:"200px",
            placeholder: '请输入${title}',
            defaultValue:'',
          },
          {
            title:'剩余订单未入库数量',
            align:"center",
            key: 'wrksl',
            disabled: true,
            type: JVXETypes.inputNumber,
            width:"200px",
            placeholder: '请输入${title}',
            defaultValue:'',
          },
          {
            title:'是否结案',
            align:"center",
            key: 'sfja',
            type: JVXETypes.select,
            disabled: true,
            options:[{value:'是',text:'是'},{value:'否',text:'否'}],
            width:"200px",
            placeholder: '请输入${title}',
            defaultValue:'',
          },
          {
            title:'是否有来料异常状况',
            align:"center",
            key: 'sfyllyc',
            type: JVXETypes.select,
            options:[{value:'是',text:'是'},{value:'否',text:'否'}],
            width:"200px",
            placeholder: '请输入${title}',
            defaultValue:'',
          },
          {
            title:'异常原因',
            align:"center",
            key: 'ycyy',
            type: JVXETypes.selectMultiple,
            options:[{value:'来料不良',text:'来料不良'},{value:'来料少件',text:'来料少件'},{value:'货损',text:'货损'},{value:'发错货',text:'发错货'}],
            width:"200px",
            placeholder: '请输入${title}',
            defaultValue:'',
          },
          
        ],
        url: {
          list: "/trade/tblTradeBidSub/purchaseInfoList",
          delete: "/trade/tblTradeBidSub/delete",
          deleteBatch: "/trade/tblTradeBidSub/deleteBatch",
          exportXlsUrl: "/trade/tblTradeBidSub/exportXls",
          importExcelUrl: "trade/tblTradeBidSub/importExcel",
          batchSave: "/trade/tblTradeBidSub/batchSave",
        },
        dictOptions:{},
        superFieldList:[],
      }
    },
    created() {
      this.getSuperFieldList();
    },
    computed: {
      importExcelUrl: function(){
        return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
      }
    },
    methods: {
      save(){
        this.loading = true
        console.log("formData===>",this.dataSource);
        postAction(this.url.batchSave, this.dataSource).then((res) => {
          if (res.success) {
            this.$message.success(res.message)
          } else {
            this.$message.warning(res.message)
          }
        }).finally(() => {
          this.loading = false
        })
      },
      handlePurchase(){
        
      },
      handleAbnormal(){
        
      },
      initDictConfig(){
      },
      getSuperFieldList(){
        let fieldList=[];
        fieldList.push({type:'string',value:'tradeId',text:'关联招标id',dictCode:''})
        fieldList.push({type:'string',value:'xjbswjh',text:'询价标书文件号',dictCode:''})
        fieldList.push({type:'string',value:'wlbm',text:'物料编码',dictCode:''})
        fieldList.push({type:'string',value:'kcsj',text:'库存数据',dictCode:''})
        fieldList.push({type:'string',value:'ztkf',text:'在途库存',dictCode:''})
        fieldList.push({type:'string',value:'kcdj',text:'库存单价(含税运)(元)',dictCode:''})
        fieldList.push({type:'string',value:'ztdj',text:'在途单价(含税运)(元)',dictCode:''})
        fieldList.push({type:'string',value:'lstbj',text:'历史投标价(元)',dictCode:''})
        fieldList.push({type:'string',value:'lszbj',text:'历史中标价(元)',dictCode:''})
        fieldList.push({type:'string',value:'tbjg',text:'投标价格(元)',dictCode:''})
        fieldList.push({type:'string',value:'zbj',text:'中标价',dictCode:''})
        fieldList.push({type:'string',value:'djchay',text:'单价差异',dictCode:''})
        fieldList.push({type:'string',value:'sl',text:'数量',dictCode:''})
        fieldList.push({type:'string',value:'sj',text:'时间',dictCode:''})
        fieldList.push({type:'string',value:'sfzb',text:'是否中标',dictCode:''})
        fieldList.push({type:'string',value:'sfcgwc',text:'是否已采购完成',dictCode:''})
        fieldList.push({type:'string',value:'jhsj',text:'交货时间',dictCode:''})
        this.superFieldList = fieldList
      },
    }
  }
</script>
<style scoped>
  @import '~@assets/less/common.less';
</style>