tb-car-disincle-edit.html 22 KB

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