|
@@ -27,6 +27,24 @@
|
|
|
.item-num .el-input__inner {
|
|
|
width: 100px;
|
|
|
}
|
|
|
+
|
|
|
+ .xj {
|
|
|
+ display: inline;
|
|
|
+ color: red;
|
|
|
+ margin-left: 9px;
|
|
|
+ font-weight: bold;
|
|
|
+ }
|
|
|
+
|
|
|
+ .hj {
|
|
|
+ color: red;
|
|
|
+ margin-left: 9px;
|
|
|
+ font-weight: bold;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ .china-car-size .el-input__inner {
|
|
|
+ width: 130px;
|
|
|
+ }
|
|
|
</style>
|
|
|
</head>
|
|
|
<body>
|
|
@@ -37,12 +55,31 @@
|
|
|
<div class="c-title" v-if="id == 0">数据添加</div>
|
|
|
<div class="c-title" v-else>数据修改</div>
|
|
|
<el-form v-if="m" label-position="left">
|
|
|
- <el-card class="box-card">
|
|
|
- <div slot="header" class="clearfix">
|
|
|
- <span>基本资料</span>
|
|
|
- </div>
|
|
|
- <el-row>
|
|
|
- <el-col :span='12'>
|
|
|
+ <el-row>
|
|
|
+ <el-card class="box-card">
|
|
|
+ <div slot="header" class="clearfix">
|
|
|
+ <span>基本资料</span>
|
|
|
+ </div>
|
|
|
+ <div>
|
|
|
+ <div class="c-item">
|
|
|
+ <label class="c-label"><span style="color: red;">*</span>业务项目:</label>
|
|
|
+ <el-select v-model="m.goodsId" placeholder="请选择" @change="goodsChange">
|
|
|
+ <el-option v-for="item in goodsList" :key="item.id" :label="item.name"
|
|
|
+ :value="item.id">
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </div>
|
|
|
+ <div class="c-item">
|
|
|
+ <label class="c-label">
|
|
|
+ <span style="color: red;" v-if="goods.needDeclare==1">*</span>
|
|
|
+ 申报单号:</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>
|
|
|
<div class="c-item" v-if="currentCustomerId=='1'">
|
|
|
<label class="c-label"><span style="color: red;">*</span>客户:</label>
|
|
|
<el-select v-model="m.customerId" placeholder="请选择">
|
|
@@ -51,80 +88,249 @@
|
|
|
</el-option>
|
|
|
</el-select>
|
|
|
</div>
|
|
|
+ <sa-item type="num" name="载重(kg)" placeholder="请输入车辆载重" v-model="m.netWeight" br>
|
|
|
+ </sa-item>
|
|
|
+ </sa-item>
|
|
|
<div class="c-item">
|
|
|
- <label class="c-label"><span style="color: red;">*</span>车牌号:</label>
|
|
|
- <el-autocomplete v-model="m.carNo" placeholder="请输入车牌号"
|
|
|
+ <label class="c-label"><span style="color: red;">*</span>境外车牌号:</label>
|
|
|
+ <el-autocomplete v-model="m.cardNo" placeholder="请输入境外车牌号"
|
|
|
@select="handleSelectCar" value-key='carNo'
|
|
|
:fetch-suggestions="queryCarAsync">
|
|
|
</el-autocomplete>
|
|
|
</div>
|
|
|
- <sa-item type="num" name="车辆规格(米)" placeholder="请输入车辆规格" v-model="m.carSize" br>
|
|
|
- </sa-item>
|
|
|
- <sa-item name="作业人员" placeholder="请输入作业人员" v-model="m.operator" br>
|
|
|
- </sa-item>
|
|
|
- </el-col>
|
|
|
- <el-col :span='12'>
|
|
|
<div class="c-item">
|
|
|
- <label class="c-label">车辆类型:</label>
|
|
|
- <el-select v-model="m.carType" placeholder="请选择" @change="carTypeChange">
|
|
|
- <el-option :label="item.name" :value="item.name"
|
|
|
- v-for="(item,index) in carTypeList">
|
|
|
- </el-option>
|
|
|
- </el-select>
|
|
|
+ <label class="c-label">
|
|
|
+ <span style="color: red;" v-if="goods.needCarSize==1">*</span>
|
|
|
+ 境外车规格:</label>
|
|
|
+ <el-autocomplete v-model="m.cardSize" placeholder="请输入车规格"
|
|
|
+ @select="handleSelectCarSize" value-key='unit'
|
|
|
+ :fetch-suggestions="queryCaSizerAsync">
|
|
|
+ </el-autocomplete>
|
|
|
</div>
|
|
|
- <sa-item v-if="m.carType.indexOf('重')!==-1" type="num" name="载重(kg)"
|
|
|
- placeholder="请输入车辆载重" v-model="m.carWeight" br>
|
|
|
- </sa-item>
|
|
|
<div class="c-item">
|
|
|
- <label class="c-label"><span style="color: red;">*</span>作业时间:</label>
|
|
|
- <el-date-picker type="datetime" value-format="yyyy-MM-dd HH:mm:ss"
|
|
|
- v-model="m.operateTime"></el-date-picker>
|
|
|
+ <label class="c-label">中国车:</label>
|
|
|
+ <el-input v-model="china.list.map(obj=>obj.carNo).join('、')" placeholder="添加中国车"
|
|
|
+ readonly>
|
|
|
+ <div slot="suffix" style="cursor: pointer;color: blue;" @click="addCar">
|
|
|
+ <i class="el-icon-folder-add"></i>
|
|
|
+ </div>
|
|
|
+ </el-input>
|
|
|
</div>
|
|
|
-
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
+ </div>
|
|
|
+ </el-card>
|
|
|
+ </el-row>
|
|
|
+ <el-row>
|
|
|
+ <el-card class="box-card">
|
|
|
+ <div slot="header" class="clearfix">
|
|
|
+ <span>车辆</span>
|
|
|
+ <el-button style="float: right;" icon="el-icon-plus" type="primary" @click="showAddModal"
|
|
|
+ v-if="modal.list.length<modal.num">添加
|
|
|
+ </el-button>
|
|
|
+ </div>
|
|
|
+ <el-table :data="modal.list">
|
|
|
+ <el-table-column prop="name" label="姓名">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="phone" label="联系号码">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="操作">
|
|
|
+ <template slot-scope="s">
|
|
|
+ <!-- <el-button class="c-btn" type="primary" @click="uploadFn(s.row)">上传</el-button> -->
|
|
|
+ <el-button class="c-btn" type="info" @click="editFn(s.row)">修改</el-button>
|
|
|
+ <el-button class="c-btn" type="danger" @click="deleteFn(s.row)">删除</el-button>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ </el-card>
|
|
|
+ </el-row>
|
|
|
+ <el-row>
|
|
|
<el-card class="box-card">
|
|
|
<div slot="header" class="clearfix">
|
|
|
- <span>收费明细<label style="color: red;">(总共{{totalPrice}}元)</label></span>
|
|
|
- <el-select v-model="m.itemTypeId" placeholder="请选择" @change="getItems"
|
|
|
- style="float: right; padding: 3px 0">
|
|
|
- <el-option v-for="(item,index) in itemTypeList" :label="item.name"
|
|
|
- :value="item.id">
|
|
|
- </el-option>
|
|
|
- </el-select>
|
|
|
+ <span>业务项</span>
|
|
|
</div>
|
|
|
<div>
|
|
|
- <el-checkbox-group v-model="checkList">
|
|
|
- <el-row v-for="(item,index) in items"
|
|
|
- style="border-bottom: 1px solid #E4E4E4;line-height: 90px;">
|
|
|
- <el-col :span="11">
|
|
|
- <el-checkbox :disabled="item.need==1" :label="item.id">
|
|
|
- <div>{{item.itemName}}(<label
|
|
|
- style="color: red;">{{item.price}}{{item.unit}}</label>)
|
|
|
- </div>
|
|
|
- </el-checkbox>
|
|
|
- </el-col>
|
|
|
- <el-col :span="6">
|
|
|
- <el-input-number :disabled="item.inc==0" class="item-num"
|
|
|
- v-model="item.num" :min="1" :max="10"></el-input-number>
|
|
|
- </el-col>
|
|
|
- <el-col :span="7">
|
|
|
- <sa-item type="textarea" name="备注" placeholder="请输入备注"
|
|
|
- v-model="item.remark" br>
|
|
|
- </sa-item>
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
- </el-checkbox-group>
|
|
|
+ <el-form-item v-for="(type,index) in filterTypeList" style="display: flex;"
|
|
|
+ v-if="filterTypeList.length>0">
|
|
|
+ <label slot="label">
|
|
|
+ <label v-if="needTypeId.indexOf(type.id)!==-1"
|
|
|
+ style="color: red;">*</label>{{type.name}}</label>
|
|
|
+ <el-select v-model="type.itemId" style="width: 120px;" @change="itemChange"
|
|
|
+ placeholder="请选择">
|
|
|
+ <el-option v-for="item in type.items" :key="item.id" :label="item.itemName"
|
|
|
+ :value="item.id" v-if="m.netWeight >= item.minWeight && m.netWeight < item.maxWeight
|
|
|
+ &&m.cardSize<=item.carLength&&m.cardSize>=item.minLength">
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ <el-input-number style="margin-left: 60px;" class="item-num" v-model="type.num"
|
|
|
+ :min="1" :max="10" size="mini" :disabled="type.inc==0"></el-input-number>
|
|
|
+ <div class="xj" v-if="type.itemId">
|
|
|
+ {{type.items.filter(obj=>obj.id==type.itemId)[0].price*type.num}}元
|
|
|
+ <label @click="cleanItem(type)" style="margin-left: 5px;cursor: pointer">(<i
|
|
|
+ class="el-icon-delete"></i>)</label>
|
|
|
+ </div>
|
|
|
+ <el-button v-if="type.code=='p09'&&type.itemId"
|
|
|
+ @click="addPeopleFn(type.itemId,type.num)">操作</el-button>
|
|
|
+ </el-form-item>
|
|
|
+ <div v-if="filterTypeList.length==0" style="height: 400px;padding: 30px;">
|
|
|
+ 请先选择运输货品
|
|
|
+ </div>
|
|
|
+ <div class="hj" v-if="totalPrice>0">
|
|
|
+ 合计费用:{{totalPrice}}<label>元</label>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</el-card>
|
|
|
+ </el-row>
|
|
|
</el-form>
|
|
|
</div>
|
|
|
</div>
|
|
|
<!-- ------- 底部按钮 ------- -->
|
|
|
<div class="s-foot">
|
|
|
- <el-button type="primary" @click="ok()">确定</el-button>
|
|
|
- <el-button @click="sa.closeCurrIframe()">取消</el-button>
|
|
|
+ <el-button type="primary" @click="ok()" v-if="sa.isAuth('tb-business-add')">确定</el-button>
|
|
|
+ <el-button @click="closeFn()">取消</el-button>
|
|
|
</div>
|
|
|
+ <el-dialog title="人员核酸检测" :visible.sync="modal.visible" width="80%">
|
|
|
+ <el-card class="box-card">
|
|
|
+ <div slot="header">
|
|
|
+ <span>列表</span>
|
|
|
+ <el-button style="float: right;" icon="el-icon-plus" type="primary" @click="showAddModal"
|
|
|
+ v-if="modal.list.length<modal.num">添加
|
|
|
+ </el-button>
|
|
|
+ </div>
|
|
|
+ <el-table :data="modal.list">
|
|
|
+ <el-table-column prop="name" label="姓名">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="phone" label="联系号码">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="操作">
|
|
|
+ <template slot-scope="s">
|
|
|
+ <!-- <el-button class="c-btn" type="primary" @click="uploadFn(s.row)">上传</el-button> -->
|
|
|
+ <el-button class="c-btn" type="info" @click="editFn(s.row)">修改</el-button>
|
|
|
+ <el-button class="c-btn" type="danger" @click="deleteFn(s.row)">删除</el-button>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ </el-card>
|
|
|
+ <span slot="footer" class="dialog-footer">
|
|
|
+ <el-button @click="cancelAdd">取 消</el-button>
|
|
|
+ <el-button type="primary" @click="modal.visible=false">确 定</el-button>
|
|
|
+ </span>
|
|
|
+ </el-dialog>
|
|
|
+ <el-dialog title="人员核酸检测" :visible.sync="addModal.visible" width="400">
|
|
|
+ <span>
|
|
|
+ <el-form label-position="left">
|
|
|
+ <sa-item type="text" name="姓名" placeholder="姓名" v-model="addModal.form.name" br></sa-item>
|
|
|
+ <sa-item type="text" name="联系号码" placeholder="联系号码" v-model="addModal.form.phone" br></sa-item>
|
|
|
+ </el-form>
|
|
|
+ </span>
|
|
|
+ <span slot="footer" class="dialog-footer">
|
|
|
+ <el-button @click="addModal.visible = false">取 消</el-button>
|
|
|
+ <el-button type="primary" @click="confirmAdd">确 定</el-button>
|
|
|
+ </span>
|
|
|
+ </el-dialog>
|
|
|
+ <el-dialog title="添加中国车" :visible.sync="china.visible" width="80%">
|
|
|
+ <el-card class="box-card">
|
|
|
+ <div slot="header">
|
|
|
+ <span>列表</span>
|
|
|
+ <el-button style="float: right;" icon="el-icon-plus" type="primary" @click="addChinaCarFn">添加
|
|
|
+ </el-button>
|
|
|
+ </div>
|
|
|
+ <el-table :data="china.list">
|
|
|
+ <el-table-column prop="carNo" label="车牌号">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="driverName" label="联系人">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="driverPhone" label="联系号码">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="carSize" label="车辆规格">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="操作">
|
|
|
+ <template slot-scope="s">
|
|
|
+ <el-button class="c-btn" type="info" @click="editChinaCarFn(s.row)">修改</el-button>
|
|
|
+ <el-button class="c-btn" type="danger" @click="deleteChinaCarFn(s.row)">删除</el-button>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ </el-card>
|
|
|
+ <span slot="footer" class="dialog-footer">
|
|
|
+ <el-button @click="china.visible=false">关 闭</el-button>
|
|
|
+ <el-button type="primary" @click="china.visible=false">确 定</el-button>
|
|
|
+ </span>
|
|
|
+ </el-dialog>
|
|
|
+ <el-dialog title="添加中国车" :visible.sync="car.visible" width="300">
|
|
|
+ <span>
|
|
|
+ <el-form label-position="left">
|
|
|
+ <div class="c-item">
|
|
|
+ <label class="c-label"><span style="color: red;">*</span>车牌号:</label>
|
|
|
+ <el-autocomplete v-model="car.form.carNo" placeholder="请输入车牌号"
|
|
|
+ @select="handleSelectChinaCar" value-key='carNo'
|
|
|
+ :fetch-suggestions="queryChinaCarAsync">
|
|
|
+ </el-autocomplete>
|
|
|
+ </div>
|
|
|
+ <div class="c-item">
|
|
|
+ <label class="c-label"><span style="color: red;">*</span>车辆规格:</label>
|
|
|
+ <el-input-number class="china-car-size" v-model="car.form.carSize" controls-position="right"
|
|
|
+ :min="4.2" :max="50"></el-input-number>
|
|
|
+ </div>
|
|
|
+ <div class="c-item">
|
|
|
+ <label class="c-label">联系人:</label>
|
|
|
+ <el-input v-model="car.form.driverName" placeholder="联系人">
|
|
|
+ </el-input>
|
|
|
+ </div>
|
|
|
+ <div class="c-item">
|
|
|
+ <label class="c-label">联系号码:</label>
|
|
|
+ <el-input v-model="car.form.driverPhone" placeholder="联系号码">
|
|
|
+ </el-input>
|
|
|
+ </div>
|
|
|
+ </el-form>
|
|
|
+ </span>
|
|
|
+ <span slot="footer" class="dialog-footer">
|
|
|
+ <el-button @click="car.visible = false">取 消</el-button>
|
|
|
+ <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="毛重(kg)">
|
|
|
+ </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({
|
|
@@ -134,148 +340,397 @@
|
|
|
},
|
|
|
el: '.vue-box',
|
|
|
data: {
|
|
|
- p: { // 查询参数
|
|
|
- business: 0,
|
|
|
- pageNo: 1, // 当前页
|
|
|
- pageSize: 50, // 页大小
|
|
|
- sortType: 0 // 排序方式
|
|
|
- },
|
|
|
id: sa.p('id', 0), // 获取超链接中的id参数(0=添加,非0=修改)
|
|
|
m: {
|
|
|
id: '', // 主键
|
|
|
- carNo: '',
|
|
|
- carSize: '',
|
|
|
- customerId: '',
|
|
|
- carType: '载重',
|
|
|
- operateTime:'',
|
|
|
- carWeight: '',
|
|
|
- itemTypeId: ''
|
|
|
+ customerId: '', // 客户id
|
|
|
+ customerName: '', // 客户名称
|
|
|
+ no: '', // 编号
|
|
|
+ cardNo: '', // 车牌号
|
|
|
+ countryName: '越南车',
|
|
|
+ cardSize: '', // 车规格
|
|
|
+ netWeight: '', // 载重(kg)
|
|
|
+ goodsName: '', // 商品
|
|
|
+ chinaCarNo: '',
|
|
|
+ expectInDay: '',
|
|
|
+ driverName: '', // 司机名称
|
|
|
+ driverPhone: '', // 司机联系号码
|
|
|
+ driverIdCard: '', // 司机身份证
|
|
|
+ payTicket: '', // 支付凭证
|
|
|
}, // 实体对象
|
|
|
- itemTypeList: [],
|
|
|
- items: [],
|
|
|
- checkList: [],
|
|
|
customerList: [],
|
|
|
- carTypeList: [],
|
|
|
- currentCustomerId: '1'
|
|
|
+ carList: [],
|
|
|
+ currentCustomerId: 1,
|
|
|
+ itemTypeList: [],
|
|
|
+ filterTypeList: [],
|
|
|
+ typeList: [],
|
|
|
+ goodsList: [],
|
|
|
+ countryList: [{
|
|
|
+ name: '越南车'
|
|
|
+ }, {
|
|
|
+ name: '中国车'
|
|
|
+ }],
|
|
|
+ tableData: [],
|
|
|
+ modal: {
|
|
|
+ visible: false,
|
|
|
+ itemId: 4,
|
|
|
+ num: 1,
|
|
|
+ list: []
|
|
|
+ },
|
|
|
+ addModal: {
|
|
|
+ visible: false,
|
|
|
+ form: {
|
|
|
+ name: '',
|
|
|
+ phone: '',
|
|
|
+ itemId: 4,
|
|
|
+ ticket: ''
|
|
|
+ }
|
|
|
+ },
|
|
|
+ unitList: [],
|
|
|
+ needTypeId: [],
|
|
|
+ china: {
|
|
|
+ visible: false,
|
|
|
+ list: []
|
|
|
+ },
|
|
|
+ car: {
|
|
|
+ visible: false,
|
|
|
+ form: {
|
|
|
+ carNo: '',
|
|
|
+ driverName: '',
|
|
|
+ driverPhone: '',
|
|
|
+ carSize: ''
|
|
|
+ }
|
|
|
+ },
|
|
|
+ declare: {
|
|
|
+ visible: false,
|
|
|
+ list: [],
|
|
|
+ p: {
|
|
|
+ pageNo: 1,
|
|
|
+ pageSize: 8,
|
|
|
+ dataCount: 0,
|
|
|
+ declarePeople: '',
|
|
|
+ production: '',
|
|
|
+ businessId: ''
|
|
|
+ }
|
|
|
+ },
|
|
|
+ goods: {
|
|
|
+ id: '',
|
|
|
+ name: '',
|
|
|
+ needWeight: 1,
|
|
|
+ needCarSize: 1,
|
|
|
+ needDeclare: 1,
|
|
|
+ needOperateTime: 1,
|
|
|
+ chinaCarPay: 1,
|
|
|
+ vietnamCarPay: 1,
|
|
|
+ }
|
|
|
},
|
|
|
computed: {
|
|
|
totalPrice() {
|
|
|
- let checkList = this.checkList;
|
|
|
- let items = this.items.filter(obj => checkList.indexOf(obj.id) !== -1);
|
|
|
+ let itemList = this.itemTypeList.filter(obj => obj.itemId);
|
|
|
let price = 0;
|
|
|
- for (let i in items) {
|
|
|
- let item = items[i];
|
|
|
- price = price + item.price * item.num;
|
|
|
+ for (let i in itemList) {
|
|
|
+ let type = itemList[i];
|
|
|
+ let num = type.num;
|
|
|
+ let items = type.items;
|
|
|
+ for (let j in items) {
|
|
|
+ let item = items[j];
|
|
|
+ if (item.id == type.itemId) {
|
|
|
+ price += num * item.price;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
return price;
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
- queryCarAsync(queryStr, cb) {
|
|
|
- if(!queryStr){
|
|
|
- cb([]);
|
|
|
- return;
|
|
|
+ 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.getDeclareList();
|
|
|
+ },
|
|
|
+ getDeclareList() {
|
|
|
+ let currentCustomerId = this.currentCustomerId;
|
|
|
+ if (currentCustomerId != '1') {
|
|
|
+ this.declare.p.customerId = this.currentCustomerId;
|
|
|
}
|
|
|
- sa.ajaxNoLoading('/TbBusinessCar/searchInNotOutCar',{carNo:queryStr},function(resp){
|
|
|
- cb(resp.data)
|
|
|
+ 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))
|
|
|
+ },
|
|
|
+ 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;
|
|
|
+ },
|
|
|
+ findInAndNoBusinessCar() {
|
|
|
+ sa.ajax('/TbBusinessCar/findInAndNoBusinessCar', function(resp) {
|
|
|
+ this.carList = resp.data;
|
|
|
}.bind(this))
|
|
|
},
|
|
|
handleSelectCar(data) {
|
|
|
- this.m.carNo = data.carNo;
|
|
|
- if(!this.m.carSize){
|
|
|
- this.m.carSize=data.carSize;
|
|
|
+ this.m.cardNo = data.carNo;
|
|
|
+ },
|
|
|
+ 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;
|
|
|
+ },
|
|
|
+ queryChinaCarAsync(queryStr, cb) {
|
|
|
+ let list = this.carList;
|
|
|
+ let filterList = list.filter(obj => obj.carNo.indexOf(queryStr) !== -1 && obj.carNo !== this.m
|
|
|
+ .cardNo);
|
|
|
+ cb(filterList)
|
|
|
+ },
|
|
|
+ cleanItem(type) {
|
|
|
+ type.itemId = '';
|
|
|
+ let typeName = type.name;
|
|
|
+ if (typeName == '干杂货人工装卸' || typeName == '特殊车辆') {
|
|
|
+ this.checkItem = '';
|
|
|
}
|
|
|
},
|
|
|
- getCustomer() {
|
|
|
- sa.ajax('/TbCostomer/getCurrentCustomerId', function(resp) {
|
|
|
- let id = resp.data;
|
|
|
- if (id == '1') {
|
|
|
- this.getCustomerList();
|
|
|
- } else {
|
|
|
- this.m.customerId = id;
|
|
|
- }
|
|
|
- this.currentCustomerId = id;
|
|
|
- }.bind(this));
|
|
|
+ itemChange(itemId) {
|
|
|
+
|
|
|
},
|
|
|
- carTypeChange(v) {
|
|
|
- this.getItems();
|
|
|
+ addCar() {
|
|
|
+ this.china.visible = true;
|
|
|
},
|
|
|
- getItemType() {
|
|
|
- sa.ajax('/TbItem/getItemType', function(resp) {
|
|
|
- let list = resp.data;
|
|
|
- if (list.length > 0) {
|
|
|
- this.m.carType = list[0].id;
|
|
|
+ addChinaCarFn() {
|
|
|
+ Object.assign(this.car, {
|
|
|
+ visible: true,
|
|
|
+ form: {
|
|
|
+ carNo: '',
|
|
|
+ driverName: '',
|
|
|
+ driverPhone: '',
|
|
|
+ carSize: ''
|
|
|
}
|
|
|
- this.carTypeList = list;
|
|
|
- this.getItemTypeList()
|
|
|
- }.bind(this))
|
|
|
+ })
|
|
|
+ },
|
|
|
+ confirmAddCar() {
|
|
|
+ let carNo = this.car.form.carNo;
|
|
|
+ if (!sa.isCarNo(carNo)) {
|
|
|
+ sa.error('请填入正确的车牌号')
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ if (!this.car.form.carSize) {
|
|
|
+ sa.error('请填入车辆规格')
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ let phone = this.car.form.phone;
|
|
|
+ if (phone && !sa.isPhone(phone)) {
|
|
|
+ sa.error('联系号码不正确')
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ let list = this.china.list;
|
|
|
+ let index = list.map(obj => obj.carNo).indexOf(carNo);
|
|
|
+ if (index > -1) {
|
|
|
+ list.splice(index, 1);
|
|
|
+ }
|
|
|
+ this.china.list.push(this.car.form);
|
|
|
+ this.car.visible = false;
|
|
|
+
|
|
|
+ },
|
|
|
+ editChinaCarFn(data) {
|
|
|
+ Object.assign(this.car, {
|
|
|
+ visible: true,
|
|
|
+ form: data
|
|
|
+ })
|
|
|
+ },
|
|
|
+ deleteChinaCarFn(data) {
|
|
|
+ this.china.list.splice(this.china.list.indexOf(data), 1)
|
|
|
},
|
|
|
- getCustomerList() {
|
|
|
- sa.ajax('/TbCostomer/getList', {
|
|
|
+
|
|
|
+ getUnitList() {
|
|
|
+ sa.ajax('/TbUnit/getList', {
|
|
|
pageNo: 1,
|
|
|
- pageSize: 30,
|
|
|
- judgeStatus: 2,
|
|
|
- sortType: 20
|
|
|
- }, function(res) {
|
|
|
- let list = res.data;
|
|
|
- if (list.length > 0) {
|
|
|
- this.m.customerId = list[0].id;
|
|
|
- }
|
|
|
- this.customerList = res.data; // 数据
|
|
|
+ pageSize: 50
|
|
|
+ }, function(resp) {
|
|
|
+ this.unitList = resp.data;
|
|
|
+ }.bind(this))
|
|
|
+ },
|
|
|
+ addPeopleFn(itemId, num) {
|
|
|
+ this.modal.itemId = itemId;
|
|
|
+ this.modal.num = num;
|
|
|
+ this.modal.visible = true;
|
|
|
|
|
|
- }.bind(this));
|
|
|
},
|
|
|
- getItemTypeList() {
|
|
|
- sa.ajax('/TbItemType/getList', sa.removeNull(this.p), function(res) {
|
|
|
- let list = res.data;
|
|
|
- if (list.length > 0) {
|
|
|
- this.m.itemTypeId = list[0].id;
|
|
|
- this.getItems();
|
|
|
+ showAddModal() {
|
|
|
+ Object.assign(this.addModal, {
|
|
|
+ visible: true,
|
|
|
+ form: {
|
|
|
+ index: -1,
|
|
|
+ name: '',
|
|
|
+ phone: '',
|
|
|
+ itemId: this.modal.itemId,
|
|
|
+ ticket: ''
|
|
|
}
|
|
|
- this.itemTypeList = list;
|
|
|
+ })
|
|
|
+ },
|
|
|
+ cancelAdd() {
|
|
|
+ this.modal.list = [];
|
|
|
+ this.modal.visible = false;
|
|
|
|
|
|
- }.bind(this));
|
|
|
},
|
|
|
- getItems() {
|
|
|
- sa.ajax('/TbItem/getTypeItemList', {
|
|
|
+ confirmAdd() {
|
|
|
+ if (!this.addModal.form.name) {
|
|
|
+ sa.error('请输入检测人姓名')
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ let phone = this.addModal.form.phone;
|
|
|
+ if (phone && !sa.isPhone(phone)) {
|
|
|
+ sa.error('检测人联系号码不正确')
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ let dbIndex = this.addModal.form.index;
|
|
|
+ if (dbIndex >= 0) {
|
|
|
+ this.modal.list[dbIndex].name = this.addModal.form.name;
|
|
|
+ this.modal.list[dbIndex].phone = this.addModal.form.phone;
|
|
|
+ } else {
|
|
|
+ this.addModal.form.index = this.modal.list.length;
|
|
|
+ this.modal.list.push(this.addModal.form);
|
|
|
+ }
|
|
|
+ this.addModal.visible = false;
|
|
|
+ },
|
|
|
+ editFn(data) {
|
|
|
+ Object.assign(this.addModal, {
|
|
|
+ visible: true,
|
|
|
+ form: data
|
|
|
+ })
|
|
|
+ },
|
|
|
+ deleteFn(data) {
|
|
|
+ this.modal.list.splice(data.index, 1);
|
|
|
+ if (data.id) {
|
|
|
+ sa.ajax('/TbBusinessPeople/deleteById', {
|
|
|
+ id: data.id
|
|
|
+ }, function(resp) {
|
|
|
+
|
|
|
+ }.bind(this))
|
|
|
+ }
|
|
|
+ },
|
|
|
+ getGoods() {
|
|
|
+ sa.ajax('/TbGoods/getList', {
|
|
|
pageNo: 1,
|
|
|
- pageSize: 30,
|
|
|
- typeId: this.m.itemTypeId
|
|
|
+ pageSize: 10,
|
|
|
+ businessType: 1
|
|
|
}, function(resp) {
|
|
|
let list = resp.data;
|
|
|
- if (this.m.carType) {
|
|
|
- list = list.filter(obj => obj.itemType && obj.itemType.indexOf(this.m
|
|
|
- .carType) !== -1);
|
|
|
+ if (list.length >= 1) {
|
|
|
+ let initGoods = list[0];
|
|
|
+ this.goods = initGoods
|
|
|
+ this.m.goodsId = initGoods.id;
|
|
|
+ this.m.goodsName = initGoods.name;
|
|
|
+ this.getTypeByGoodsId();
|
|
|
}
|
|
|
- this.checkList = list.filter(obj => obj.need == 1).map(obj => obj.id)
|
|
|
- this.items = list;
|
|
|
+ this.goodsList = list;
|
|
|
+
|
|
|
}.bind(this))
|
|
|
},
|
|
|
- ok() {
|
|
|
- let m = this.m;
|
|
|
- if (!m.carNo) {
|
|
|
- sa.error('请输入车牌号')
|
|
|
- return false;
|
|
|
- }
|
|
|
- if (!m.operateTime) {
|
|
|
- sa.error('请选择作业时间')
|
|
|
- return false;
|
|
|
- }
|
|
|
- let checkList = this.checkList;
|
|
|
- let itemList = this.items;
|
|
|
- let list = itemList.filter(obj => checkList.indexOf(obj.id) !== -1);
|
|
|
- m.itemJson = JSON.stringify(list);
|
|
|
- sa.ajax('/api/addOtherBusiness', sa.removeNull(m), function(resp) {
|
|
|
+ goodsChange(v) {
|
|
|
+ let goodsList = this.goodsList;
|
|
|
+ let goods = goodsList.filter(goods => goods.id == v).pop();
|
|
|
+ this.goods = goods;
|
|
|
+ this.m.goodsName = goods.name;
|
|
|
+ this.getTypeByGoodsId();
|
|
|
+ },
|
|
|
+ getTypeByGoodsId() {
|
|
|
+ sa.ajaxNoLoading('/TbItemType/getTypeByGoodsId', {
|
|
|
+ goodsId: this.m.goodsId
|
|
|
+ }, function(resp) {
|
|
|
+ this.typeList = resp.data;
|
|
|
+ }.bind(this))
|
|
|
+ },
|
|
|
+ queryCaSizerAsync(queryStr, cb) {
|
|
|
+ let list = this.unitList;
|
|
|
+ let filterList = list.filter(obj => obj.unit.indexOf(queryStr) !== -1);
|
|
|
+ cb(filterList)
|
|
|
+ },
|
|
|
+
|
|
|
+ handleSelectCarSize(item) {
|
|
|
+ this.m.cardSize = item.unit;
|
|
|
+ },
|
|
|
+ closeFn() {
|
|
|
+ parent.app.f5();
|
|
|
+ sa.closeCurrIframe();
|
|
|
+ },
|
|
|
+ // 提交数据
|
|
|
+ ok: function() {
|
|
|
+
|
|
|
+ sa.ajax('/TbBusiness/add', m, function(res) {
|
|
|
+ sa.alert('增加成功', this.clean);
|
|
|
+ }.bind(this));
|
|
|
+ },
|
|
|
+ // 添加/修改 完成后的动作
|
|
|
+ clean: function() {
|
|
|
+ this.modal.list = [];
|
|
|
+ if (this.id == 0) {
|
|
|
+ this.m = this.createModel();
|
|
|
+ } else {
|
|
|
parent.app.f5(); // 刷新父页面列表
|
|
|
sa.closeCurrIframe(); // 关闭本页
|
|
|
- }.bind(this))
|
|
|
- }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ getCurrentCustomer() {
|
|
|
+ sa.ajax('/TbCostomer/getCurrentCustomerId', function(resp) {
|
|
|
+ let id = resp.data;
|
|
|
+ if (id == 1) {} else {
|
|
|
+ this.m.customerId = id;
|
|
|
+ }
|
|
|
+ this.currentCustomerId = id;
|
|
|
+ }.bind(this));
|
|
|
+ },
|
|
|
},
|
|
|
mounted: function() {
|
|
|
- this.getCustomer();
|
|
|
-
|
|
|
- this.getItemTypeList();
|
|
|
- this.getItemType();
|
|
|
+ this.getCurrentCustomer();
|
|
|
+ this.getGoods();
|
|
|
+ this.getUnitList();
|
|
|
+ this.findInAndNoBusinessCar();
|
|
|
}
|
|
|
})
|
|
|
</script>
|