作者 小范

物料申报管理

  1 +<template>
  2 + <section>
  3 + <!--工具条-->
  4 + <el-row class="toolbar">
  5 + <el-form :inline="true" :model="form">
  6 + <el-form-item>
  7 + <el-input v-model="form.aircraftflightno" placeholder="航班号"></el-input>
  8 + </el-form-item>
  9 + <el-form-item>
  10 + <el-button type="primary" @click="getList">查询</el-button>
  11 + </el-form-item>
  12 + <el-form-item>
  13 + <el-button type="success" @click="add">新增</el-button>
  14 + </el-form-item>
  15 + </el-form>
  16 + </el-row>
  17 + <!-- 表单区域-->
  18 + <el-row :span="24" class="toolbar" style="margin-top: 40px">
  19 + <el-col :span="24">
  20 + <el-table
  21 + highlight-current-row
  22 + @selection-change="matterChange"
  23 + style="border-radius: 10px 10px 0px 0px"
  24 + :header-cell-style="{background:'#6F8294',color:'#FFFFFF'}" size="small"
  25 + ref="multipleTable"
  26 + :data="tableData"
  27 + tooltip-effect="dark">
  28 + <el-table-column
  29 + type="selection"
  30 + width="45">
  31 + </el-table-column>
  32 + <el-table-column
  33 + type="index"
  34 + :index="indexMethod"
  35 + width="45">
  36 + </el-table-column>
  37 + <el-table-column
  38 + prop="num"
  39 + label="编号"
  40 + width="80">
  41 + </el-table-column>
  42 + <el-table-column
  43 + prop="aircraftnum"
  44 + label="物料添加航空器编号"
  45 + width="130">
  46 + </el-table-column>
  47 + <el-table-column
  48 + prop="aircraftflightno"
  49 + label="航班号"
  50 + width="80">
  51 + </el-table-column>
  52 + <el-table-column
  53 + prop="aircraftflightdate"
  54 + label="物料添加航班日期"
  55 + width="140">
  56 + </el-table-column>
  57 + <el-table-column
  58 + prop="unaircraftnum"
  59 + label="物料起卸航空器编号"
  60 + width="130">
  61 + </el-table-column>
  62 + <el-table-column
  63 + prop="unaircraftflightno"
  64 + label="物料起卸航班号"
  65 + width="130">
  66 + </el-table-column>
  67 + <el-table-column
  68 + prop="unaircraftlightdate"
  69 + label="物料起卸航班日期"
  70 + width="140">
  71 + </el-table-column>
  72 + <el-table-column
  73 + prop="bustype"
  74 + label="业务类型"
  75 + width="80">
  76 + <template slot-scope="scope">
  77 + <span v-if="scope.row.bustype ==='1'">起卸</span>
  78 + <span v-if="scope.row.bustype ==='3'">添加</span>
  79 + <span v-if="scope.row.bustype ==='5'">调拨</span>
  80 + </template>
  81 + </el-table-column>
  82 + <el-table-column
  83 + prop="remark5"
  84 + label="填写时间"
  85 + width="140">
  86 + </el-table-column>
  87 + <el-table-column
  88 + prop="add"
  89 + width="120"
  90 + label="海关备案状态">
  91 + </el-table-column>
  92 + <el-table-column label="操作" width="300" fixed="right">
  93 + <template slot-scope="scope">
  94 + <el-button type="success" size="mini" @click="edit(scope.$index,scope.row)">编辑</el-button>
  95 +
  96 + <el-button type="warning" size="mini" @click="apply(scope.row)">
  97 + 申请
  98 + </el-button>
  99 + <el-button type="primary" size="mini">
  100 + 完成
  101 + </el-button>
  102 + <el-button type="danger" size="mini" @click="del(scope.row)">
  103 + 删除
  104 + </el-button>
  105 + </template>
  106 +
  107 + </el-table-column>
  108 + </el-table>
  109 +
  110 + </el-col>
  111 + <!--分页区域-->
  112 + <el-col :span="24" style="margin-bottom: 40px;margin-top: 10px">
  113 + <el-pagination
  114 + :current-page="form.pageNum"
  115 + :page-sizes="[10, 50, 100, 500]"
  116 + :page-size="form.pageSize"
  117 + layout="total, sizes, prev, pager, next, jumper"
  118 + :total="total"
  119 + @size-change="handleSizeChange"
  120 + @current-change="handleCurrentChange"
  121 + />
  122 + </el-col>
  123 + </el-row>
  124 +<!-- 弹框区域-->
  125 + <el-row>
  126 + <el-dialog
  127 + :title="dialogMap[dialogStatus]"
  128 + :visible.sync="supply_dialog.addDialog"
  129 + style="margin-top: -50px"
  130 + text-align="center"
  131 + width="95%">
  132 + <template>
  133 + <el-tabs v-model="activeName" @tab-click="handleClick">
  134 + <el-tab-pane label="供退物料信息" name="first">
  135 + <el-form ref="formSupply" :inline="true" :model="formSupply" label-width="145px" label-position="right" :rules="rulesSupply" >
  136 + <el-row style="margin-bottom: 10px">
  137 + <el-col :span="24">
  138 + <div class="grid-content content">申报单位</div>
  139 + </el-col>
  140 + </el-row>
  141 + <el-row>
  142 + <el-col :span="8">
  143 + <el-form-item label="海关关区" prop="customcode">
  144 + <el-input v-model="formSupply.customcode" placeholder="" suffix-icon=“xxxx”></el-input>
  145 + </el-form-item>
  146 + </el-col>
  147 + <el-col :span="8">
  148 + <el-form-item label="申报单流水号" prop="serialnum">
  149 + <el-input v-model="formSupply.serialnum" placeholder="" suffix-icon=“xxxx” />
  150 + </el-form-item>
  151 + </el-col>
  152 + </el-row>
  153 + <el-row style="margin-bottom: 10px">
  154 + <el-col :span="24">
  155 + <div class="grid-content content">供退物料信息</div>
  156 + </el-col>
  157 + </el-row>
  158 + <el-row>
  159 + <el-col :span="8">
  160 + <el-form-item label="业务类型" prop="bustype">
  161 + <div v-if="dialogStatus === 'update'">
  162 + <el-select disabled="" v-model="formSupply.bustype" placeholder="请选择" size="mini">
  163 + <el-option label="1-起卸" value="1"></el-option>
  164 + <el-option label="3-添加" value="3"></el-option>
  165 + <el-option label="5-调拨" value="5"></el-option>
  166 + </el-select>
  167 + </div>
  168 + <div v-else>
  169 + <el-select v-model="formSupply.bustype" placeholder="请选择" size="mini">
  170 + <el-option label="1-起卸" value="1"></el-option>
  171 + <el-option label="3-添加" value="3"></el-option>
  172 + <el-option label="5-调拨" value="5"></el-option>
  173 + </el-select>
  174 + </div>
  175 + </el-form-item>
  176 +<!-- <el-form-item label="业务类型" prop="bustype">-->
  177 +<!-- <el-select v-model="formSupply.bustype" placeholder="请选择" size="mini" :disabled="false">-->
  178 +<!-- <el-option label="1-起卸" value="起卸"></el-option>-->
  179 +<!-- <el-option label="3-添加" value="添加"></el-option>-->
  180 +<!-- <el-option label="5-调拨" value="调拨"></el-option>-->
  181 +<!-- </el-select>-->
  182 +<!-- </el-form-item>-->
  183 + </el-col>
  184 + <el-col :span="8">
  185 + <el-form-item label="运输工具企业代码" prop="enterprisecode">
  186 + <el-input v-model="formSupply.enterprisecode" placeholder="" suffix-icon=“xxxx” />
  187 + </el-form-item>
  188 + </el-col>
  189 + <el-col :span="8">
  190 + <el-form-item label="出发港" prop="destination">
  191 + <el-input v-model="formSupply.destination" placeholder="" suffix-icon=“xxxx” />
  192 + </el-form-item>
  193 + </el-col>
  194 + </el-row>
  195 + <el-row>
  196 + <el-col :span="8">
  197 + <el-form-item label="物料添加航空器编号 " prop="aircraftnum">
  198 + <el-input v-model="formSupply.aircraftnum" placeholder="" suffix-icon=“xxxx”></el-input>
  199 + </el-form-item>
  200 + </el-col>
  201 + <el-col :span="8">
  202 + <el-form-item label="物料添加航班号" prop="aircraftflightno">
  203 + <el-input v-model="formSupply.aircraftflightno" placeholder="" suffix-icon=“xxxx” />
  204 + </el-form-item>
  205 + </el-col>
  206 + <el-col :span="8">
  207 + <el-form-item label="物料添加航班日期" prop="aircraftflightdate">
  208 + <el-date-picker
  209 + v-model="formSupply.aircraftflightdate"
  210 + type="date" size="mini"
  211 + value-format="yyyy-MM-dd"
  212 + format="yyyy-MM-dd"
  213 + style="width:93%"
  214 + placeholder="选择日期">
  215 + </el-date-picker>
  216 + </el-form-item>
  217 + </el-col>
  218 + </el-row>
  219 + <el-row>
  220 + <el-col :span="8">
  221 + <el-form-item label="物料起卸航空器编号" prop="unaircraftnum">
  222 + <el-input v-model="formSupply.unaircraftnum" placeholder="" suffix-icon=“xxxx”></el-input>
  223 + </el-form-item>
  224 + </el-col>
  225 + <el-col :span="8">
  226 + <el-form-item label="物料起卸航班号" prop="unaircraftflightno">
  227 + <el-input v-model="formSupply.unaircraftflightno" placeholder="" suffix-icon=“xxxx” />
  228 + </el-form-item>
  229 + </el-col>
  230 + <el-col :span="8">
  231 + <el-form-item label="物料起卸航班日期" prop="unaircraftlightdate">
  232 + <el-date-picker
  233 + v-model="formSupply.unaircraftlightdate"
  234 + type="date" size="mini"
  235 + value-format="yyyy-MM-dd"
  236 + format="yyyy-MM-dd"
  237 + style="width:93%"
  238 + placeholder="选择日期">
  239 + </el-date-picker>
  240 + </el-form-item>
  241 + </el-col>
  242 + </el-row>
  243 + <el-row style="margin-bottom: 10px">
  244 + <el-col :span="24">
  245 + <div class="grid-content content">备注信息</div>
  246 + </el-col>
  247 + </el-row>
  248 + <el-row>
  249 + <el-col :span="24">
  250 + <el-form-item label="备注" prop="remark">
  251 + <el-input
  252 + v-model="formSupply.remark"
  253 + type="textarea"
  254 + :rows="1" style="width: 520px"
  255 + placeholder="请输入内容"
  256 + />
  257 + </el-form-item>
  258 + </el-col>
  259 + </el-row>
  260 + <el-row style="margin-bottom: 5px;margin-top: 25px">
  261 + <el-col :span="24" :offset="9">
  262 + <el-form-item >
  263 + <el-button style="width: 100px" type="info" @click="supply_dialog.addDialog = false">取消</el-button>
  264 + <el-button type="primary" style="width: 100px" @click="dialogStatus==='create'?mat_add():mat_edit()">提交</el-button>
  265 + </el-form-item>
  266 + </el-col>
  267 + </el-row>
  268 + </el-form>
  269 + </el-tab-pane>
  270 + <el-tab-pane label="货物明细信息" name="second">
  271 + <el-form ref="formCargo" :inline="true" :model="formCargo" label-width="70px" label-position="right" :rules="rulesCargo" >
  272 + <el-row>
  273 + <el-col :span="24">
  274 + <div class="grid-content content">货物信息</div>
  275 + </el-col>
  276 + </el-row>
  277 + <el-row>
  278 + <el-col :span="6">
  279 + <el-form-item label="物料" prop="material">
  280 + <el-select v-model="formCargo.material" placeholder="请选择" size="mini">
  281 + <el-option label="1-航油" value="1"></el-option>
  282 + <el-option label="2-航材" value="2"></el-option>
  283 + <el-option label="3-免税品" value="3"></el-option>
  284 + <el-option label="4-航空食品" value="4"></el-option>
  285 + <el-option label="5-其他" value="5"></el-option>
  286 + </el-select>
  287 + </el-form-item>
  288 + </el-col>
  289 + <el-col :span="6">
  290 + <el-form-item label="物品名称" prop="itemname">
  291 + <el-input v-model="formCargo.itemname" placeholder="" suffix-icon=“xxxx” />
  292 + </el-form-item>
  293 + </el-col>
  294 + <el-col :span="6">
  295 + <el-form-item label="申请数量" prop="applynum">
  296 + <el-input v-model="formCargo.applynum" placeholder="" suffix-icon=“xxxx”></el-input>
  297 + </el-form-item>
  298 + </el-col>
  299 + <el-col :span="6">
  300 + <el-form-item label="计量单位" prop="unit">
  301 + <el-select v-model="formCargo.unit" placeholder="请选择" size="mini">
  302 + <el-option label="000-无" value="000"></el-option>
  303 + <el-option label="001-台" value="001"></el-option>
  304 + <el-option label="002-座" value="002"></el-option>
  305 + <el-option label="003-辆" value="003"></el-option>
  306 + <el-option label="004-艘" value="004"></el-option>
  307 + <el-option label="005-架" value="005"></el-option>
  308 + <el-option label="006-套" value="006"></el-option>
  309 + <el-option label="007-个" value="007"></el-option>
  310 + <el-option label="008-只" value="008"></el-option>
  311 + <el-option label="009-头" value="009"></el-option>
  312 + <el-option label="010-张" value="010"></el-option>
  313 + <el-option label="011-件" value="011"></el-option>
  314 + <el-option label="012-支" value="012"></el-option>
  315 + <el-option label="013-枝" value="013"></el-option>
  316 + <el-option label="014-根" value="014"></el-option>
  317 + <el-option label="015-条" value="015"></el-option>
  318 + <el-option label="016-把" value="016"></el-option>
  319 + <el-option label="017-块" value="017"></el-option>
  320 + <el-option label="018-卷" value="018"></el-option>
  321 + <el-option label="019-副" value="019"></el-option>
  322 + </el-select>
  323 + </el-form-item>
  324 + </el-col>
  325 + </el-row>
  326 + <el-row style="margin-bottom: 10px">
  327 + <el-col :span="24">
  328 + <div class="grid-content content">备注信息</div>
  329 + </el-col>
  330 + </el-row>
  331 + <el-row style="margin-bottom: 10px">
  332 + <el-col :span="12">
  333 + <el-form-item label="备注" prop="remark">
  334 + <el-input
  335 + v-model="formCargo.remark"
  336 + type="textarea"
  337 + :rows="1" style="width: 400px"
  338 + placeholder="请输入内容"
  339 + />
  340 + </el-form-item>
  341 + </el-col>
  342 + <el-col :span="12">
  343 + <el-form-item>
  344 + <el-button type="primary" @click="getListCargo">查询</el-button>
  345 + </el-form-item>
  346 + <el-form-item>
  347 + <el-button type="success" @click="addCargo">保存</el-button>
  348 + </el-form-item>
  349 + </el-col>
  350 + </el-row>
  351 + </el-form>
  352 + <el-table
  353 + @selection-change="handleSelectionChangeMat"
  354 + style="border-radius: 10px 10px 0px 0px;margin-bottom: 20px"
  355 + :header-cell-style="{background:'#6F8294',color:'#FFFFFF'}" size="small"
  356 + ref="multipleTable"
  357 + :data="tableDataCargo"
  358 + tooltip-effect="dark">
  359 + <el-table-column
  360 + type="selection"
  361 + width="55">
  362 + </el-table-column>
  363 + <el-table-column
  364 + type="index"
  365 + width="50">
  366 + </el-table-column>
  367 + <el-table-column
  368 + prop="material"
  369 + label="物料"
  370 + width="120">
  371 + </el-table-column>
  372 + <el-table-column
  373 + prop="itemname"
  374 + label="物品名称"
  375 + width="120">
  376 + </el-table-column>
  377 + <el-table-column
  378 + prop="applynum"
  379 + label="申请数量">
  380 + </el-table-column>
  381 + <el-table-column
  382 + prop="unit"
  383 + label="计量单位"
  384 + width="120">
  385 + </el-table-column>
  386 + <el-table-column
  387 + prop="remark"
  388 + label="备注"
  389 + show-overflow-tooltip>
  390 + </el-table-column>
  391 + <el-table-column label="操作" fixed="right" width="120">
  392 + <template slot-scope="scope">
  393 + <el-button type="danger" size="mini" @click="delCargo(scope.row)">
  394 + 删除
  395 + </el-button>
  396 + </template>
  397 + </el-table-column>
  398 + </el-table>
  399 + <!--分页区域-->
  400 + <el-col :span="24" style="margin-top: 20px;padding-bottom: 30px">
  401 + <el-pagination
  402 + :current-page="pageNumCargo"
  403 + :page-sizes="[10, 50, 100, 500]"
  404 + :page-size="pageSizeCargo"
  405 + layout="total, sizes, prev, pager, next, jumper"
  406 + :total="totalCargo"
  407 + @size-change="handleSizeChangeCargo"
  408 + @current-change="handleCurrentChangeCargo"
  409 + />
  410 + </el-col>
  411 + </el-tab-pane>
  412 + </el-tabs>
  413 + </template>
  414 + </el-dialog>
  415 +
  416 + </el-row>
  417 +
  418 +
  419 + </section>
  420 +</template>
  421 +
  422 +<script>
  423 + import {selectSupplyMatter, addSupplyMatter, ediSupplyMatter, delSupplyMatter,addCargoDetails,delCargoDetails,selectCargoDetails,sendSupplyMatter} from "../../api/transport";
  424 +
  425 + export default {
  426 + name: "matter",
  427 + data(){
  428 + return{
  429 + // 首页>>>>>>>>>>>>>>>>>>>>>>>>>>>>
  430 + form:{
  431 + aircraftflightno:'',
  432 + pageNum: 1,
  433 + pageSize: 10,
  434 + },
  435 + formcargo:{
  436 + supplyid:''
  437 + },
  438 + total: 0,
  439 + tableData:[{
  440 + aircraftflightno:'B5157',
  441 + }],
  442 + multipleSelection:[],
  443 + // 弹框>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
  444 + dialogMap: {
  445 + update: '供退物料新增',
  446 + create: '供退物料修改'
  447 + },
  448 + dialogStatus: 'create',
  449 + supply_dialog: {
  450 + // 添加对话框
  451 + addDialog: false,
  452 + // 编辑对话框
  453 + editDialog: false
  454 + },
  455 + activeName: 'first',
  456 + // 弹框1-1>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
  457 + formSupply:{
  458 + autoid:'',
  459 + customcode:'4604',
  460 + serialnum:'',
  461 + bustype:'1',
  462 + enterprisecode:'460470678395-9',
  463 + aircraftnum:'',
  464 + destination:'CGO',
  465 + aircraftflightno:'',
  466 + aircraftflightdate:'',
  467 + unaircraftnum:'',
  468 + unaircraftflightno:'',
  469 + unaircraftlightdate:'',
  470 + remark:'',
  471 + remark1:'',
  472 + remark2:'',
  473 + remark3:'',
  474 + remark4:'',
  475 + remark5:'',
  476 + createtime:'',
  477 + updatetime:'',
  478 + declar:'',
  479 + },
  480 + rulesSupply: {
  481 + customcode: [
  482 + { required: true, message: '', trigger: 'change' }
  483 + ],
  484 + },
  485 + // 弹框1-2>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
  486 + formCargo:{
  487 + id:'',
  488 + material:'',
  489 + itemname:'',
  490 + applynum:'',
  491 + unit:'',
  492 + remark:'',
  493 + supplyid:'',
  494 + remark1:'',
  495 + remark2:'',
  496 + remark3:'',
  497 + remark4:'',
  498 + },
  499 + pageNumCargo: 1,
  500 + pageSizeCargo: 10,
  501 + totalCargo: 0,
  502 + rulesCargo: {
  503 + material: [
  504 + { required: true, message: '请输入', trigger: 'change' }
  505 + ],
  506 + itemname: [
  507 + { required: true, message: '请输入', trigger: 'change' }
  508 + ],
  509 + applynum: [
  510 + { required: true, message: '请输入', trigger: 'change' }
  511 + ],
  512 + unit: [
  513 + { required: true, message: '请输入', trigger: 'change' }
  514 + ],
  515 + },
  516 + tableDataCargo:[],
  517 + // 多选
  518 + currentRow: null
  519 + }
  520 + },
  521 + mounted() {
  522 + //获取列表
  523 + this.getList();
  524 + // var user = loginuserInfo;
  525 + // if (user) {
  526 + // this.form.username = user.username || '';
  527 + // }
  528 + },
  529 + methods:{
  530 + // 首页>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
  531 + //首页表单分页
  532 + handleSizeChange(val) {
  533 + this.form.pageSize = val
  534 + this.getList()
  535 + },
  536 + handleCurrentChange(val) {
  537 + this.form.pageNum = val
  538 + this.getList()
  539 + },
  540 + // 首页表格选中
  541 + matterChange(val) {
  542 + this.multipleSelection = val;
  543 + },
  544 + // 序列
  545 + indexMethod(index) {
  546 + return index + 1;
  547 + },
  548 + // 获取消息标签列表
  549 + getList() {
  550 + const _this = this
  551 + selectSupplyMatter(this.form).then((response) => {
  552 + const res = response.data
  553 + if (res.code !== '200') {
  554 + return _this.$message.error('获取消息收发记录,失败!')
  555 + }
  556 + // 获取列表数据
  557 + _this.tableData = res.data.list
  558 + // 获取列表的总记录数
  559 + _this.total = res.data.total
  560 + _this.$message.success('获取消息收发记录,成功!')
  561 + }).catch(error => {
  562 + // 关闭加载
  563 + _this.$message.error(error.toString())
  564 + })
  565 + },
  566 + // 打开新增
  567 + add() {
  568 + this.dialogStatus = 'create'
  569 + this.supply_dialog.addDialog = true
  570 + this.tableDataCargo = ''
  571 + this.formCargo = {
  572 + id:'',
  573 + material:'',
  574 + itemname:'',
  575 + applynum:'',
  576 + unit:'',
  577 + remark:'',
  578 + supplyid:'',
  579 + remark1:'',
  580 + remark2:'',
  581 + remark3:'',
  582 + remark4:'',
  583 + }
  584 + this.formSupply = {
  585 + autoid:'',
  586 + customcode:'4604',
  587 + serialnum:'',
  588 + bustype:'',
  589 + enterprisecode:'460470678395-9',
  590 + aircraftnum:'',
  591 + destination:'CGO',
  592 + aircraftflightno:'',
  593 + aircraftflightdate:'',
  594 + unaircraftnum:'',
  595 + unaircraftflightno:'',
  596 + unaircraftlightdate:'',
  597 + remark:'',
  598 + remark1:'',
  599 + remark2:'',
  600 + remark3:'',
  601 + remark4:'',
  602 + remark5:'',
  603 + createtime:'',
  604 + updatetime:'',
  605 + declar:'',
  606 + }
  607 + // this.form.arrivetime = new Date().format('yyyyMMddHHmmss')
  608 + },
  609 + // 新增功能
  610 + mat_add() { // 进行表单的预验证
  611 + this.$refs.formSupply.validate(valid => {
  612 + // 未通过,表单预校验
  613 + if (!valid) return
  614 + addSupplyMatter(this.formSupply).then((response) => {
  615 + const res = response.data;
  616 + // 添加失败
  617 + if (res.code !== '200') {
  618 + // 关闭加载
  619 + return this.$message.error(res.msg)
  620 + }
  621 + // 添加,成功
  622 + this.$message.success(res.msg)
  623 + this.formCargo.supplyid=res.data;
  624 + console.log("---->"+this.formCargo.supplyid)
  625 + // 隐藏对话框
  626 + /*this.supply_dialog.addDialog = false*/
  627 + // 刷新列表
  628 + this.getList()
  629 + }).catch(error => {
  630 + this.$message.error(error.toString())
  631 + })
  632 + })
  633 + },
  634 + // 打开编辑
  635 + edit(index, row) {
  636 + // $("select").each(function () {
  637 + // $("#" + this.id).attr("disabled", true);
  638 + // });
  639 + this.formSupply = Object.assign({}, row)
  640 + this.supply_dialog.addDialog = true
  641 + this.dialogStatus = 'update'
  642 + this.$nextTick(() => {
  643 + this.formSupply = Object.assign({}, row)
  644 + })
  645 + this.formCargo.supplyid=row.autoid;
  646 + this.getListCargo();
  647 + this.formCargo = {
  648 + id:'',
  649 + material:'',
  650 + itemname:'',
  651 + applynum:'',
  652 + unit:'',
  653 + remark:'',
  654 + supplyid:'',
  655 + remark1:'',
  656 + remark2:'',
  657 + remark3:'',
  658 + remark4:'',
  659 + }
  660 + },
  661 + // 编辑功能
  662 + mat_edit() {
  663 + // 进行表单的预验证
  664 + this.$refs.formSupply.validate(valid => {
  665 + // 未通过,表单预校验
  666 + if (!valid) return
  667 + ediSupplyMatter(this.formSupply).then((response) => {
  668 + const res = response.data
  669 + if (res.code !== '200') {
  670 + return this.$message.error(res.msg)
  671 + }
  672 + this.$message.success(res.msg)
  673 + // 隐藏对话框
  674 + // this.supply_dialog.addDialog = false
  675 + // 刷新列表
  676 + this.getList()
  677 + }).catch(error => {
  678 + this.$message.error(error.toString())
  679 + })
  680 + })
  681 + },
  682 + // 删除
  683 + del(row) {
  684 + // 弹框询问是否删除?
  685 + this.$confirm('此操作永久删除该消息收发记录, 是否继续?', '警告', {
  686 + confirmButtonText: '确定删除',
  687 + cancelButtonText: '取消',
  688 + type: 'warning'
  689 + }
  690 + ).then(() => {
  691 + delSupplyMatter(row).then((response) => {
  692 + console.log(row)
  693 + const res = response.data
  694 + if (res.code !== '200') {
  695 + return this.$message.error(res.msg)
  696 + }
  697 + this.$message.success(res.msg)
  698 + // 刷新列表
  699 + this.getList()
  700 + }).catch(error => {
  701 + this.$message.error(res.msg)
  702 + })
  703 + }).catch(() => {
  704 + })
  705 + },
  706 + // 申请
  707 + apply(row) {
  708 + // 弹框询问是否申请?
  709 + this.$confirm('是否发送申请', {
  710 + confirmButtonText: '确定',
  711 + cancelButtonText: '取消',
  712 + type: 'warning'
  713 + }
  714 + ).then(() => {
  715 + sendSupplyMatter(row).then((response) => {
  716 + const res = response.data
  717 + if (res.code !== '200') {
  718 + return this.$message.error(res.msg)
  719 + }
  720 + this.$message.success(res.msg)
  721 + // 刷新列表
  722 + this.getList()
  723 + }).catch(error => {
  724 + this.$message.error(res.msg)
  725 + })
  726 + }).catch(() => {
  727 + })
  728 + },
  729 + // 弹框>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
  730 + // 弹框标签
  731 + handleClick(tab, event) {
  732 + console.log(tab, event);
  733 + },
  734 + // 弹框1-1>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
  735 + // 弹框1-2>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
  736 + // 弹框1-2多选
  737 + handleSelectionChangeMat(val) {
  738 + this.currentRow = val;
  739 + },
  740 + //弹框1-2表单分页
  741 + handleSizeChangeCargo(val) {
  742 + this.pageSizeCargo = val
  743 + this.getListCargo()
  744 + },
  745 + handleCurrentChangeCargo(val) {
  746 + this.pageNumCargo = val
  747 + this.getListCargo()
  748 + },
  749 + // 获取消息标签列表
  750 + getListCargo() {
  751 + const _this = this
  752 + let parms={supplyid:this.formCargo.supplyid};
  753 + selectCargoDetails(parms).then((response) => {
  754 + const res = response.data
  755 + if (res.code !== '200') {
  756 + return _this.$message.error('获取消息收发记录,失败!')
  757 + }
  758 + // 获取列表数据
  759 + _this.tableDataCargo = res.data.list
  760 + // 获取列表的总记录数
  761 + _this.totalCargo = res.data.total
  762 + _this.$message.success('获取消息收发记录,成功!')
  763 + }).catch(error => {
  764 + // 关闭加载
  765 + _this.$message.error(error.toString())
  766 + })
  767 + },
  768 + // 新增功能
  769 + addCargo() { // 进行表单的预验证
  770 + this.$refs.formCargo.validate(valid => {
  771 + // 未通过,表单预校验
  772 + if (!valid) return
  773 + if(this.formCargo.supplyid!=null && this.formCargo.supplyid!=''){
  774 + addCargoDetails(this.formCargo).then((response) => {
  775 + const res = response.data
  776 + // 添加失败
  777 + if (res.code !== '200') {
  778 + // 关闭加载
  779 + return this.$message.error(res.msg)
  780 + }
  781 + // 添加,成功
  782 + this.$message.success(res.msg)
  783 + // 刷新列表
  784 + this.getListCargo()
  785 + }).catch(error => {
  786 + this.$message.error(error.toString())
  787 + })
  788 + }else{
  789 + return this.$message.error("请先保存供料退货信息")
  790 + }
  791 + })
  792 + },
  793 + // 删除
  794 + delCargo(row) {
  795 + // 弹框询问是否删除?
  796 + this.$confirm('此操作永久删除该消息收发记录, 是否继续?', '警告', {
  797 + confirmButtonText: '确定删除',
  798 + cancelButtonText: '取消',
  799 + type: 'warning'
  800 + }
  801 + ).then(() => {
  802 + delCargoDetails(row).then((response) => {
  803 + console.log(row)
  804 + const res = response.data
  805 + if (res.code !== '200') {
  806 + return this.$message.error(res.msg)
  807 + }
  808 + this.$message.success(res.msg)
  809 + // 刷新列表
  810 + this.getListCargo()
  811 + }).catch(error => {
  812 + this.$message.error(res.msg)
  813 + })
  814 + }).catch(() => {
  815 + })
  816 + },
  817 + },
  818 +
  819 + }
  820 +</script>
  821 +
  822 +<style scoped>
  823 + .toolbar{
  824 + background-color: white;
  825 + border-radius: 5px 5px 5px 5px;
  826 + padding: 15px 0 0 20px;
  827 + }
  828 +</style>