TblTradePurchaseList.vue 17.4 KB
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545
<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 -->
    
    <!-- 操作按钮区域 -->
    <div class="table-operator">
      <a-button @click="handlePurchase" type="primary">采买订单</a-button>
      <a-button @click="handleAbnormal" type="primary">物料异常</a-button>
      
      <!-- <a-button type="primary" icon="download" @click="handleExportXls('贸易管理物料表')">导出</a-button>
      <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
        <a-button type="primary" icon="import">导入</a-button>
      </a-upload> -->
    </div>
    <!-- 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>

        <span slot="action" slot-scope="text, record">
          <a @click="handleEdit(record)">投标</a>

          <!-- <a-divider type="vertical" />
          <a-dropdown>
            <a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
            <a-menu slot="overlay">
              <a-menu-item>
                <a @click="handleDetail(record)">详情</a>
              </a-menu-item>
              <a-menu-item>
                <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
                  <a>删除</a>
                </a-popconfirm>
              </a-menu-item>
            </a-menu>
          </a-dropdown> -->
        </span>

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

    
    <j-modal
      :title="title"
      :width="1200"
      :visible="visible"
      :maskClosable="false"
      switchFullscreen
      @ok="handleOk"
      :okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
      @cancel="handleCancel">
      <TblTradePurchaseInfoList  v-if="title == '采买订单'"/>
      <TblTradePurchaseAbnormalList v-if="title == '物料异常'"/>
    </j-modal>
  </a-card>
</template>

