planOrderAdd.vue 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726
  1. <template>
  2. <view class="order">
  3. <view class="example">
  4. <u-form labelPosition="left" :model="orderForm" :rules="rules" ref="form1" labelWidth='90'>
  5. <!-- 下单日期 -->
  6. <u-form-item :label="$t('order.orderDate')" borderBottom prop="setDate">
  7. <u-input readonly v-model="orderForm.setDate" border="none"
  8. :placeholder="$t('base.common.placeholderS')+$t('order.orderDate')" />
  9. </u-form-item>
  10. <!-- 有效日期 -->
  11. <template>
  12. <u-form-item :label="$t('order.endDate')" borderBottom prop="orderValidDate"
  13. @click="showEndDateCalendar = true">
  14. <u-input readonly v-model="orderForm.orderValidDate" border="none"
  15. :placeholder="$t('base.common.placeholderS')+$t('order.endDate')" />
  16. </u-form-item>
  17. </template>
  18. <!-- 选择企业 -->
  19. <u-form-item :label="$t('order.enterprise')" borderBottom prop="tenantId"
  20. @click="showPopup('popupTenantId')">
  21. <u-input readonly v-model="orderForm.tenantName" border="none"
  22. :placeholder="$t('base.common.placeholderS')+$t('order.enterprise')" />
  23. </u-form-item>
  24. <!-- 临时/固定 -->
  25. <u-form-item :label="$t('order.orderType')" borderBottom prop="orderType"
  26. @click="showPopup('popupOrderType')">
  27. <u-input readonly v-model="orderForm.orderTypeName" border="none"
  28. :placeholder="$t('base.common.placeholderS')+$t('order.orderType')" />
  29. </u-form-item>
  30. <u-form-item :label="$t('order.vehicleType')" borderBottom prop="vehicleType">
  31. <u-radio-group v-model="orderForm.vehicleType" @change="onVehicleTypeConfirm" placement="row"
  32. class="p-input">
  33. <u-radio :customStyle="{marginRight: '10px'}" v-for="item in vehicleTypeOption"
  34. :key="item.value" :label="item.text" :name="item.value">
  35. </u-radio>
  36. </u-radio-group>
  37. </u-form-item>
  38. <template>
  39. <u-form-item :label="$t('order.companyName')" borderBottom prop="companyId"
  40. @click="showPopup('popupCompanyId')">
  41. <u-input readonly v-model="orderForm.companyName" border="none"
  42. :placeholder="$t('base.common.placeholderS')+$t('order.companyName')">
  43. <template slot="suffix">
  44. <view v-if="paymentOption && paymentOption.isShow=='1'"
  45. style="color: darkgreen;font-size: 9pt;">
  46. {{paymentOption.total}}
  47. </view>
  48. </template>
  49. </u-input>
  50. </u-form-item>
  51. <view v-if="paymentOption && paymentOption.isShow=='1' && paymentOption.agentResponsible=='1'"
  52. style="display: flex;flex-direction: row-reverse;">
  53. <view style="color: red;font-size: 9pt;">{{$t('order.source')}}:{{paymentOption.companyName}}
  54. </view>
  55. </view>
  56. <u-form-item :label="$t('order.materialName')" borderBottom prop="materialId" @click="selectMater">
  57. <u-input readonly v-model="orderForm.materialName" border="none"
  58. :placeholder="$t('base.common.placeholderS')+$t('order.materialName')" />
  59. </u-form-item>
  60. </template>
  61. <!-- 订单数量 -->
  62. <u-form-item :label="$t('order.planNumber')" borderBottom prop="planNumber">
  63. <u--input v-model="orderForm.orderNumber" border="none" type='digit'
  64. :placeholder="$t('base.common.placeholderI')+$t('order.planNumber')"></u--input>
  65. </u-form-item>
  66. <u-form-item v-if="orderForm.orderType != '4'" u-form-item :label="$t('order.vehicle')" borderBottom
  67. prop="vehicle" @click="toSelectVehicle">
  68. <u--input readonly v-model="orderForm.vehicle" border="none"
  69. :placeholder="$t('base.common.placeholderS')+$t('order.vehicle')"></u--input>
  70. <u-icon slot="right" name="arrow-right"></u-icon>
  71. </u-form-item>
  72. <u-form-item v-if="paymentOption && paymentOption.isFlag=='1'" :label="$t('order.isIntima')" borderBottom prop="isIntima">
  73. <view class="uni-list">
  74. <radio-group v-model="orderForm.isIntima" @change="onisIntimaConfirm" placement="row">
  75. <label class="uni-list-cell uni-list-cell-pd" v-for="item in isIntimaOption" :key="item.value" >
  76. <radio style="transform:scale(0.8)" :value="item.value" :checked="item.value === orderForm.isIntima"/>{{item.text}}
  77. </label>
  78. </radio-group>
  79. </view>
  80. </u-form-item>
  81. <u-form-item :label="$t('order.salePoint')" borderBottom prop="salePoint"
  82. @click="showPopup('salePoint')">
  83. <span>{{orderForm.salePointName}}</span>
  84. </u-form-item>
  85. <u-form-item v-if="orderForm.vehicleType=='101'" :label="$t('order.transportType')" borderBottom
  86. prop="transporterType" @click="showPopup('popupTransporterTypeId')">
  87. <u-input readonly v-model="orderForm.transporterTypeName" border="none"
  88. :placeholder="$t('base.common.placeholderS')+$t('order.transportType')" />
  89. </u-form-item>
  90. <u-form-item v-if="orderForm.vehicleType=='101'" :label="$t('order.transporter')" borderBottom
  91. prop="transporterId" @click="showPopup('popupTransporterId')">
  92. <u-input readonly v-model="orderForm.transporterName" border="none"
  93. :placeholder="$t('base.common.placeholderS')+$t('order.transporter')" />
  94. </u-form-item>
  95. <u-form-item :label="$t('order.remarks')" borderBottom prop="remarks">
  96. <u-input v-model="orderForm.remark" border="none"
  97. :placeholder="$t('base.common.placeholderI')+$t('order.remarks')" />
  98. </u-form-item>
  99. </u-form>
  100. <view style="margin: 16px 0;">
  101. <button class="bind-btn" @click="submit('form1')">{{$t('base.common.submit')}}
  102. </button>
  103. </view>
  104. </view>
  105. <u-toast ref="loadingToast"></u-toast>
  106. <CarKeyboard :show.sync="carKeyboardShow" :vehicleNo="orderForm.vehicle" @confirm="onKeyBoardConfirm"
  107. vehicleType="car"></CarKeyboard>
  108. <!-- 下单日期 -->
  109. <u-calendar color="#4680F9" round='25' :show="showSetDateCalendar" @confirm="onSetDateConfirm"
  110. @close="showSetDateCalendar=false"></u-calendar>
  111. <!-- 有效日期 -->
  112. <u-datetime-picker :show="showEndDateCalendar" v-model="defaultEndDate" :defaultDate="defaultEndDate"
  113. mode="datetime" @confirm="onEndDateConfirm" @cancel="showEndDateCalendar=false" />
  114. <!-- <u-calendar color="#4680F9" :defaultDate="defaultEndDate" :show="showEndDateCalendar"
  115. @confirm="onEndDateConfirm" @close="showEndDateCalendar=false" /> -->
  116. <!-- 临时或固定 -->
  117. <PopupSelect ref="popupOrderType" :option="orderTypeOption" @onConfirm="onOrderTypeConfirm" />
  118. <!-- 业务类型 -->
  119. <!-- <PopupSelect ref="popupVehicleType" :option="vehicleTypeOption" @onConfirm="onVehicleTypeConfirm" /> -->
  120. <!-- 客户 -->
  121. <PopupSelect ref="popupCompanyId" :hasSearch='false' :option="companyOption" @onConfirm="onCompanyConfirm" />
  122. <!-- 原料 -->
  123. <PopupSelect ref="popupmaterialId" kind="m" :hasSearch='false' :option="materialOption"
  124. @onConfirm="onProductConfirm" />
  125. <!-- 企业选项 -->
  126. <PopupSelect ref="popupTenantId" :hasSearch='false' :option="tenantOption" @onConfirm="onTenantConfirm" />
  127. <PopupSelect ref="popupTransporterId" :hasSearch='false' :option="transporterOption"
  128. @onConfirm="onTransporterConfirm" />
  129. <PopupSelect ref="popupTransporterTypeId" kind="m" :hasSearch='false' :option="transporterTypeOption"
  130. @onConfirm="onTransporterTypeConfirm" />
  131. <PopupSelect ref="salePoint" :hasSearch='false' :option="salePointOption" @onConfirm="onSalePointConfirm" />
  132. </view>
  133. </template>
  134. <script>
  135. import PopupSelect from '../../components/popup-select/index'
  136. import dayjs from 'dayjs'
  137. import CarKeyboard from '../../components/carKeyboard/carKeyboard'
  138. import {
  139. getTenantCacheList
  140. } from '../../utils/util.js'
  141. import {
  142. saveOrder,
  143. getOption,
  144. getMaterialsByCompany
  145. } from '../../api/order'
  146. export default {
  147. components: {
  148. CarKeyboard,
  149. PopupSelect
  150. },
  151. data() {
  152. return {
  153. carKeyboardShow: false,
  154. start: dayjs().format('YYYY-MM-DD'),
  155. orderForm: {
  156. setDate: dayjs().format('YYYY-MM-DD'), //订单日期
  157. orderValidDate: dayjs().add(3, 'day').format('YYYY-MM-DD HH:mm:ss'), //有效日期
  158. tenantId: '', //企业
  159. orderType: '5', //订单类型
  160. companyId: '', //客商
  161. materialId: "", //物料
  162. orderNumber: "0", //数量
  163. vehicle: '', //车号
  164. driverId: '', //司机id\
  165. vehicleType: '101',
  166. xfFlag: '',
  167. phone: '',
  168. idcard: "",
  169. driver: '',
  170. tenantName: '',
  171. vehicleTypeName: '', //业务类型
  172. companyName: "", //客商
  173. materialName: "", //物料id
  174. orderTypeName: this.$t('order.planOrder'),
  175. transporterType: '101',
  176. transporterTypeName: this.$t('order.saleOrder'),
  177. transporterId: "",
  178. transporterName: "",
  179. sourceId: "", //第三方大订单ID
  180. remark: "",
  181. salePoint:"",
  182. salePointName:"",
  183. isIntima:"0",
  184. },
  185. rules: {
  186. orderType: [{
  187. required: true,
  188. message: this.$t('base.common.placeholderS') + this.$t('order.orderType')
  189. }],
  190. vehicleType: [{
  191. required: true,
  192. message: this.$t('base.common.placeholderS') + this.$t('order.vehicleType')
  193. }],
  194. tenantId: [{
  195. required: true,
  196. message: this.$t('base.common.placeholderS') + this.$t('order.enterprise')
  197. }],
  198. companyId: [{
  199. required: true,
  200. message: this.$t('base.common.placeholderS') + this.$t('order.companyName')
  201. }],
  202. materialId: [{
  203. required: true,
  204. message: this.$t('base.common.placeholderS') + this.$t('order.materialName')
  205. }],
  206. orderNumber: [{
  207. required: true,
  208. message: this.$t('base.common.placeholderI') + this.$t('order.planNumber')
  209. }]
  210. },
  211. vehicleTypeOption: [{
  212. text: this.$t('order.saleOrder'),
  213. value: '101'
  214. }],
  215. orderTypeOption: [{
  216. text: this.$t('order.planOrder'),
  217. value: '5'
  218. }, ],
  219. isIntimaOption:[{
  220. text: this.$t('driver.have'),
  221. value: '1'
  222. },{
  223. text: this.$t('driver.notHave'),
  224. value: '0'
  225. },],
  226. paymentOption: {},
  227. //产品选项
  228. materialOption: [{
  229. text: this.$t('base.common.noData'),
  230. value: null,
  231. }], //物料选项
  232. //客户选项
  233. companyOption: [{
  234. text: this.$t('base.common.noData'),
  235. compvalueanyId: null
  236. }], //供应商选项
  237. // vehicleOption:[{vehicle:this.$t('base.common.noData'),value:null}], //司机选项
  238. tenantOption: [{
  239. text: this.$t('base.common.noData'),
  240. value: null
  241. }], //企业选项
  242. transporterOption: [{
  243. text: this.$t('base.common.noData'),
  244. compvalueanyId: null
  245. }],
  246. transporterTypeOption: [{
  247. text: this.$t('base.common.noData'),
  248. value: null,
  249. }], //物料选项
  250. salePointOption: [{
  251. text: this.$t('base.common.noData'),
  252. value: null
  253. }], //销售点
  254. showSetDateCalendar: false,
  255. showEndDateCalendar: false,
  256. defaultEndDate: dayjs().add(30, 'day').format('YYYY-MM-DD HH:mm:ss'), //默认有效日期
  257. //业务对应的客户信息
  258. vehicleTypeCompanyList: [],
  259. //客户对应的物料信息
  260. companyMaterialList: [],
  261. }
  262. },
  263. onLoad(options) {
  264. this.bindTenant()
  265. },
  266. methods: {
  267. //选择品种
  268. selectMater() {
  269. uni.navigateTo({
  270. url: `/subpages/order/materSelect?option=${JSON.stringify(this.materialOption)}`
  271. })
  272. },
  273. //去选择司机
  274. toSelectVehicle() {
  275. uni.navigateTo({
  276. url: '/subpages/order/multipleVehicle?vehicles=' + this.orderForm.vehicle
  277. })
  278. },
  279. //车号键盘输出
  280. onKeyBoardConfirm(id) {
  281. this.orderForm.vehicle = id
  282. },
  283. //显示车牌键盘-
  284. carKeyboardOut() {
  285. this.carKeyboardShow = true
  286. },
  287. //选择订单类型后加载选项 //获取品种信息 101:销售,102:采购
  288. bindOption() {
  289. this.clear();
  290. console.log("订单租户信息、", this.orderForm.tenantId);
  291. if (!this.orderForm.tenantId) {
  292. console.log("订单业务租户信息");
  293. return;
  294. }
  295. var that = this;
  296. console.log("当前租户ID、", that.orderForm.tenantId);
  297. if (that.orderForm.tenantId) {
  298. let data = JSON.parse(JSON.stringify(that.orderForm))
  299. getOption(data).then(res => {
  300. console.log("查询基础数据返回、", res);
  301. if (res.statusCode === 200) {
  302. console.log("用户客户信息、", res.data.data.appCompany)
  303. console.log("用户品种信息、", res.data.data.appMaterial)
  304. if (that.vehicleTypeOption && that.vehicleTypeOption.length > 0) {
  305. that.orderForm.vehicleType = that.vehicleTypeOption[0].value
  306. that.vehicleTypeCompanyList = res.data.data.appCompany
  307. that.bindCompany();
  308. that.bindMaterial();
  309. if (that.orderForm.vehicleType == "101") {
  310. that.transporterTypeOption = res.data.data.appTransportTypeList
  311. if (that.transporterTypeOption && that.transporterTypeOption.length > 0) {
  312. that.orderForm.transporterType = that.transporterTypeOption[0].value
  313. that.orderForm.transporterTypeName = that.transporterTypeOption[0].text
  314. }
  315. }
  316. that.salePointOption=res.data.data.salePoint
  317. if (that.salePointOption && that.salePointOption.length > 0) {
  318. that.orderForm.salePoint = that.salePointOption[0].value
  319. that.orderForm.salePointName = that.salePointOption[0].text
  320. }
  321. }
  322. }
  323. })
  324. }
  325. },
  326. bindCompany() {
  327. var vehicleType = this.orderForm.vehicleType;
  328. if (vehicleType && this.vehicleTypeCompanyList) {
  329. this.companyOption = [{
  330. text: this.$t('order.notSelected'),
  331. value: null
  332. }] //物料选项
  333. var companyInfos = this.vehicleTypeCompanyList.filter(function(company) {
  334. return company.vehicleType == vehicleType;
  335. });
  336. if (companyInfos && companyInfos.length > 0) {
  337. companyInfos[0].companyList.forEach(item => {
  338. this.companyOption.push({
  339. text: item.companyName,
  340. value: item.companyId
  341. })
  342. })
  343. this.orderForm.companyId = this.companyOption[1].value
  344. this.orderForm.companyName = this.companyOption[1].text
  345. }
  346. console.log("客户信息、", this.companyOption);
  347. }
  348. },
  349. bindMaterial() {
  350. var companyId = this.orderForm.companyId;
  351. this.materialOption = []
  352. this.orderForm.materialId = ''
  353. this.orderForm.materialName = ''
  354. this.paymentOption = {}
  355. if (companyId) {
  356. getMaterialsByCompany(this.orderForm).then(res => {
  357. if (res.data.code == 0) {
  358. this.paymentOption = res.data.hardInfo
  359. if (res.data.companyList) {
  360. res.data.companyList.forEach(item => {
  361. this.transporterOption.push({
  362. text: item.name,
  363. value: item.id
  364. })
  365. })
  366. }
  367. var materialInfos = res.data.data;
  368. console.log("1111213213", materialInfos);
  369. if (materialInfos && materialInfos.length > 0) {
  370. materialInfos.forEach(item => {
  371. this.materialOption.push({
  372. text: item.name,
  373. value: item.id,
  374. type: item.materTypeName ? item.materTypeName : '暂无分类',
  375. })
  376. })
  377. if (this.materialOption[1] && this.materialOption.length == 2) {
  378. this.orderForm.materialId = this.materialOption[1].value
  379. this.orderForm.materialName = this.materialOption[1].text
  380. }
  381. }
  382. console.log("品种信息、", this.materialOption);
  383. }
  384. })
  385. }
  386. },
  387. //
  388. bindTenant() {
  389. this.tenantOption = getTenantCacheList();
  390. if (this.tenantOption.length > 0) {
  391. this.orderForm.tenantId = this.tenantOption[0].value
  392. this.orderForm.tenantName = this.tenantOption[0].text
  393. }
  394. this.bindOption();
  395. },
  396. //提交订单
  397. submit(ref) {
  398. let _this = this
  399. console.log("提交的订单信息、", this.orderForm);
  400. if (!this.orderForm.vehicle) {
  401. uni.showToast({
  402. title: this.$t('base.common.placeholderI') + this.$t('order.vehicle'),
  403. icon: 'none',
  404. duration: 2000
  405. })
  406. return;
  407. }
  408. if (!this.orderForm.orderNumber || this.orderForm.orderNumber == '0') {
  409. uni.showToast({
  410. title: this.$t('base.common.placeholderI') + this.$t('order.orderNumber'),
  411. icon: 'none',
  412. duration: 2000
  413. })
  414. return;
  415. }
  416. this.$refs[ref].validate().then(() => {
  417. let data = JSON.parse(JSON.stringify(_this.orderForm))
  418. console.log("保存订单信息、", data);
  419. this.$refs.loadingToast.show({
  420. type: "loading",
  421. message: this.$t('base.common.loading'),
  422. duration: "1000000"
  423. })
  424. saveOrder(data).then(res => {
  425. this.$refs.loadingToast.hide()
  426. if (res.statusCode === 200) {
  427. uni.showModal({
  428. // title: '提示',
  429. content: this.$t("order.isContinueAddOrder"),
  430. showCancel: true,
  431. cancelText: this.$t("base.button.goBack"),
  432. confirmText: this.$t("base.button.continue"),
  433. success: function(res) {
  434. if (res.confirm) {
  435. _this.orderForm = {
  436. setDate: dayjs().format('YYYY-MM-DD'), //订单日期
  437. orderValidDate: dayjs().add(30, 'day').format('YYYY-MM-DD HH:mm:ss'), //有效日期
  438. orderType: '5', //订单类型
  439. companyId: '', //客商
  440. materialId: "", //物料
  441. orderNumber: "0", //数量
  442. vehicle: '', //车号
  443. driverId: '', //司机id\
  444. vehicleType: '101',
  445. xfFlag: '',
  446. phone: '',
  447. idcard: "",
  448. driver: '',
  449. tenantName: '',
  450. vehicleTypeName: '', //业务类型
  451. companyName: "", //客商
  452. materialName: "", //物料id
  453. orderTypeName: this.$t('order.planOrder'),
  454. transporterType: '101',
  455. transporterTypeName: this.$t('order.saleOrder'),
  456. transporterId: "",
  457. transporterName: "",
  458. sourceId: "", //第三方大订单ID
  459. remark: "",
  460. isIntima:"0",
  461. },
  462. console.log('用户点击确定');
  463. } else if (res.cancel) {
  464. console.log('用户点击取消');
  465. uni.redirectTo({
  466. url: '/subpages/order/dealerList?index=0'
  467. })
  468. }
  469. }
  470. })
  471. }
  472. })
  473. }).catch(err => {
  474. console.log('err', err);
  475. this.$refs.loadingToast.hide()
  476. })
  477. },
  478. formatOption(data) {
  479. let arr = []
  480. data.forEach(item => {
  481. arr.push({
  482. text: item.name || item.label,
  483. value: item.value || item.id
  484. })
  485. })
  486. if (arr.length) {
  487. arr.unshift({
  488. text: this.$t('order.notSelected'),
  489. value: null
  490. })
  491. } else {
  492. arr.unshift({
  493. text: this.$t('base.common.noData'),
  494. value: null
  495. })
  496. }
  497. return arr
  498. },
  499. //显示选择
  500. showPopup(refs) {
  501. this.$refs[refs].showPicker = true
  502. },
  503. //选择下单日期
  504. onSetDateConfirm(date) {
  505. this.orderForm.setDate = dayjs(date).format('YYYY-MM-DD');
  506. this.showSetDateCalendar = false;
  507. },
  508. //选择下单日期
  509. onEndDateConfirm(date) {
  510. this.orderForm.orderValidDate = dayjs(date.value).format('YYYY-MM-DD HH:mm:ss');
  511. this.showEndDateCalendar = false;
  512. },
  513. //选择订单类型
  514. onOrderTypeConfirm(value) {
  515. this.orderForm.orderType = ''
  516. this.orderForm.orderTypeName = ''
  517. if (value.value) {
  518. this.orderForm.orderType = value.value
  519. this.orderForm.orderTypeName = value.text
  520. }
  521. },
  522. //选择订单类型
  523. onVehicleTypeConfirm(value) {
  524. this.orderForm.vehicleType = value
  525. this.clear()
  526. this.bindCompany();
  527. this.bindMaterial();
  528. },
  529. //选择销售点类型
  530. onSalePointConfirm(value) {
  531. console.log("选择的销售点信息、", value);
  532. this.orderForm.salePoint = ''
  533. this.orderForm.salePointName = ''
  534. if (value.value) {
  535. this.orderForm.salePoint = value.value
  536. this.orderForm.salePointName = value.text
  537. }
  538. },
  539. //选择客户
  540. onCompanyConfirm(value) {
  541. this.orderForm.companyId = ''
  542. this.orderForm.companyName = ''
  543. if (value.value) {
  544. this.orderForm.companyId = value.value
  545. this.orderForm.companyName = value.text
  546. }
  547. this.bindMaterial();
  548. },
  549. onTransporterConfirm(value) {
  550. this.orderForm.transporterId = ''
  551. this.orderForm.transporterName = ''
  552. if (value.value) {
  553. this.orderForm.transporterId = value.value
  554. this.orderForm.transporterName = value.text
  555. }
  556. this.batchOrderList = []
  557. },
  558. onTransporterTypeConfirm(value) {
  559. console.log("选择的运输类型信息、", value);
  560. this.orderForm.transporterType = ''
  561. this.orderForm.transporterTypeName = ''
  562. if (value.value) {
  563. this.orderForm.transporterType = value.value
  564. this.orderForm.transporterTypeName = value.text
  565. }
  566. this.batchOrderList = []
  567. },
  568. //选择原料
  569. onProductConfirm(value) {
  570. console.log("选择的物料信息、", value);
  571. this.orderForm.materialId = ''
  572. this.orderForm.materialName = ''
  573. if (value.value) {
  574. this.orderForm.materialId = value.value
  575. this.orderForm.materialName = value.text
  576. }
  577. },
  578. //选择企业
  579. onTenantConfirm(value) {
  580. this.orderForm.tenantId = ''
  581. this.orderForm.tenantName = ''
  582. if (value.value) {
  583. this.orderForm.tenantId = value.value
  584. this.orderForm.tenantName = value.text
  585. }
  586. this.bindOption();
  587. },
  588. clear() {
  589. this.companyOption = [{
  590. text: this.$t('base.common.noData'),
  591. value: null
  592. }] //客户选项
  593. this.materialOption = [{
  594. text: this.$t('base.common.noData'),
  595. value: null
  596. }] //物料选项
  597. this.orderForm.companyId = ''
  598. this.orderForm.materialId = ''
  599. this.orderForm.companyName = ''
  600. this.orderForm.materialName = ''
  601. this.orderForm.orderNumber = '0';
  602. this.orderForm.driver = '';
  603. this.orderForm.driverId = '';
  604. this.orderForm.vehicle = '';
  605. },
  606. }
  607. }
  608. </script>
  609. <style lang="less" scoped>
  610. .order {
  611. padding: 32rpx;
  612. .picker-title {
  613. display: flex;
  614. padding: 0 32rpx;
  615. line-height: 84rpx;
  616. justify-content: space-between;
  617. .confirm {
  618. color: #4680F9;
  619. }
  620. }
  621. .picker-wrap {
  622. height: 440rpx;
  623. .picker-view {
  624. height: 100%;
  625. .item {
  626. display: flex;
  627. justify-content: space-between;
  628. height: 88rpx;
  629. line-height: 88rpx;
  630. padding: 0 32rpx;
  631. .text {
  632. width: 33%;
  633. }
  634. .text1 {
  635. width: 33%;
  636. text-align: center;
  637. }
  638. .text2 {
  639. width: 33%;
  640. text-align: right;
  641. }
  642. }
  643. .btn-item {
  644. display: flex;
  645. justify-content: center;
  646. height: 88rpx;
  647. line-height: 88rpx;
  648. padding: 0 32rpx;
  649. align-items: center;
  650. .add-vehicle {
  651. line-height: 64rpx;
  652. height: 64rpx;
  653. background: #4680F9;
  654. width: 25%;
  655. font-size: 28rpx;
  656. }
  657. }
  658. }
  659. }
  660. .form-wrap {
  661. height: 444rpx;
  662. padding: 0 32rpx;
  663. }
  664. }
  665. // button {
  666. // // background:linear-gradient(to right,#4680F9 0%,#00e2fa 80%,#00e2fa 100%);
  667. // background: #4680F9;
  668. // line-height: 100rpx;
  669. // color: #fff;
  670. // border: none;
  671. // }
  672. uni-button:after {
  673. border: none;
  674. }
  675. uni-input {
  676. height: 72rpx;
  677. padding: 0 10rpx 0 20rpx;
  678. }
  679. .uni-forms-item__inner {
  680. padding: 20rpx 0;
  681. }
  682. // /deep/ .u-button--primary {
  683. // background-color: #4680F9;
  684. // border-color: #4680F9;
  685. // }
  686. </style>