tb-car-disincle-add.html 22 KB

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