tb-car-disincle-edit.html 22 KB

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