|
@@ -58,14 +58,17 @@
|
|
|
<span>基本资料</span>
|
|
|
</div>
|
|
|
<div>
|
|
|
- <div class="c-item" v-show="currentCustomerId==1">
|
|
|
- <label class="c-label"><span style="color: red;">*</span>选择客户:</label>
|
|
|
- <el-select v-model="m.customerId" placeholder="请选择" filterable>
|
|
|
- <el-option v-for="item in customerList" :key="item.id"
|
|
|
- :label="item.name" :value="item.id">
|
|
|
- </el-option>
|
|
|
- </el-select>
|
|
|
+ <div class="c-item">
|
|
|
+ <label class="c-label">申报单号:</label>
|
|
|
+ <el-input v-model="m.declareNo" placeholder="选择申报单" readonly>
|
|
|
+ <div slot="suffix" style="cursor: pointer;color: blue;"
|
|
|
+ @click="handlerDeclare">
|
|
|
+ <i class="el-icon-folder-add"></i>
|
|
|
+ </div>
|
|
|
+ </el-input>
|
|
|
</div>
|
|
|
+ <sa-item name="客户名称" disabled v-model="m.customerName" br>
|
|
|
+ </sa-item>
|
|
|
<div class="c-item">
|
|
|
<label class="c-label"><span style="color: red;">*</span>运输货品:</label>
|
|
|
<el-select v-model="m.goodsName" placeholder="请选择" @change="goodsChange">
|
|
@@ -76,7 +79,7 @@
|
|
|
</div>
|
|
|
<sa-item type="num" name="载重(吨)" placeholder="请输入车辆载重" v-model="m.netWeight" br>
|
|
|
</sa-item>
|
|
|
-
|
|
|
+
|
|
|
<div class="c-item">
|
|
|
<label class="c-label">境外车牌号:</label>
|
|
|
<el-input v-model="m.cardNo" readonly disabled placeholder="请输入境外车牌号">
|
|
@@ -252,6 +255,50 @@
|
|
|
<el-button type="primary" @click="confirmAddCar">确 定</el-button>
|
|
|
</span>
|
|
|
</el-dialog>
|
|
|
+ <el-dialog title="申报单" :visible.sync="declare.visible" width="90%">
|
|
|
+ <div class="delect-search">
|
|
|
+ 申报人:
|
|
|
+ <el-input style="width: 140px;" v-model="declare.p.declarePeople" placeholder="申报人">
|
|
|
+ </el-input>
|
|
|
+ <el-button type="primary" @click="getDeclareList">搜索</el-button>
|
|
|
+ <el-button type="info" @click="resetDclare">重置</el-button>
|
|
|
+ </div>
|
|
|
+ <el-card class="box-card" style="margin-top: 20px;">
|
|
|
+ <div slot="header">
|
|
|
+ <span>列表</span>
|
|
|
+ </div>
|
|
|
+ <el-table :data="declare.list" ref="declareTable">
|
|
|
+ <el-table-column type="selection">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="declarePeople" label="申报人">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="customerName" label="申报公司">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="declarePhone" label="申报电话">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="declareNo" width="180" label="申报单号">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="goodsName" label="产品学名">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="carNo" label="越南车牌">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="grossWeight" label="毛重(吨)">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="createTime" width="140" label="申报时间">
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ <div class="block">
|
|
|
+ <el-pagination layout="prev, pager, next" @current-change="getDeclareList"
|
|
|
+ :page-size="declare.p.pageSize" :total="declare.p.dataCount"
|
|
|
+ :current-page="declare.p.pageNo">
|
|
|
+ </el-pagination>
|
|
|
+ </div>
|
|
|
+ </el-card>
|
|
|
+ <span slot="footer" class="dialog-footer">
|
|
|
+ <el-button @click="declare.visible = false">取 消</el-button>
|
|
|
+ <el-button type="primary" @click="confirmSelectDeclare">确 定</el-button>
|
|
|
+ </span>
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
|
<script>
|
|
|
var app = new Vue({
|
|
@@ -322,6 +369,18 @@
|
|
|
driverPhone: '',
|
|
|
carSize: ''
|
|
|
}
|
|
|
+ },
|
|
|
+ declare: {
|
|
|
+ visible: false,
|
|
|
+ list: [],
|
|
|
+ p: {
|
|
|
+ pageNo: 1,
|
|
|
+ pageSize: 8,
|
|
|
+ dataCount: 0,
|
|
|
+ declarePeople: '',
|
|
|
+ production: '',
|
|
|
+ declareNo: ''
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
@@ -344,27 +403,90 @@
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
- findInAndNoBusinessCar(){
|
|
|
- sa.ajax('/TbBusinessCar/findInAndNoBusinessCar',function(resp){
|
|
|
- this.carList=resp.data;
|
|
|
+ resetDclare() {
|
|
|
+ this.declare.p.pageNo = 1;
|
|
|
+ this.declare.p.pageSize = 8;
|
|
|
+ this.declare.p.production = '';
|
|
|
+ this.declare.p.declarePeople = '';
|
|
|
+ this.getDeclareList();
|
|
|
+ },
|
|
|
+ handlerDeclare() {
|
|
|
+ this.declare.visible = true;
|
|
|
+ this.declare.p.declareNo = this.m.declareNo;
|
|
|
+ this.getDeclareList();
|
|
|
+ },
|
|
|
+ confirmSelectDeclare() {
|
|
|
+ // 获取选中元素的id列表
|
|
|
+ let selection = this.$refs['declareTable'].selection;
|
|
|
+ let declareNo = sa.getArrayField(selection, 'declareNo');
|
|
|
+ if (selection.length == 0) {
|
|
|
+ return sa.msg('请至少选择一条数据')
|
|
|
+ }
|
|
|
+ if (selection.length > 1) {
|
|
|
+ return sa.msg('只能选择一条数据')
|
|
|
+ }
|
|
|
+ let declare = selection[0];
|
|
|
+ if (this.m.declareNo !== declare.declareNo) {
|
|
|
+ this.m.declareNo = declare.declareNo;
|
|
|
+ this.m.customerId = declare.customerId;
|
|
|
+ this.m.customerName = declare.customerName;
|
|
|
+ this.m.cardNo = declare.carNo;
|
|
|
+ this.m.chinaCarNo = declare.chinaCarNo;
|
|
|
+ this.m.netWeight = declare.grossWeight;
|
|
|
+ let chinaCarNo = declare.chinaCarNo;
|
|
|
+ if (chinaCarNo) {
|
|
|
+ let list = [];
|
|
|
+ chinaCarNo.replace(",", ",").split(",").forEach(carNo => {
|
|
|
+ let obj = {
|
|
|
+ carNo: carNo
|
|
|
+ }
|
|
|
+ list.push(obj);
|
|
|
+ this.china.list = list;
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.declare.visible = false;
|
|
|
+ },
|
|
|
+ getDeclareList() {
|
|
|
+ if(currentCustomerId!='1'){
|
|
|
+ this.declare.p.customerId=this.currentCustomerId;
|
|
|
+ }
|
|
|
+ sa.ajax('/TbDeclare/getNotBindList', sa.removeNull(this.declare.p), function(resp) {
|
|
|
+ let list = resp.data;
|
|
|
+ this.declare.list = list;
|
|
|
+ this.declare.p.pageNo = resp.pageNo;
|
|
|
+ this.declare.p.dataCount = resp.dataCount;
|
|
|
+ list.forEach(row => {
|
|
|
+ if (row.declareNo == this.m.declareNo) {
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$refs['declareTable'].toggleRowSelection(row, true)
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }.bind(this))
|
|
|
+ },
|
|
|
+ findInAndNoBusinessCar() {
|
|
|
+ sa.ajax('/TbBusinessCar/findInAndNoBusinessCar', function(resp) {
|
|
|
+ this.carList = resp.data;
|
|
|
}.bind(this))
|
|
|
},
|
|
|
- handleSelectCar(data){
|
|
|
- this.m.cardNo=data.carNo;
|
|
|
- this.m.cardSize=data.carSize;
|
|
|
+ handleSelectCar(data) {
|
|
|
+ this.m.cardNo = data.carNo;
|
|
|
+ this.m.cardSize = data.carSize;
|
|
|
},
|
|
|
- queryCarAsync(queryStr,cb){
|
|
|
+ queryCarAsync(queryStr, cb) {
|
|
|
let list = this.carList;
|
|
|
let filterList = list.filter(obj => obj.carNo.indexOf(queryStr) !== -1);
|
|
|
cb(filterList)
|
|
|
},
|
|
|
- handleSelectChinaCar(data){
|
|
|
- this.car.form.carNo=data.carNo;
|
|
|
- this.car.form.cardSize=data.carSize;
|
|
|
+ handleSelectChinaCar(data) {
|
|
|
+ this.car.form.carNo = data.carNo;
|
|
|
+ this.car.form.cardSize = data.carSize;
|
|
|
},
|
|
|
- queryChinaCarAsync(queryStr,cb){
|
|
|
+ queryChinaCarAsync(queryStr, cb) {
|
|
|
let list = this.carList;
|
|
|
- let filterList = list.filter(obj => obj.carNo.indexOf(queryStr) !== -1&&obj.carNo!==this.m.cardNo);
|
|
|
+ let filterList = list.filter(obj => obj.carNo.indexOf(queryStr) !== -1 && obj.carNo !== this.m
|
|
|
+ .cardNo);
|
|
|
cb(filterList)
|
|
|
},
|
|
|
cleanItem(type) {
|
|
@@ -374,21 +496,7 @@
|
|
|
this.checkItem = '';
|
|
|
}
|
|
|
},
|
|
|
- itemChange(itemId) {
|
|
|
- let items = this.itemTypeList.flatMap(obj => obj.items);
|
|
|
- let item = items.filter(obj => obj.id == itemId)[0];
|
|
|
- let typeName = item.typeName;
|
|
|
- let checkItem = this.checkItem;
|
|
|
- if ((typeName == '干杂货人工装卸' && checkItem == '特殊车辆') ||
|
|
|
- (typeName == '特殊车辆' && checkItem == '干杂货人工装卸')) {
|
|
|
- this.itemTypeList.filter(obj => obj.id == item.typeId)[0].itemId = ''
|
|
|
- sa.error('不能同时选择干杂货人工装卸和特殊车辆')
|
|
|
- return false;
|
|
|
- }
|
|
|
- if (typeName == '干杂货人工装卸' || typeName == '特殊车辆') {
|
|
|
- this.checkItem = typeName;
|
|
|
- }
|
|
|
- },
|
|
|
+ itemChange(itemId) {},
|
|
|
addCar() {
|
|
|
this.china.visible = true;
|
|
|
},
|
|
@@ -405,7 +513,7 @@
|
|
|
},
|
|
|
confirmAddCar() {
|
|
|
let carNo = this.car.form.carNo;
|
|
|
-
|
|
|
+
|
|
|
if (!sa.isCarNo(carNo)) {
|
|
|
sa.error('请填入正确的车牌号')
|
|
|
return false;
|
|
@@ -442,9 +550,9 @@
|
|
|
let noNeedIds = goods.noNeedIds.split(',');
|
|
|
let list = this.itemTypeList;
|
|
|
for (let i in list) {
|
|
|
- let item=list[i];
|
|
|
- if(noNeedIds.indexOf(item.id)!==-1){
|
|
|
- item.itemId=''
|
|
|
+ let item = list[i];
|
|
|
+ if (noNeedIds.indexOf(item.id) !== -1) {
|
|
|
+ item.itemId = ''
|
|
|
}
|
|
|
}
|
|
|
this.needTypeId = goods.needIds.split(',');
|
|
@@ -544,13 +652,15 @@
|
|
|
}.bind(this))
|
|
|
},
|
|
|
getItemTypeList() {
|
|
|
- sa.ajax('/TbItemType/getList', function(resp) {
|
|
|
+ sa.ajax('/TbItemType/getList', {
|
|
|
+ business: 1
|
|
|
+ }, function(resp) {
|
|
|
let typeList = resp.data;
|
|
|
// 初始化数据
|
|
|
sa.ajax('/TbBusiness/getById?id=' + this.id, function(res) {
|
|
|
let m = res.data;
|
|
|
let items = m.items;
|
|
|
- this.china.list = m.cars.filter(obj=>obj.carNo!==m.cardNo);
|
|
|
+ this.china.list = m.cars.filter(obj => obj.carNo !== m.cardNo);
|
|
|
let hsItem = items.filter(obj => obj.itemTypeName.indexOf('人') !== -1 &&
|
|
|
obj.itemTypeName.indexOf('核酸') !== -1);
|
|
|
if (hsItem.length > 0) {
|
|
@@ -558,9 +668,6 @@
|
|
|
}
|
|
|
for (let i in items) {
|
|
|
let item = items[i];
|
|
|
- if (item.itemTypeName == '特殊车辆' || item.itemTypeName == '干杂货人工装卸') {
|
|
|
- this.checkItem = item.itemTypeName
|
|
|
- }
|
|
|
for (let j in typeList) {
|
|
|
let type = typeList[j];
|
|
|
if (item.itemTypeId == type.id) {
|
|
@@ -584,25 +691,10 @@
|
|
|
handleSelectCarSize(item) {
|
|
|
this.m.cardSize = item.unit;
|
|
|
},
|
|
|
- getCustomerList() {
|
|
|
- sa.ajax('/TbCostomer/getList', {
|
|
|
- pageNo: 1,
|
|
|
- pageSize: 100,
|
|
|
- judgeStatus: 2,
|
|
|
- type:0
|
|
|
- }, function(resp) {
|
|
|
- this.customerList = resp.data;
|
|
|
- if (resp.data.length > 0) {
|
|
|
- this.m.customerId = resp.data[0].id;
|
|
|
- }
|
|
|
- }.bind(this));
|
|
|
- },
|
|
|
getCustomer() {
|
|
|
sa.ajax('/TbCostomer/getCurrentCustomerId', function(resp) {
|
|
|
let id = resp.data;
|
|
|
- if (id == 1) {
|
|
|
- this.getCustomerList();
|
|
|
- } else {
|
|
|
+ if (id == 1) {} else {
|
|
|
this.m.customerId = id;
|
|
|
}
|
|
|
this.currentCustomerId = id;
|
|
@@ -616,12 +708,9 @@
|
|
|
ok: function() {
|
|
|
// 表单校验
|
|
|
let m = this.m;
|
|
|
- if (this.currentCustomerId == 1) {
|
|
|
- sa.checkNull(m.customerId, '请选择 [客户名称]');
|
|
|
- }
|
|
|
sa.checkNull(m.goodsName, '请选择运输货物');
|
|
|
sa.checkNull(m.cardNo, '请输入 [车牌号]');
|
|
|
- if (!m.cardSize||!sa.isNum(m.cardSize)) {
|
|
|
+ if (!m.cardSize || !sa.isNum(m.cardSize)) {
|
|
|
sa.error('车辆规格只能输入数字')
|
|
|
return;
|
|
|
}
|
|
@@ -647,6 +736,13 @@
|
|
|
}
|
|
|
}
|
|
|
let typeList = this.itemTypeList.filter(obj => obj.itemId);
|
|
|
+ let needIds = this.needTypeId;
|
|
|
+ for (let i in needIds) {
|
|
|
+ if (typeList.map(obj => obj.id).indexOf(needIds[i]) == -1) {
|
|
|
+ sa.error('缺少必选业务');
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ }
|
|
|
let list = [];
|
|
|
if (typeList.length == 0) {
|
|
|
sa.error('至少选择一项业务');
|