mixedOrderAdd.vue 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973
  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 v-if="orderForm.orderType == '2'">
  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. <!-- 业务类型 -->
  31. <!-- <u-form-item :label="$t('order.vehicleType')" borderBottom prop="vehicleType"
  32. @click="showPopup('popupVehicleType')">
  33. <u-input readonly v-model="orderForm.vehicleTypeName" border="none"
  34. :placeholder="$t('base.common.placeholderS')+$t('order.vehicleType')" />
  35. </u-form-item> -->
  36. <u-form-item :label="$t('order.vehicleType')" borderBottom prop="vehicleType">
  37. <u-radio-group v-model="orderForm.vehicleType" @change="onVehicleTypeConfirm" placement="row"
  38. class="p-input">
  39. <u-radio :customStyle="{marginRight: '10px'}" v-for="item in vehicleTypeOption"
  40. :key="item.value" :label="item.text" :name="item.value">
  41. </u-radio>
  42. </u-radio-group>
  43. </u-form-item>
  44. <template>
  45. <u-form-item :label="$t('order.companyName')" borderBottom prop="companyId"
  46. @click="showPopup('popupCompanyId')">
  47. <u-input readonly v-model="orderForm.companyName" border="none"
  48. :placeholder="$t('base.common.placeholderS')+$t('order.companyName')">
  49. <template slot="suffix">
  50. <view v-if="paymentOption && paymentOption=='1'"
  51. style="color: darkgreen;font-size: 9pt;">
  52. </view>
  53. </template>
  54. </u-input>
  55. </u-form-item>
  56. <view v-if="paymentOption && paymentOption.isShow=='1' && paymentOption.agentResponsible=='1'"
  57. style="display: flex;flex-direction:justify-content:flex-end;flex-direction: column;
  58. text-align: end;">
  59. <view style="color: red;font-size: 9pt;">
  60. {{$t('order.allTotal')}}:{{paymentOption.total}}
  61. </view>
  62. <view style="color: red;font-size: 9pt;">
  63. {{$t('order.waitTotal')}}:{{paymentOption.waitTotal}}
  64. </view>
  65. <view style="color: red;font-size: 9pt;">
  66. {{$t('order.source')}}:{{paymentOption.companyName}}
  67. </view>
  68. </view>
  69. </template>
  70. <u-form-item v-if="orderForm.orderType != '4'" u-form-item :label="$t('order.vehicle')" borderBottom
  71. prop="vehicle" @click="toSelectVehicle">
  72. <u--input readonly v-model="orderForm.vehicle" border="none"
  73. :placeholder="$t('base.common.placeholderS')+$t('order.vehicle')"></u--input>
  74. <u-icon slot="right" name="arrow-right"></u-icon>
  75. </u-form-item>
  76. <u-form-item :label="$t('order.remarks')" borderBottom prop="remarks">
  77. <u-input v-model="orderForm.remark" border="none"
  78. :placeholder="$t('base.common.placeholderI')+$t('order.remarks')" />
  79. </u-form-item>
  80. </u-form>
  81. <template v-if="materialList.length">
  82. <view class="material-content">
  83. <view v-for="(item, index) in materialList" :key="index" class="order-card">
  84. <view class="order-card-title">
  85. <text class="label">{{item.text}}</text>
  86. <u-tag :text="$t('base.button.delete')" plain shape="circle"
  87. @click="tableDelete(item)"></u-tag>
  88. </view>
  89. <view class="order-card-info">
  90. <u-input class="info" suffixIcon="edit-pen" border="none" v-model="item.orderNumber"
  91. :placeholder="$t('base.common.placeholderI')+$t('order.orderNumber')" type="digit" />
  92. </view>
  93. </view>
  94. </view>
  95. </template>
  96. <template v-else>
  97. <u-empty mode="list" :text="$t('base.common.placeholderI')+$t('order.mixedMaterial')"
  98. icon="https://cdn.uviewui.com/uview/empty/list.png">
  99. <u-button type="primary" size="small"
  100. :text="$t('base.common.placeholderI')+' '+$t('order.mixedMaterial')"
  101. @click="selectMater()"></u-button>
  102. </u-empty>
  103. </template>
  104. </view>
  105. <view class="bottom-content">
  106. <button class="bind-btn" @click="submit('form1')">{{$t('base.common.submit')}}
  107. </button>
  108. </view>
  109. <uni-fab v-if="materialList.length" ref="fab" buttonColor="#3c9cff" @fabClick="selectMater" />
  110. <u-toast ref="loadingToast"></u-toast>
  111. <CarKeyboard :show.sync="carKeyboardShow" :vehicleNo="orderForm.vehicle" @confirm="onKeyBoardConfirm"
  112. vehicleType="car"></CarKeyboard>
  113. <!-- 下单日期 -->
  114. <u-calendar color="#4680F9" round='25' :show="showSetDateCalendar" @confirm="onSetDateConfirm"
  115. @close="showSetDateCalendar=false"></u-calendar>
  116. <!-- 有效日期 -->
  117. <u-datetime-picker :show="showEndDateCalendar" v-model="defaultEndDate" :defaultDate="defaultEndDate"
  118. mode="datetime" @confirm="onEndDateConfirm" @close="showEndDateCalendar=false" />
  119. <!-- <u-calendar color="#4680F9" :defaultDate="defaultEndDate" :show="showEndDateCalendar"
  120. @confirm="onEndDateConfirm" @close="showEndDateCalendar=false" /> -->
  121. <!-- 临时或固定 -->
  122. <PopupSelect ref="popupOrderType" :option="orderTypeOption" @onConfirm="onOrderTypeConfirm" />
  123. <!-- 业务类型 -->
  124. <!-- <PopupSelect ref="popupVehicleType" :option="vehicleTypeOption" @onConfirm="onVehicleTypeConfirm" /> -->
  125. <!-- 客户 -->
  126. <PopupSelect ref="popupCompanyId" :hasSearch='false' :option="companyOption" @onConfirm="onCompanyConfirm" />
  127. <!-- 原料 -->
  128. <PopupSelect ref="popupmaterialId" kind="m" :hasSearch='false' :option="materialOption"
  129. @onConfirm="onProductConfirm" />
  130. <!-- 企业选项 -->
  131. <PopupSelect ref="popupTenantId" :hasSearch='false' :option="tenantOption" @onConfirm="onTenantConfirm" />
  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. getOrderType,
  141. } from '../../utils/util.js'
  142. import {
  143. saveMixedOrder,
  144. getOption,
  145. getMaterialsByCompany
  146. } from '../../api/order'
  147. export default {
  148. components: {
  149. CarKeyboard,
  150. PopupSelect
  151. },
  152. data() {
  153. return {
  154. carKeyboardShow: false,
  155. start: dayjs().format('YYYY-MM-DD'),
  156. orderForm: {
  157. kind: "",
  158. setDate: dayjs().format('YYYY-MM-DD'), //订单日期
  159. orderValidDate: dayjs().add(30, 'day').format('YYYY-MM-DD HH:mm:ss'), //有效日期
  160. tenantId: '', //企业
  161. orderType: '1', //订单类型
  162. companyId: '', //客商
  163. orderNumber: "",
  164. materialId: "",
  165. vehicle: '', //车号
  166. driverId: '', //司机id\
  167. vehicleType: '101',
  168. xfFlag: '',
  169. phone: '',
  170. idcard: "",
  171. driver: '',
  172. tenantName: '',
  173. vehicleTypeName: '', //业务类型
  174. companyName: "", //客商
  175. materialName: "", //物料id
  176. orderTypeName: this.$t('order.tempOrder'),
  177. sourceId: "", //第三方大订单ID
  178. remark: "",
  179. },
  180. materialList: [],
  181. rules: {
  182. orderType: [{
  183. required: true,
  184. message: this.$t('base.common.placeholderS') + this.$t('order.orderType')
  185. }],
  186. vehicleType: [{
  187. required: true,
  188. message: this.$t('base.common.placeholderS') + this.$t('order.vehicleType')
  189. }],
  190. tenantId: [{
  191. required: true,
  192. message: this.$t('base.common.placeholderS') + this.$t('order.enterprise')
  193. }],
  194. companyId: [{
  195. required: true,
  196. message: this.$t('base.common.placeholderS') + this.$t('order.companyName')
  197. }],
  198. materialId: [{
  199. required: true,
  200. message: this.$t('base.common.placeholderS') + this.$t('order.materialName')
  201. }],
  202. orderNumber: [{
  203. required: true,
  204. message: this.$t('base.common.placeholderI') + this.$t('order.orderNumber')
  205. }]
  206. },
  207. vehicleTypeOption: [{
  208. text: this.$t('base.common.noData'),
  209. value: null
  210. }, ],
  211. orderTypeOption: [{
  212. text: this.$t("order.tempOrder"),
  213. isShow: true,
  214. value: '1',
  215. index: 1,
  216. key: "add_temp_order",
  217. }, ],
  218. paymentOption: {},
  219. //产品选项
  220. materialOption: [{
  221. text: this.$t('base.common.noData'),
  222. value: null,
  223. }], //物料选项
  224. //客户选项
  225. companyOption: [{
  226. text: this.$t('base.common.noData'),
  227. compvalueanyId: null
  228. }], //供应商选项
  229. // vehicleOption:[{vehicle:this.$t('base.common.noData'),value:null}], //司机选项
  230. tenantOption: [{
  231. text: this.$t('base.common.noData'),
  232. value: null
  233. }], //企业选项
  234. showSetDateCalendar: false,
  235. showEndDateCalendar: false,
  236. defaultEndDate: dayjs().add(30, 'day').format('YYYY-MM-DD HH:mm:ss'), //默认有效日期
  237. //业务对应的客户信息
  238. vehicleTypeCompanyList: [],
  239. //客户对应的物料信息
  240. companyMaterialList: [],
  241. }
  242. },
  243. onLoad(options) {
  244. this.bindTenant()
  245. this.orderTypeOption = getOrderType(this.orderTypeOption);
  246. console.log("允许操作的订单类型、", this.orderTypeOption);
  247. },
  248. methods: {
  249. tableDelete(material) {
  250. let index = this.materialList.findIndex(item => {
  251. if (item.value == material.value) {
  252. return true
  253. }
  254. })
  255. this.materialList.splice(index, 1)
  256. },
  257. //选择品种
  258. selectMater() {
  259. var packMaterialOption = this.materialOption.filter((p) => {
  260. return p.kind == '101'
  261. });
  262. console.log("解析后的物料信息、", this.materialOption.length, packMaterialOption);
  263. uni.navigateTo({
  264. url: `/subpages/order/materMultipleSelect?option=${JSON.stringify(packMaterialOption)}&selectedOption=${JSON.stringify(this.materialList)}`
  265. })
  266. },
  267. //去选择司机
  268. toSelectVehicle() {
  269. uni.navigateTo({
  270. url: '/subpages/order/vehicle'
  271. })
  272. },
  273. //车号键盘输出
  274. onKeyBoardConfirm(id) {
  275. this.orderForm.vehicle = id
  276. },
  277. //显示车牌键盘
  278. carKeyboardOut() {
  279. this.carKeyboardShow = true
  280. },
  281. //选择订单类型后加载选项 //获取品种信息 101:销售,102:采购
  282. bindOption() {
  283. this.clear(true);
  284. console.log("订单租户信息、", this.orderForm.tenantId);
  285. if (!this.orderForm.tenantId) {
  286. console.log("订单业务租户信息");
  287. return;
  288. }
  289. var that = this;
  290. console.log("当前租户ID、", that.orderForm.tenantId);
  291. if (that.orderForm.tenantId) {
  292. let data = JSON.parse(JSON.stringify(that.orderForm))
  293. getOption(data).then(res => {
  294. console.log("查询基础数据返回、", res);
  295. if (res.statusCode === 200) {
  296. console.log("用户业务类型、", res.data.data.appVehicleType)
  297. console.log("用户客户信息、", res.data.data.appCompany)
  298. console.log("用户品种信息、", res.data.data.appMaterial)
  299. that.vehicleTypeOption = [{
  300. value: '101',
  301. text: this.$t("order.saleBusiness")
  302. }]
  303. if (that.vehicleTypeOption && that.vehicleTypeOption.length > 0) {
  304. that.orderForm.vehicleType = that.vehicleTypeOption[0].value
  305. that.vehicleTypeCompanyList = res.data.data.appCompany
  306. that.bindCompany();
  307. that.bindMaterial();
  308. }
  309. }
  310. })
  311. }
  312. },
  313. bindCompany() {
  314. var vehicleType = this.orderForm.vehicleType;
  315. if (vehicleType && this.vehicleTypeCompanyList) {
  316. this.companyOption = [{
  317. text: this.$t('order.notSelected'),
  318. value: null
  319. }] //物料选项
  320. var companyInfos = this.vehicleTypeCompanyList.filter(function(company) {
  321. return company.vehicleType == vehicleType;
  322. });
  323. if (companyInfos && companyInfos.length > 0) {
  324. companyInfos[0].companyList.forEach(item => {
  325. this.companyOption.push({
  326. text: item.companyName,
  327. value: item.companyId
  328. })
  329. })
  330. this.orderForm.companyId = this.companyOption[1].value
  331. this.orderForm.companyName = this.companyOption[1].text
  332. }
  333. console.log("客户信息、", this.companyOption);
  334. }
  335. },
  336. bindMaterial() {
  337. var companyId = this.orderForm.companyId;
  338. this.materialOption = []
  339. this.orderForm.materialId = ''
  340. this.orderForm.materialName = ''
  341. this.paymentOption = {}
  342. if (companyId) {
  343. getMaterialsByCompany(this.orderForm).then(res => {
  344. if (res.data.code == 0) {
  345. this.paymentOption = res.data.hardInfo
  346. // this.materialOption = [{
  347. // text: this.$t('order.notSelected'),
  348. // value: null
  349. // }] //物料选项
  350. var materialInfos = res.data.data;
  351. console.log("1111213213", materialInfos);
  352. if (materialInfos && materialInfos.length > 0) {
  353. materialInfos.forEach(item => {
  354. this.materialOption.push({
  355. text: item.name,
  356. value: item.id,
  357. type: item.materTypeName ? item.materTypeName : '暂无分类',
  358. kind: item.kind
  359. })
  360. })
  361. if (this.materialOption[1] && this.materialOption.length == 2) {
  362. this.orderForm.materialId = this.materialOption[1].value
  363. this.orderForm.materialName = this.materialOption[1].text
  364. this.orderForm.kind = this.materialOption[1].kind
  365. }
  366. }
  367. console.log("品种信息、", this.materialOption);
  368. }
  369. })
  370. }
  371. },
  372. //
  373. bindTenant() {
  374. this.tenantOption = getTenantCacheList();
  375. if (this.tenantOption.length > 0) {
  376. this.orderForm.tenantId = this.tenantOption[0].value
  377. this.orderForm.tenantName = this.tenantOption[0].text
  378. }
  379. this.bindOption();
  380. },
  381. //提交订单
  382. submit(ref) {
  383. let _this = this
  384. console.log("提交的订单信息、混装信息、", this.orderForm, this.materialList);
  385. if (!this.orderForm.vehicle) {
  386. uni.showToast({
  387. title: this.$t('base.common.placeholderI') + this.$t('order.vehicle'),
  388. icon: 'none',
  389. duration: 2000
  390. })
  391. return;
  392. }
  393. if (!this.orderForm.companyId) {
  394. uni.showToast({
  395. title: this.$t('base.common.placeholderI') + this.$t('order.companyName'),
  396. icon: 'none',
  397. duration: 2000
  398. })
  399. return;
  400. }
  401. if (!this.materialList || this.materialList.length == 0) {
  402. uni.showToast({
  403. title: this.$t('base.common.placeholderS') + this.$t('order.materialName'),
  404. icon: 'none',
  405. duration: 2000
  406. })
  407. return;
  408. }
  409. var index = this.materialList.findIndex(p => {
  410. return !p.orderNumber
  411. });
  412. if (index > -1) {
  413. uni.showToast({
  414. title: '【' + (index + 1) + '】' + this.$t('base.common.placeholderI') + this.$t(
  415. 'order.orderNumber'),
  416. icon: 'none',
  417. duration: 2000
  418. })
  419. return;
  420. }
  421. this.$refs[ref].validate().then(() => {
  422. this.$refs.loadingToast.show({
  423. type: "loading",
  424. message: this.$t('base.common.loading'),
  425. duration: "1000000"
  426. })
  427. var dataList = [];
  428. this.materialList.forEach(p => {
  429. let data = JSON.parse(JSON.stringify(_this.orderForm))
  430. data.materialId = p.value
  431. data.orderNumber = p.orderNumber
  432. dataList.push(data);
  433. });
  434. console.log("提交的订单信息、", dataList);
  435. saveMixedOrder(dataList).then(res => {
  436. this.$refs.loadingToast.hide()
  437. if (res.statusCode === 200) {
  438. uni.showModal({
  439. // title: '提示',
  440. content: this.$t("order.isContinueAddOrder"),
  441. showCancel: true,
  442. cancelText: this.$t("base.button.goBack"),
  443. confirmText: this.$t("base.button.continue"),
  444. success: function(res) {
  445. if (res.confirm) {
  446. _this.orderForm = {
  447. setDate: dayjs().format('YYYY-MM-DD'), //订单日期
  448. orderValidDate: dayjs().add(30, 'day').format(
  449. 'YYYY-MM-DD HH:mm:ss'), //有效日期
  450. vehicleType: '101', //订单类型
  451. vehicleTypeName: '', //业务类型
  452. companyId: '', //客商
  453. materialId: "", //物料
  454. orderNumber: "0", //数量
  455. vehicle: '', //车号
  456. driverId: '', //司机id\
  457. orderType: '1',
  458. orderTypeName: '临时订单',
  459. phone: '',
  460. idcard: "",
  461. driver: '',
  462. companyName: "", //客商
  463. materialName: "", //物料id
  464. },
  465. console.log('用户点击确定');
  466. } else if (res.cancel) {
  467. console.log('用户点击取消');
  468. uni.redirectTo({
  469. url: '/subpages/order/dealerList?index=0'
  470. })
  471. }
  472. }
  473. })
  474. }
  475. })
  476. }).catch(err => {
  477. console.log('err', err);
  478. this.$refs.loadingToast.hide()
  479. })
  480. },
  481. formatOption(data) {
  482. let arr = []
  483. data.forEach(item => {
  484. arr.push({
  485. text: item.name || item.label,
  486. value: item.value || item.id
  487. })
  488. })
  489. if (arr.length) {
  490. arr.unshift({
  491. text: this.$t('order.notSelected'),
  492. value: null
  493. })
  494. } else {
  495. arr.unshift({
  496. text: this.$t('base.common.noData'),
  497. value: null
  498. })
  499. }
  500. return arr
  501. },
  502. //显示选择
  503. showPopup(refs) {
  504. this.$refs[refs].showPicker = true
  505. },
  506. //选择下单日期
  507. onSetDateConfirm(date) {
  508. this.orderForm.setDate = dayjs(date).format('YYYY-MM-DD');
  509. this.showSetDateCalendar = false;
  510. },
  511. //选择下单日期
  512. onEndDateConfirm(date) {
  513. this.orderForm.orderValidDate = dayjs(date.value).format('YYYY-MM-DD HH:mm:ss');
  514. this.showEndDateCalendar = false;
  515. },
  516. //选择订单类型
  517. onOrderTypeConfirm(value) {
  518. this.orderForm.orderType = ''
  519. this.orderForm.orderTypeName = ''
  520. if (value.value) {
  521. this.orderForm.orderType = value.value
  522. this.orderForm.orderTypeName = value.text
  523. }
  524. },
  525. //选择订单类型
  526. onVehicleTypeConfirm(value) {
  527. this.orderForm.vehicleType = value
  528. this.clear(false)
  529. this.bindCompany();
  530. this.bindMaterial();
  531. },
  532. //选择客户
  533. onCompanyConfirm(value) {
  534. this.orderForm.companyId = ''
  535. this.orderForm.companyName = ''
  536. if (value.value) {
  537. this.orderForm.companyId = value.value
  538. this.orderForm.companyName = value.text
  539. }
  540. this.bindMaterial();
  541. },
  542. //选择原料
  543. onProductConfirm(value) {
  544. console.log("选择的物料信息、", value);
  545. this.orderForm.materialId = ''
  546. this.orderForm.materialName = ''
  547. if (value.value) {
  548. this.orderForm.materialId = value.value
  549. this.orderForm.materialName = value.text
  550. }
  551. },
  552. //选择企业
  553. onTenantConfirm(value) {
  554. this.orderForm.tenantId = ''
  555. this.orderForm.tenantName = ''
  556. if (value.value) {
  557. this.orderForm.tenantId = value.value
  558. this.orderForm.tenantName = value.text
  559. }
  560. this.bindOption();
  561. },
  562. clear(isVehicleType) {
  563. if (isVehicleType == true) {
  564. this.vehicleTypeOption = [{
  565. text: this.$t('base.common.noData'),
  566. value: null
  567. }]
  568. this.orderForm.vehicleType = ''
  569. }
  570. this.companyOption = [{
  571. text: this.$t('base.common.noData'),
  572. value: null
  573. }] //客户选项
  574. this.materialOption = [{
  575. text: this.$t('base.common.noData'),
  576. value: null
  577. }] //物料选项
  578. this.orderForm.companyId = ''
  579. this.orderForm.materialId = ''
  580. this.orderForm.companyName = ''
  581. this.orderForm.materialName = ''
  582. this.orderForm.orderNumber = '0';
  583. this.orderForm.driver = '';
  584. this.orderForm.driverId = '';
  585. this.orderForm.vehicle = '';
  586. },
  587. }
  588. }
  589. </script>
  590. <style lang="less" scoped>
  591. .order {
  592. padding: 32rpx;
  593. .picker-title {
  594. display: flex;
  595. padding: 0 32rpx;
  596. line-height: 84rpx;
  597. justify-content: space-between;
  598. .confirm {
  599. color: #4680F9;
  600. }
  601. }
  602. .picker-wrap {
  603. height: 440rpx;
  604. .picker-view {
  605. height: 100%;
  606. .item {
  607. display: flex;
  608. justify-content: space-between;
  609. height: 88rpx;
  610. line-height: 88rpx;
  611. padding: 0 32rpx;
  612. .text {
  613. width: 33%;
  614. }
  615. .text1 {
  616. width: 33%;
  617. text-align: center;
  618. }
  619. .text2 {
  620. width: 33%;
  621. text-align: right;
  622. }
  623. }
  624. .btn-item {
  625. display: flex;
  626. justify-content: center;
  627. height: 88rpx;
  628. line-height: 88rpx;
  629. padding: 0 32rpx;
  630. align-items: center;
  631. .add-vehicle {
  632. line-height: 64rpx;
  633. height: 64rpx;
  634. background: #4680F9;
  635. width: 25%;
  636. font-size: 28rpx;
  637. }
  638. }
  639. }
  640. }
  641. .form-wrap {
  642. height: 444rpx;
  643. padding: 0 32rpx;
  644. }
  645. }
  646. .order-card {
  647. background-size: 100% 100%;
  648. background-color: #fff;
  649. overflow: hidden;
  650. margin: 12rpx 12rpx 0;
  651. padding: 8rpx 12rpx;
  652. z-index: 50;
  653. border: 3px solid #eaebec;
  654. .order-card-title {
  655. display: flex;
  656. justify-content: left;
  657. align-items: center;
  658. padding: 0 0 16rpx;
  659. line-height: 80rpx;
  660. font-size: 28rpx;
  661. font-weight: bold;
  662. color: #222;
  663. position: relative;
  664. flex-direction: row;
  665. justify-content: space-between;
  666. .orderStatus-info {
  667. position: absolute;
  668. right: 0;
  669. padding-right: 10px;
  670. .iconImg {
  671. width: 100rpx;
  672. height: 88rpx;
  673. margin-top: 15rpx;
  674. }
  675. .iconImg2 {
  676. width: 100rpx;
  677. height: 100rpx;
  678. margin-top: 15rpx;
  679. }
  680. .iconImg1 {
  681. width: 130rpx;
  682. height: 80rpx;
  683. margin-top: 20rpx;
  684. }
  685. }
  686. .type {
  687. height: 80rpx;
  688. color: #3275F5;
  689. line-height: 80rpx;
  690. padding: 0 14rpx;
  691. background-color: #E8F6FF;
  692. margin-right: 36rpx;
  693. }
  694. .out-type {
  695. height: 50rpx;
  696. color: #fa3534;
  697. line-height: 50rpx;
  698. padding: 0 20rpx;
  699. border-radius: 50rpx;
  700. background-color: #fab6b64a;
  701. margin-right: 78rpx;
  702. font-size: 24rpx;
  703. }
  704. .fixed {
  705. color: red;
  706. }
  707. .info {
  708. color: #111111;
  709. flex: 1;
  710. }
  711. .status {
  712. position: absolute;
  713. top: 0;
  714. right: 0;
  715. background: #3275F5;
  716. width: 200rpx;
  717. text-align: center;
  718. line-height: 42rpx;
  719. height: 42rpx;
  720. color: #FEFEFE;
  721. transform: rotate(45deg) translate3d(65rpx, -56rpx, 0);
  722. font-size: 24rpx;
  723. font-weight: normal;
  724. }
  725. .bad-status {
  726. background: #CCCCCC;
  727. color: #FEFEFE;
  728. }
  729. }
  730. .order-card-info {
  731. position: relative;
  732. background-color: #f5f7fa;
  733. font-size: 28rpx;
  734. line-height: 56rpx;
  735. padding: 30rpx 40rpx;
  736. color: #222;
  737. position: relative;
  738. background-size: 100% 100%;
  739. .order-type {
  740. position: absolute;
  741. right: 10px;
  742. top: 5px;
  743. }
  744. .cell {
  745. width: 100%;
  746. overflow: hidden;
  747. text-overflow: ellipsis;
  748. white-space: nowrap;
  749. display: flex;
  750. .label {
  751. // width: 80rpx;
  752. font-weight: bold;
  753. margin-right: 20rpx;
  754. }
  755. .right {
  756. padding-right: 20px;
  757. }
  758. .info {
  759. font-size: 24rpx;
  760. }
  761. .used {
  762. color: #e22f61;
  763. }
  764. .green {
  765. font-size: 30rpx;
  766. color: green;
  767. }
  768. }
  769. .row {
  770. font-size: 24rpx;
  771. line-height: 54rpx;
  772. display: flex;
  773. flex-direction: row;
  774. .cell {
  775. flex: 1;
  776. }
  777. }
  778. .qrcode-logo {
  779. position: absolute;
  780. width: 128rpx;
  781. height: 128rpx;
  782. bottom: 24rpx;
  783. right: 24rpx;
  784. .img {
  785. width: 100%;
  786. height: 100%;
  787. }
  788. }
  789. }
  790. .code {
  791. display: flex;
  792. flex-direction: row;
  793. line-height: 40rpx;
  794. padding: 20rpx 0;
  795. .label {
  796. font-size: 26rpx;
  797. color: #999;
  798. margin-right: 36rpx;
  799. }
  800. .info {
  801. flex: 1;
  802. font-size: 22rpx;
  803. color: #222;
  804. }
  805. }
  806. .order-card-bottom {
  807. display: flex;
  808. flex-direction: row;
  809. justify-content: flex-end;
  810. padding: 20rpx 0 4rpx;
  811. border-top: solid 1px #f5f7fa;
  812. .btn {
  813. margin-left: 28rpx;
  814. .oper-btn {
  815. margin: 0;
  816. width: 152rpx;
  817. height: 52rpx;
  818. line-height: 48rpx;
  819. background: #fff;
  820. color: #222;
  821. border: 2rpx solid #ccc;
  822. }
  823. }
  824. }
  825. .order-card-bottom-sides {
  826. display: flex;
  827. flex-direction: row;
  828. justify-content: space-between;
  829. padding: 10rpx;
  830. border-top: solid 1px #6a6a6a;
  831. background: linear-gradient(to right, #c1c1c1, #e7efef);
  832. .btn {
  833. width: 20%;
  834. margin-left: 28rpx;
  835. }
  836. }
  837. .card-oper {
  838. background-color: #fff;
  839. display: flex;
  840. flex-direction: row;
  841. justify-content: flex-end;
  842. padding: 24rpx;
  843. .btn {
  844. width: 25%;
  845. margin-left: 32rpx;
  846. }
  847. }
  848. }
  849. .bottom-content {
  850. position: fixed;
  851. bottom: 10px;
  852. display: flex;
  853. align-items: center;
  854. line-height: 60rpx;
  855. width: 100%;
  856. justify-content: center;
  857. }
  858. .material-content {
  859. padding-bottom: 190rpx;
  860. }
  861. .bind-btn {
  862. width: 50%;
  863. }
  864. // button {
  865. // // background:linear-gradient(to right,#4680F9 0%,#00e2fa 80%,#00e2fa 100%);
  866. // background: #4680F9;
  867. // line-height: 100rpx;
  868. // color: #fff;
  869. // border: none;
  870. // }
  871. uni-button:after {
  872. border: none;
  873. }
  874. uni-input {
  875. height: 72rpx;
  876. padding: 0 10rpx 0 20rpx;
  877. }
  878. .uni-forms-item__inner {
  879. padding: 20rpx 0;
  880. }
  881. // /deep/ .u-button--primary {
  882. // background-color: #4680F9;
  883. // border-color: #4680F9;
  884. // }
  885. </style>