tb-car-disincle-add.html 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <title>入境登记-添加/修改</title>
  5. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  6. <meta name="viewport"
  7. content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
  8. <!-- 所有的 css js 资源 -->
  9. <link rel="stylesheet" href="../../static/kj/element-ui/theme-chalk/index.css">
  10. <link rel="stylesheet" href="../../static/sa.css">
  11. <script src="../../static/kj/vue.min.js"></script>
  12. <script src="../../static/kj/element-ui/index.js"></script>
  13. <script src="../../static/kj/httpVueLoader.js"></script>
  14. <script src="../../static/kj/jquery.min.js"></script>
  15. <script src="../../static/kj/layer/layer.js"></script>
  16. <script src="../../static/sa.js"></script>
  17. <script src="../../static/kj/upload-util.js"></script>
  18. <style type="text/css">
  19. .c-panel .el-form .c-label {
  20. width: 7em !important;
  21. }
  22. .c-panel .el-form .c-panel .el-form {
  23. width: 180px;
  24. }
  25. .item-num .el-input__inner {
  26. width: 130px;
  27. }
  28. .xj {
  29. display: inline;
  30. color: red;
  31. margin-left: 9px;
  32. font-weight: bold;
  33. }
  34. .hj {
  35. color: red;
  36. margin-left: 9px;
  37. font-weight: bold;
  38. }
  39. .china-car-size .el-input__inner {
  40. width: 130px;
  41. }
  42. </style>
  43. </head>
  44. <body>
  45. <div class="vue-box sbot" style="display: none;" :style="'display: block;'">
  46. <!-- ------- 内容部分 ------- -->
  47. <div class="s-body">
  48. <div class="c-panel">
  49. <div class="c-title">数据添加</div>
  50. <el-form v-if="m" label-position="left">
  51. <el-row>
  52. <el-card class="box-card">
  53. <div slot="header" class="clearfix">
  54. <span>基本资料</span>
  55. </div>
  56. <div>
  57. <el-row>
  58. <el-col span=8>
  59. <div class="c-item">
  60. <label class="c-label"><span style="color: red;">*</span>业务项目:</label>
  61. <el-select v-model="m.goodsId" placeholder="请选择" @change="goodsChange">
  62. <el-option v-for="item in goodsList" :key="item.id"
  63. :label="item.name" :value="item.id">
  64. </el-option>
  65. </el-select>
  66. </div>
  67. <sa-item name="作业人员" placeholder="请输入作业人员" v-model="m.operator" br>
  68. </sa-item>
  69. </el-col>
  70. <el-col span=8>
  71. <div class="c-item" v-if="goods.needDeclare==1">
  72. <label class="c-label">
  73. <span style="color: red;" >*</span>
  74. 申报单号:</label>
  75. <el-input v-model="m.declareNo" placeholder="选择申报单" :readonly="goods.needDeclare==1" clearable>
  76. </el-input>
  77. <div style="cursor: pointer;color: blue;display: inline;"
  78. @click="handlerDeclare">
  79. <i class="el-icon-folder-add"></i>
  80. </div>
  81. </div>
  82. <div class="c-item">
  83. <label class="c-label"><span style="color: red;"
  84. v-if="goods.needOperateTime==1">*</span>作业时间:</label>
  85. <el-date-picker type="datetime" value-format="yyyy-MM-dd HH:mm:ss"
  86. v-model="m.operateTime"></el-date-picker>
  87. </div>
  88. </el-col>
  89. <el-col span=8>
  90. <div class="c-item" v-if="currentCustomerId=='1'">
  91. <label class="c-label"><span style="color: red;">*</span>客户:</label>
  92. <el-select :disabled="goods.needDeclare||m.declareNo" v-model="m.customerId"
  93. placeholder="请选择">
  94. <el-option v-for="item in customerList" :key="item.id"
  95. :label="item.name" :value="item.id">
  96. </el-option>
  97. </el-select>
  98. </div>
  99. </el-col>
  100. </el-row>
  101. </div>
  102. </el-card>
  103. </el-row>
  104. <el-row>
  105. <el-card class="box-card">
  106. <div slot="header" class="clearfix">
  107. <span>车辆</span>
  108. <el-button style="float: right;" icon="el-icon-plus" type="primary"
  109. @click="showAddModal">添加
  110. </el-button>
  111. </div>
  112. <el-table :data="car.list">
  113. <el-table-column type="index" width="50" label="序号">
  114. </el-table-column>
  115. <el-table-column prop="carNo" label="车牌号">
  116. </el-table-column>
  117. <el-table-column prop="carSize" label="规格(米)">
  118. </el-table-column>
  119. <el-table-column prop="carType" label="类型">
  120. </el-table-column>
  121. <el-table-column prop="netWeight" label="载重(kg)">
  122. </el-table-column>
  123. <el-table-column label="操作">
  124. <template slot-scope="s">
  125. <el-button class="c-btn" type="info" @click="editFn(s.row)">修改</el-button>
  126. <el-button class="c-btn" type="danger" @click="deleteFn(s.row)">删除
  127. </el-button>
  128. </template>
  129. </el-table-column>
  130. </el-table>
  131. </el-card>
  132. </el-row>
  133. <el-row>
  134. <el-card class="box-card">
  135. <div slot="header" class="clearfix">
  136. <span>收费项</span>
  137. </div>
  138. <div>
  139. <el-form-item v-for="(type,index) in itemTypeList">
  140. <el-row>
  141. <el-col span="9">
  142. <label style="color: red;"
  143. v-if="type.need==1">*</label>{{type.name}}</label>
  144. <el-select v-model="type.itemId" style="width: 120px;"
  145. @change="itemChange(type)" placeholder="请选择">
  146. <el-option v-for="item in type.items" :key="item.id"
  147. :label="item.itemName" :value="item.id">
  148. </el-option>
  149. </el-select>
  150. </el-col>
  151. <el-col span="7">
  152. <el-input-number style="margin-left: 60px;" class="item-num"
  153. v-model="type.num" :min="1" :max="10" size="mini"
  154. :disabled="type.inc==0"></el-input-number>
  155. <div class="xj" v-if="type.itemId">
  156. {{type.price*type.num}}元
  157. <label @click="cleanItem(type)"
  158. style="margin-left: 5px;cursor: pointer">(<i
  159. class="el-icon-delete"></i>)</label>
  160. </div>
  161. </el-col>
  162. <el-col span="8">
  163. <sa-item type="textarea" name="备注" placeholder="请输入备注"
  164. v-model="type.remark"></sa-item>
  165. </el-col>
  166. </el-row>
  167. <el-divider></el-divider>
  168. </el-form-item>
  169. <div class="hj" v-if="totalPrice>0">
  170. 合计费用:{{totalPrice}}<label>元</label>
  171. </div>
  172. </div>
  173. </el-card>
  174. </el-row>
  175. </el-form>
  176. </div>
  177. </div>
  178. <!-- ------- 底部按钮 ------- -->
  179. <div class="s-foot">
  180. <el-button type="primary" @click="ok()">确定</el-button>
  181. <el-button @click="closeFn()">取消</el-button>
  182. </div>
  183. <el-dialog title="车辆录入" :visible.sync="car.visible" width="400">
  184. <span>
  185. <el-form label-position="left">
  186. <div class="c-item">
  187. <label class="c-label"><span style="color: red;">*</span>车牌号:</label>
  188. <el-autocomplete v-model="car.form.carNo" placeholder="请输入车牌号" value-key='carNo'
  189. :fetch-suggestions="queryCarAsync">
  190. </el-autocomplete>
  191. </div>
  192. <div class="c-item">
  193. <label class="c-label">车辆类型:</label>
  194. <el-select v-model="car.form.carType" placeholder="请选择" @change="carTypeChange">
  195. <el-option :label="item.name" :value="item.name" v-for="(item,index) in carTypeList">
  196. </el-option>
  197. </el-select>
  198. </div>
  199. <div class="c-item">
  200. <label class="c-label">
  201. <span style="color: red;" v-if="goods.needCarSize==1">*</span>
  202. 规格(米):</label>
  203. <el-input-number class="item-num" v-model="car.form.carSize" :min="1" :max="50">
  204. </el-input-number>
  205. </div>
  206. <div class="c-item" v-if="car.form.carType.indexOf('空')==-1">
  207. <label class="c-label">
  208. <span style="color: red;" v-if="goods.needCarSize==1">*</span>
  209. 载重(kg):</label>
  210. <el-input-number class="item-num" v-model="car.form.netWeight" :min="1" :max="999999">
  211. </el-input-number>
  212. </div>
  213. </el-form>
  214. </span>
  215. <span slot="footer" class="dialog-footer">
  216. <el-button @click="car.visible = false">取 消</el-button>
  217. <el-button type="primary" @click="confirmAdd">确 定</el-button>
  218. </span>
  219. </el-dialog>
  220. <el-dialog title="申报单" :visible.sync="declare.visible" width="90%">
  221. <div class="delect-search">
  222. 申报人:
  223. <el-input style="width: 140px;" v-model="declare.p.declarePeople" placeholder="申报人">
  224. </el-input>
  225. <el-button type="primary" @click="getDeclareList">搜索</el-button>
  226. <el-button type="info" @click="resetDclare">重置</el-button>
  227. </div>
  228. <el-card class="box-card" style="margin-top: 20px;">
  229. <div slot="header">
  230. <span>列表</span>
  231. </div>
  232. <el-table :data="declare.list" ref="declareTable">
  233. <el-table-column type="selection">
  234. </el-table-column>
  235. <el-table-column prop="declarePeople" label="申报人">
  236. </el-table-column>
  237. <el-table-column prop="customerName" label="申报公司" width=200>
  238. </el-table-column>
  239. <el-table-column prop="createTime" width="140" label="申报时间">
  240. </el-table-column>
  241. <el-table-column prop="declareNo" width="180" label="申报单号">
  242. </el-table-column>
  243. <el-table-column prop="goodsName" label="产品学名">
  244. </el-table-column>
  245. <el-table-column prop="carNo" label="越南车牌">
  246. </el-table-column>
  247. <el-table-column prop="grossWeight" label="毛重(kg)">
  248. </el-table-column>
  249. </el-table>
  250. <div class="block">
  251. <el-pagination layout="prev, pager, next" @current-change="currentPageChange"
  252. :page-size="declare.p.pageSize" :total="declare.p.dataCount"
  253. :current-page="declare.p.pageNo">
  254. </el-pagination>
  255. </div>
  256. </el-card>
  257. <span slot="footer" class="dialog-footer">
  258. <el-button @click="declare.visible = false">取 消</el-button>
  259. <el-button type="primary" @click="confirmSelectDeclare">确 定</el-button>
  260. </span>
  261. </el-dialog>
  262. </div>
  263. <script>
  264. var app = new Vue({
  265. components: {
  266. "sa-item": httpVueLoader('../../sa-frame/com/sa-item.vue'),
  267. "sa-td": httpVueLoader('../../sa-frame/com/sa-td.vue')
  268. },
  269. el: '.vue-box',
  270. data: {
  271. m: {
  272. id: '', // 主键
  273. customerId: '', // 客户id
  274. customerName: '', // 客户名称
  275. operateTime: '',
  276. no: '', // 编号
  277. goodsId: '',
  278. goodsName: '', // 商品
  279. }, // 实体对象
  280. customerList: [],
  281. carList: [],
  282. currentCustomerId: 1,
  283. itemTypeList: [],
  284. filterTypeList: [],
  285. goodsList: [],
  286. tableData: [],
  287. car: {
  288. visible: false,
  289. list: [],
  290. form: {
  291. carNo: '',
  292. carType: '',
  293. netWeight: '',
  294. carSize: ''
  295. }
  296. },
  297. declare: {
  298. visible: false,
  299. list: [],
  300. p: {
  301. pageNo: 1,
  302. pageSize: 8,
  303. dataCount: 0,
  304. declarePeople: '',
  305. production: '',
  306. businessId: ''
  307. }
  308. },
  309. goods: {
  310. id: '',
  311. name: '',
  312. needWeight: 1,
  313. needCarSize: 1,
  314. needDeclare: 1,
  315. needOperateTime: 1,
  316. chinaCarPay: 1,
  317. vietnamCarPay: 1,
  318. },
  319. carTypeList: []
  320. },
  321. computed: {
  322. totalPrice() {
  323. let itemList = this.itemTypeList.filter(obj => obj.itemId);
  324. let price = 0;
  325. for (let i in itemList) {
  326. let type = itemList[i];
  327. let num = type.num;
  328. let items = type.items;
  329. for (let j in items) {
  330. let item = items[j];
  331. if (item.id == type.itemId) {
  332. price += num * item.price;
  333. break;
  334. }
  335. }
  336. }
  337. return price;
  338. }
  339. },
  340. methods: {
  341. resetDclare() {
  342. this.declare.p.pageNo = 1;
  343. this.declare.p.pageSize = 8;
  344. this.declare.p.production = '';
  345. this.declare.p.declarePeople = '';
  346. this.getDeclareList();
  347. },
  348. handlerDeclare() {
  349. this.declare.visible = true;
  350. this.getDeclareList();
  351. },
  352. currentPageChange(page){
  353. this.declare.p.pageNo=page;
  354. this.getDeclareList();
  355. },
  356. getDeclareList() {
  357. let currentCustomerId = this.currentCustomerId;
  358. if (currentCustomerId != '1') {
  359. this.declare.p.customerId = this.currentCustomerId;
  360. }
  361. sa.ajax('/TbDeclare/getNotBindList', sa.removeNull(this.declare.p), function(resp) {
  362. let list = resp.data;
  363. this.declare.list = list;
  364. this.declare.p.pageNo = resp.pageNo;
  365. this.declare.p.dataCount = resp.dataCount;
  366. list.forEach(row => {
  367. if (row.declareNo == this.m.declareNo&&this.m.declareNo) {
  368. this.$nextTick(() => {
  369. this.$refs['declareTable'].toggleRowSelection(row, true)
  370. })
  371. }
  372. })
  373. }.bind(this))
  374. },
  375. confirmSelectDeclare() {
  376. // 获取选中元素的id列表
  377. let selection = this.$refs['declareTable'].selection;
  378. let declareNo = sa.getArrayField(selection, 'declareNo');
  379. if (selection.length == 0) {
  380. return sa.msg('请至少选择一条数据')
  381. }
  382. if (selection.length > 1) {
  383. return sa.msg('只能选择一条数据')
  384. }
  385. let declare = selection[0];
  386. let oldNo = this.m.declareNo;
  387. if (oldNo && oldNo !== declare.declareNo) {
  388. this.car.list = [];
  389. }
  390. if (oldNo !== declare.declareNo) {
  391. this.m.declareNo = declare.declareNo;
  392. this.m.customerId = declare.customerId;
  393. this.m.customerName = declare.customerName;
  394. let carNo = declare.carNo;
  395. let grossWeight = declare.grossWeight;
  396. let carList = this.car.list;
  397. let exit = carList.filter(obj => obj.carNo == carNo).pop();
  398. if (!exit) {
  399. let car = {
  400. carNo: carNo,
  401. netWeight: grossWeight,
  402. carType: '载重'
  403. }
  404. this.car.list.push(car)
  405. }
  406. this.m.cardNo = declare.carNo;
  407. this.m.chinaCarNo = declare.chinaCarNo;
  408. this.m.netWeight = declare.grossWeight;
  409. let chinaCarNo = declare.chinaCarNo;
  410. if (chinaCarNo) {
  411. let list = [];
  412. chinaCarNo.replace(",", ",").split(",").forEach(carNo => {
  413. let exit = carList.filter(obj => obj.carNo == carNo).pop();
  414. if (!exit) {
  415. let car = {
  416. carNo: carNo,
  417. carType: '空车'
  418. }
  419. this.car.list.push(car)
  420. }
  421. })
  422. }
  423. this.filterItems();
  424. }
  425. this.declare.visible = false;
  426. },
  427. cleanItem(type) {
  428. type.itemId = '';
  429. type.itemName = '';
  430. type.price = '';
  431. },
  432. itemChange(type) {
  433. let itemId = type.itemId;
  434. let item = type.items.filter(obj => obj.id == itemId).pop();
  435. if (item) {
  436. type.inc = item.inc;
  437. type.price = item.price;
  438. }
  439. },
  440. confirmAdd() {
  441. let carNo = this.car.form.carNo;
  442. let netWeight = this.car.form.netWeight;
  443. let goods = this.goods;
  444. let form = this.car.form;
  445. let carType = form.carType;
  446. if (!carNo) {
  447. sa.error('请录入车牌号')
  448. return false;
  449. }
  450. if (!form.carSize && goods.needCarSize == 1) {
  451. sa.error('请填入车辆规格')
  452. return false;
  453. }
  454. if(carType.indexOf('空')!==-1){
  455. netWeight=0;
  456. }
  457. let list = this.car.list;
  458. let index = list.map(obj => obj.carNo).indexOf(carNo);
  459. if (index > -1) {
  460. list.splice(index, 1);
  461. }
  462. let carSize = form.carSize;
  463. let car = {
  464. id: form.id,
  465. carNo: form.carNo.toUpperCase(),
  466. carType: carType,
  467. carSize: carSize,
  468. netWeight: netWeight
  469. }
  470. this.car.list.push(car);
  471. this.car.visible = false;
  472. this.filterItems();
  473. },
  474. filterItems() {
  475. let carList = this.car.list;
  476. let filterTypeList = JSON.parse(JSON.stringify(this.filterTypeList));
  477. if (carList.length == 0) {
  478. this.itemTypeList = filterTypeList;
  479. return;
  480. }
  481. let car = carList[0];
  482. let checkCarList = carList.filter(car => car.carType.indexOf('空') == -1);
  483. if(checkCarList.length>0){
  484. car=checkCarList[0];
  485. }
  486. let carSize = car.carSize;
  487. let carType = car.carType;
  488. let netWeight = car.netWeight;
  489. let tempList = [];
  490. for (let i in filterTypeList) {
  491. let type = filterTypeList[i];
  492. let items = type.items;
  493. if (carType) {
  494. items = items.filter(item => item.itemType&& item.itemType.indexOf(carType) !== -1);
  495. console.log(items)
  496. }
  497. if (carSize && carSize > 1) {
  498. items = items.filter(item => item.minLength <= carSize && item.carLength >= carSize);
  499. console.log(items)
  500. }
  501. if (netWeight && netWeight > 1 && carType.indexOf('空') == -1) {
  502. items = items.filter(item => item.minWeight <= netWeight && item.maxWeight >= netWeight);
  503. console.log(items)
  504. }
  505. let itemIds = items.map(item => item.id);
  506. if (itemIds.indexOf(type.itemId) == -1) {
  507. this.cleanItem(type);
  508. }
  509. type.items = items;
  510. tempList.push(type);
  511. }
  512. this.itemTypeList = tempList;
  513. },
  514. showAddModal() {
  515. this.car.visible = true;
  516. this.car.form.carNo = '';
  517. this.car.form.carSize = '';
  518. this.car.form.netWeight = '';
  519. },
  520. editFn(data) {
  521. Object.assign(this.car, {
  522. visible: true,
  523. form: data
  524. })
  525. },
  526. deleteFn(data) {
  527. this.car.list.splice(this.car.list.indexOf(data), 1);
  528. this.filterItems();
  529. },
  530. getGoods() {
  531. sa.ajax('/TbGoods/getList', {
  532. pageNo: 1,
  533. pageSize: 10,
  534. businessType: 1
  535. }, function(resp) {
  536. let list = resp.data;
  537. if (list.length >= 1) {
  538. let initGoods = list[0];
  539. this.goods = initGoods
  540. this.m.goodsId = initGoods.id;
  541. this.m.goodsName = initGoods.name;
  542. this.getTypeByGoodsId();
  543. }
  544. this.goodsList = list;
  545. }.bind(this))
  546. },
  547. goodsChange(v) {
  548. let goodsList = this.goodsList;
  549. let goods = goodsList.filter(goods => goods.id == v).pop();
  550. this.goods = goods;
  551. this.m.goodsName = goods.name;
  552. this.getTypeByGoodsId();
  553. },
  554. getTypeByGoodsId() {
  555. sa.ajaxNoLoading('/TbItemType/getTypeByGoodsId', {
  556. goodsId: this.m.goodsId
  557. }, function(resp) {
  558. let list = resp.data;
  559. this.itemTypeList = list;
  560. this.filterTypeList = JSON.parse(JSON.stringify(this.itemTypeList));
  561. this.filterItems();
  562. }.bind(this))
  563. },
  564. getItemType() {
  565. sa.ajax('/TbItem/getItemType', function(resp) {
  566. let list = resp.data;
  567. if (list.length > 0) {
  568. this.car.form.carType = list[0].name;
  569. }
  570. this.carTypeList = list;
  571. }.bind(this))
  572. },
  573. carTypeChange(v) {
  574. },
  575. getCustomerList() {
  576. sa.ajax('/TbCostomer/getList', {
  577. pageNo: 1,
  578. pageSize: 30,
  579. sortType: 20,
  580. judgeStatus: 2
  581. }, function(res) {
  582. let list = res.data;
  583. if (list.length > 0) {
  584. let customer = list[0];
  585. this.m.customerId = customer.id;
  586. this.m.customerName = customer.name;
  587. }
  588. this.customerList = list;
  589. }.bind(this));
  590. },
  591. queryCarAsync(queryStr, cb) {
  592. sa.ajaxNoLoading('/TbBusinessCar/searchByNo', {
  593. carNo: queryStr
  594. }, function(resp) {
  595. cb(resp.data)
  596. }.bind(this))
  597. },
  598. closeFn() {
  599. parent.app.f5();
  600. sa.closeCurrIframe();
  601. },
  602. // 提交数据
  603. ok: function() {
  604. let goods = this.goods;
  605. let m = this.m;
  606. if (goods.needDeclare == 1 && !m.declareNo) {
  607. sa.error('请选择申报单');
  608. return false;
  609. }
  610. if (goods.needOperateTime == 1 && !m.operateTime) {
  611. sa.error('请选择作业时间');
  612. return false;
  613. }
  614. if (this.car.list.length == 0) {
  615. sa.error('请录入车辆');
  616. return false;
  617. }
  618. let typeList = this.itemTypeList;
  619. let selectList = [];
  620. for (let i in typeList) {
  621. let type = typeList[i];
  622. if (type.need == 1 && !type.itemId) {
  623. sa.error(type.name + '必选');
  624. return false;
  625. }
  626. if (type.itemId) {
  627. let obj = {
  628. typeId: type.id,
  629. typeName: type.name,
  630. id: type.itemId,
  631. num: type.num,
  632. price:type.price,
  633. remark:type.remark
  634. }
  635. selectList.push(obj);
  636. }
  637. }
  638. let carList = this.car.list;
  639. m.itemJson = JSON.stringify(selectList);
  640. m.carJson = JSON.stringify(carList);
  641. let chinaCarNo=carList
  642. .filter(car=>sa.isCarNo(car.carNo.toUpperCase()))
  643. .map(car=>car.carNo.toUpperCase())
  644. .join("、");
  645. let yueCarNo=carList
  646. .filter(car=>!sa.isCarNo(car.carNo.toUpperCase()))
  647. .map(car=>car.carNo.toUpperCase())
  648. .join("、");
  649. m.cardNo=yueCarNo;
  650. m.chinaCarNo=chinaCarNo;
  651. sa.ajax('/TbBusiness/addOtherBusiness', sa.removeNull(m), function(res) {
  652. sa.alert('增加成功', this.clean);
  653. }.bind(this));
  654. },
  655. // 添加/修改 完成后的动作
  656. clean: function() {
  657. parent.app.f5(); // 刷新父页面列表
  658. sa.closeCurrIframe(); // 关闭本页
  659. },
  660. getCurrentCustomer() {
  661. sa.ajax('/TbCostomer/getCurrentCustomerId', function(resp) {
  662. let id = resp.data;
  663. if (id == 1) {
  664. this.getCustomerList();
  665. } else {
  666. this.m.customerId = id;
  667. }
  668. this.currentCustomerId = id;
  669. }.bind(this));
  670. },
  671. },
  672. mounted: function() {
  673. this.getCurrentCustomer();
  674. this.getGoods();
  675. this.getItemType();
  676. }
  677. })
  678. </script>
  679. </body>
  680. </html>