<script>
  import { getAction,postAction } from '@api/manage'
  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  import TblTradePurchaseInfoList from './TblTradePurchaseInfoList.vue'
  import TblTradePurchaseAbnormalList from './TblTradePurchaseAbnormalList.vue'
  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: {
      TblTradePurchaseInfoList,
      TblTradePurchaseAbnormalList
    },
    data () {
      return {
        description: '采买表管理页面',
        title: '',
        disableSubmit: true,
        visible:false,
        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:'中标时间',
            key:'sj',
            type: JVXETypes.input,
            disabled: true,
            width:"200px",
            placeholder: '请输入${title}',
            defaultValue:'',
          },
          {
            title:'交货时间',
            key:'jhsj',
            type: JVXETypes.input,
            disabled: true,
            width:"200px",
            placeholder: '请输入${title}',
            defaultValue:'',
          },
          {
            title:'物料编码',
            align:"center",
            key: 'wlbm',
            type: JVXETypes.input,
            disabled: true,
            width:"200px",
            placeholder: '请输入${title}',
            defaultValue:'',
          },
          {
            title: '物料长描述',
            align: 'center',
            key: 'miaoshu',
            type: JVXETypes.input,
            disabled: true,
            width:"200px",
            placeholder: '请输入${title}',
            defaultValue:'',
          },
          {
            title: '单位',
            align: 'center',
            key: 'jldw',
            type: JVXETypes.input,
            disabled: true,
            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: 'xqdw',
            type: JVXETypes.input,
            disabled: true,
            width:"200px",
            placeholder: '请输入${title}',
            defaultValue:'',
          },
          {
            title:'库存信息',
            align:"center",
            key: 's111fzb',
            type: JVXETypes.input,
            disabled: true,
            width:"200px",
            placeholder: '请输入${title}',
            defaultValue:'',
          },
          {
            title:'订单未发货信息',
            align:"center",
            key: '11',
            type: JVXETypes.input,
            disabled: true,
            width:"200px",
            placeholder: '请输入${title}',
            defaultValue:'',
          },
          {
            title:'询价信息资料',
            align:"center",
            key: '1',
            type: JVXETypes.input,
            disabled: true,
            width:"200px",
            placeholder: '请输入${title}',
            defaultValue:'',
          },
          {
            title:'来件不良未处理数量',
            align:"center",
            key: 'ljblwclsl',
            type: JVXETypes.input,
            disabled: true,
            width:"200px",
            placeholder: '请输入${title}',
            defaultValue:'',
          },
          {
            title:'渠道',
            align:"center",
            key: 'qudao',
            type: JVXETypes.select,
            options:[{value:'合同',text:'合同'},{value:'线上',text:'线上'},{value:'线下',text:'线下'}],
            width:"100px",
            placeholder: '请输入${title}',
            defaultValue:'',
          },
          {
            title:'合同号/订单号',
            align:"center",
            key: 'hth',
            type: JVXETypes.input,
            width:"200px",
            placeholder: '请输入${title}',
            defaultValue:'',
          },
          {
            title:'厂商/渠道平台',
            align:"center",
            key: 'cs',
            type: JVXETypes.input,
            width:"200px",
            placeholder: '请输入${title}',
            defaultValue:'',
          },
          {
            title:'物流单号',
            align:"center",
            key: 'wldh',
            type: JVXETypes.input,
            width:"200px",
            placeholder: '请输入${title}',
            defaultValue:'',
          },
          {
            title:'预计到厂时间',
            align:"center",
            key: 'yjdcsj',
            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',
            type: JVXETypes.inputNumber,
            width:"200px",
            placeholder: '请输入${title}',
            defaultValue:'',
          },
          {
            title:'金额(元)',
            align:"center",
            key: 'cgje',
            type: JVXETypes.inputNumber,
            width:"200px",
            placeholder: '请输入${title}',
            defaultValue:'',
          },
          {
            title:'采购',
            align:"center",
            key: 'sfcg',
            type: JVXETypes.select,
            options:[{value:'√',text:'√'},{value:'×',text:'×'}],
            width:"80px",
            placeholder: '请输入${title}',
            defaultValue:'',
          },
          {
            title:'发票信息',
            align:"center",
            key: 'fpxx',
            type: JVXETypes.select,
            options:[{value:'专票',text:'专票'},{value:'普票',text:'普票'},{value:'收据',text:'收据'}],
            width:"200px",
            placeholder: '请输入${title}',
            defaultValue:'',
          },
          {
            title:'发票税额',
            align:"center",
            key: 'fpse',
            type: JVXETypes.input,
            width:"200px",
            placeholder: '请输入${title}',
            defaultValue:'',
          },
          {
            title:'付款比例',
            align:"center",
            key: 'fkbl',
            type: JVXETypes.input,
            width:"200px",
            placeholder: '请输入${title}',
            defaultValue:'',
          },
          {
            title:'到货',
            align:"center",
            key: 'sfdh',
            type: JVXETypes.select,
            options:[{value:'√',text:'√'},{value:'×',text:'×'}],
            width:"80px",
            placeholder: '请输入${title}',
            defaultValue:'',
          },
          {
            title:'已付款',
            align:"center",
            key: 'yfk',
            type: JVXETypes.input,
            width:"200px",
            placeholder: '请输入${title}',
            defaultValue:'',
          },
          {
            title:'已付款金额',
            align:"center",
            key: 'yfkje',
            type: JVXETypes.input,
            width:"200px",
            placeholder: '请输入${title}',
            defaultValue:'',
          },
          {
            title:'待付款',
            align:"center",
            key: 'dfk',
            type: JVXETypes.input,
            width:"200px",
            placeholder: '请输入${title}',
            defaultValue:'',
          },
          {
            title:'发票号码',
            align:"center",
            key: 'fphm',
            type: JVXETypes.input,
            width:"200px",
            placeholder: '请输入${title}',
            defaultValue:'',
          },
          {
            title:'发票金额',
            align:"center",
            key: 'fpje',
            type: JVXETypes.input,
            width:"200px",
            placeholder: '请输入${title}',
            defaultValue:'',
          },
          {
            title:'发票欠额',
            align:"center",
            key: 'fpqe',
            type: JVXETypes.input,
            width:"200px",
            placeholder: '请输入${title}',
            defaultValue:'',
          },
          {
            title:'是否结案',
            align:"center",
            key: 'sfja',
            type: JVXETypes.select,
            options:[{value:'是',text:'是'},{value:'否',text:'否'}],
            width:"200px",
            placeholder: '请输入${title}',
            defaultValue:'',
          },
          {
            title:'是否已经出库',
            align:"center",
            key: 'sfyjch',
            type: JVXETypes.select,
            options:[{value:'是',text:'是'},{value:'否',text:'否'}],
            width:"200px",
            placeholder: '请输入${title}',
            defaultValue:'',
          },
        ],
        url: {
          list: "/trade/tblTradeBidSub/purchaseList",
          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(){
        this.title = '采买订单';
        this.visible = true;
      },
      handleAbnormal(){
        this.title = '物料异常';
        this.visible = true;
      },
      handleOk () {
        
      },
      handleCancel () {
        this.visible = false;
      },
      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>