newlyAdded.vue 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805
  1. <template>
  2. <view>
  3. <view class="ordertop">
  4. <view>
  5. <view class="iconblue"></view>
  6. <text class="license">基础信息</text>
  7. </view>
  8. <view class="line">
  9. <u-line color="#ccc" border-style='dashed' />
  10. </view>
  11. <u-form :model="form" :rules="rules" ref="uForm" :errorType="errorType">
  12. <view class="basic" style="margin: 0 auto;height: 55rpx;">
  13. <u-form-item style="width: 100%;" :border-bottom="false" label-width="150rpx" label="出库日期:" prop="fBsdate"
  14. required>
  15. <u-input type="type" :clearable="false" placeholder="请选择出库日期" v-model="form.fBsdate" disabled @click="shOw = !shOw" />
  16. <u-calendar v-model="shOw" mode="date" @change="bsdate"></u-calendar>
  17. </u-form-item>
  18. </view>
  19. <view class="basic" style="margin: 0 auto;height: 55rpx;">
  20. <u-form-item style="width: 100%;" :border-bottom="false" label-width="100rpx" label="品名:" prop="fGoodsid" required>
  21. <u-input type="type" :clearable="false" placeholder="请选品名" v-model="fGoodsid" disabled @click="goods = !goods" />
  22. <u-select v-model="goods" @confirm="confiRm" :list="good_s" label-name="fName" value-name="fId">
  23. </u-select>
  24. </u-form-item>
  25. </view>
  26. <view class="basic" style="margin: 0 auto;height: 55rpx;">
  27. <u-form-item style="width: 100%;" :border-bottom="false" label-width="150rpx" label="货物属性:" prop="fBusinessType"
  28. disabled>
  29. <u-input type="type" :clearable="false" placeholder="请选择货物属性" v-model="fBusinessType" disabled @click="iness = !iness" />
  30. <!-- <u-select v-model="iness" @confirm="business" :list="fBusiness" label-name="dictLabel" value-name="dictSort" /> -->
  31. </u-form-item>
  32. </view>
  33. <view class="basic" style="margin: 0 auto;height: 55rpx;">
  34. <u-form-item style="width: 100%;" :border-bottom="false" label-width="150rpx" label="属性详情:" prop="fMarks">
  35. <u-input type="type" :clearable="false" placeholder="请输入属性详情" v-model="form.fMarks" disabled />
  36. </u-form-item>
  37. </view>
  38. <view class="basic" style="margin: 0 auto;height: 55rpx;">
  39. <u-form-item style="width: 100%;" :border-bottom="false" label-width="100rpx" label="库区:" prop="fWarehouseInformation">
  40. <!-- <u-select v-model="fQty" mode="mutil-column-auto" :list="list" @confirm="confirm" label-name="label" value-name="id" child-name="children"></u-select> -->
  41. <u-input type="type" :clearable="false" placeholder="请选库区" v-model="fWarehouseInformation" disabled @click="fQty = !fQty" />
  42. </u-form-item>
  43. </view>
  44. <view class="basic" style="margin: 0 auto;height: 55rpx;">
  45. <u-form-item style="width: 100%;" :border-bottom="false" label-width="100rpx" label="件数:" prop="fQty" required>
  46. <u-input type="digit" :clearable="false" placeholder="请输入件数" v-model="form.fQty" @input="calculation" />
  47. </u-form-item>
  48. </view>
  49. <view class="basic" style="margin: 0 auto;height: 55rpx;">
  50. <u-form-item style="width: 100%;" :border-bottom="false" label-width="100rpx" label="毛重:" prop="fGrossweight"
  51. required>
  52. <u-input type="digit" :clearable="false" placeholder="请输入毛重" v-model="form.fGrossweight" />
  53. </u-form-item>
  54. </view>
  55. <view class="basic" style="margin: 0 auto;height: 55rpx;">
  56. <u-form-item style="width: 100%;" :border-bottom="false" label-width="100rpx" label="净重:" prop="fNetweight"
  57. required>
  58. <u-input type="digit" :clearable="false" placeholder="请输入净重" v-model="form.fNetweight" />
  59. </u-form-item>
  60. </view>
  61. <view class="basic" style="margin: 0 auto;height: 55rpx;">
  62. <u-form-item style="width: 100%;" :border-bottom="false" label-width="100rpx" label="车号:" prop="fTruckno" required>
  63. <u-input type="type" :clearable="false" placeholder="请输入车号" v-model="form.fTruckno" />
  64. </u-form-item>
  65. </view>
  66. <view class="basic" style="margin: 0 auto;height: 55rpx;">
  67. <u-form-item style="width: 100%;" :border-bottom="false" label-width="100rpx" label="车队:" prop="fFleet">
  68. <u-input type="type" :clearable="false" placeholder="请选车队" v-model="fFleet" disabled @click="fEleet = !fEleet" />
  69. <u-select v-model="fEleet" @confirm="confiEm" :list="fleEt" label-name="fName" value-name="fId">
  70. </u-select>
  71. </u-form-item>
  72. </view>
  73. <view class="basic" style="margin: 0 auto;height: 55rpx;">
  74. <u-form-item style="width: 100%;" :border-bottom="false" label-width="100rpx" label="箱号:" prop="fCntrno">
  75. <u-input type="type" :clearable="false" placeholder="请输入箱号" v-model="form.fCntrno" disabled />
  76. </u-form-item>
  77. </view>
  78. <view class="basic" style="margin: 0 auto;height: 55rpx;">
  79. <u-form-item style="width: 100%;" :border-bottom="false" label-width="100rpx" label="箱型:" prop="fcntrtype">
  80. <u-input type="type" :clearable="false" placeholder="请输入箱型" v-model="fcntrtype" disabled @click="rtype = !rtype" />
  81. <u-select v-model="rtype" @confirm="fcntrtPe" :list="fcnt" label-name="fName" value-name="fId"></u-select>
  82. </u-form-item>
  83. </view>
  84. <view class="basic" style="margin: 0 auto;height: 55rpx;">
  85. <u-form-item style="width: 100%;" :border-bottom="false" label-width="100rpx" label="箱量:" prop="fCntqty">
  86. <u-input type="digit" :clearable="false" placeholder="请输入箱量" v-model="form.fCntqty" />
  87. </u-form-item>
  88. </view>
  89. <view class="basic" style="margin: 0 auto;height: 55rpx;">
  90. <u-form-item style="width: 100%;" :border-bottom="false" label-width="150rpx" label="劳务公司:" prop="labour">
  91. <u-input type="type" :clearable="false" placeholder="请选择劳务公司" v-model="labour" disabled @click="laBour = !laBour" />
  92. <u-select v-model="laBour" @confirm="confiLm" :list="laboUr" label-name="fName" value-name="fId">
  93. </u-select>
  94. </u-form-item>
  95. </view>
  96. <view class="basic" style="margin: 0 auto;height: 55rpx;">
  97. <u-form-item style="width: 100%;" :border-bottom="false" label-width="130rpx" label="装卸工:" prop="fStevedore">
  98. <u-input type="type" :clearable="false" placeholder="请输入装卸工" v-model="form.fStevedore" />
  99. </u-form-item>
  100. </view>
  101. <view class="basic" style="margin: 0 auto;height: 55rpx;">
  102. <u-form-item style="width: 100%;" :border-bottom="false" label-width="130rpx" label="提单号:" prop="fOriginalbillno">
  103. <u-input type="type" :clearable="false" placeholder="请输入提单号" v-model="form.fOriginalbillno" disabled />
  104. </u-form-item>
  105. </view>
  106. <view class="basic" style="margin: 0 auto;height: 55rpx;">
  107. <u-form-item style="width: 100%;" :border-bottom="false" label-width="100rpx" label="司机:" prop="fDriverName">
  108. <u-input type="type" :clearable="false" placeholder="请输入司机" v-model="form.fDriverName" />
  109. </u-form-item>
  110. </view>
  111. <view class="basic" style="margin: 0 auto;">
  112. <u-form-item style="width: 100%;" :border-bottom="false" label-width="100rpx" label="备注:">
  113. <u-input type="textarea" height="20rpx" placeholder="请输入备注" :clearable="false" v-model="form.remark" />
  114. </u-form-item>
  115. </view>
  116. </u-form>
  117. </view>
  118. <view class="ordertop" style="margin-bottom: 60rpx;">
  119. <view>
  120. <view class="iconblue"></view>
  121. <text class="license">附件上传</text>
  122. <!-- <view class="various" @click="attachmentP">保存附件</view> -->
  123. </view>
  124. <view class="line">
  125. <u-line color="#ccc" border-style='dashed' />
  126. </view>
  127. <view style="width: 94%;margin: 0 auto;">
  128. <u-upload ref="uUpload" :deletable="false" :action="action" :header="headers" @on-success="success" :file-list="fileList">
  129. </u-upload>
  130. </view>
  131. </view>
  132. <br>
  133. <view style="width: 100%;position:fixed; bottom:0;background-color: #FFFFFF;padding-left: 20px;padding-right: 20px;">
  134. <u-button type="primary" @click="appCheckCode">提交保存</u-button>
  135. </view>
  136. <u-modal v-model="submIt" @confirm="submit" :content="content" @cancel="submIt = false" :show-cancel-button="true" />
  137. <u-modal v-model="CheckStatus" @confirm="goBack" :content="content2" @cancel="CheckStatus = false"
  138. :show-cancel-button="true" />
  139. <u-popup v-model="popup" close-icon-pos="top-left" width="100%" mode='left' :mask-close-able="false">
  140. <!-- #ifdef H5 -->
  141. <u-navbar title="导入库存总账" :background="background" title-color="#fff" back-icon-color="#fff"></u-navbar>
  142. <!-- #endif -->
  143. <view style="width: 98%;box-shadow: 0px 0px 8px 0px rgb(165 189 251 / 40%);margin: 0 auto;margin-top: 20rpx;padding: 10px;"
  144. v-for="(item,index) in datalisi" :key="index">
  145. <view style="width: 99%;margin: 0 auto;margin-bottom: 20rpx;">
  146. <view>
  147. <span>提单号:{{item.fMblno}}</span>
  148. <u-checkbox-group style="float: right;margin-right: -30rpx;background-color: ;">
  149. <span style="width: 70rpx;">
  150. {{item.checked == false?'选择':'取消'}}
  151. </span>
  152. <u-checkbox max="1" v-model="item.checked" :disabled="item.disabled" @change="checkboxChange" active-color="#5677FC"
  153. :name="item.fId"></u-checkbox>
  154. </u-checkbox-group>
  155. </view>
  156. <view class="line">
  157. <u-line color="#ccc" border-style='dashed' />
  158. </view>
  159. <view class="basIc">
  160. <view>出库日期</view>
  161. <view>{{item.createTime}}</view>
  162. </view>
  163. <view class="basIc">
  164. <view>品名</view>
  165. <view>{{item.fGoodsids}}</view>
  166. </view>
  167. <view class="basIc">
  168. <view>箱号</view>
  169. <view>{{item.fCntrno}}</view>
  170. </view>
  171. <view class="basIc">
  172. <view>结余数量</view>
  173. <view>{{item.fQtyblc}}</view>
  174. </view>
  175. <view class="basIc">
  176. <view>毛重</view>
  177. <view>{{item.fGrossweightblc}}</view>
  178. </view>
  179. <view class="basIc">
  180. <view>净重</view>
  181. <view>{{item.fNetweightblc}}</view>
  182. </view>
  183. <view class="basIc">
  184. <view>库位</view>
  185. <view>{{item.fWarehouseids}}</view>
  186. </view>
  187. <view class="basIc">
  188. <view>品牌</view>
  189. <view>{{item.fMarks}}</view>
  190. </view>
  191. </view>
  192. </view>
  193. <view style="width: 100%;background-color: #FFFFFF;padding-bottom: 20rpx;position: fixed;bottom: 0;">
  194. <view style="width: 86%;margin: 0 auto;">
  195. <u-button type="primary" @click="confirmImport">确认导入</u-button>
  196. </view>
  197. </view>
  198. </u-popup>
  199. </view>
  200. </template>
  201. <script>
  202. export default {
  203. data() {
  204. return {
  205. fcntrtype: '',
  206. fcnt: [],
  207. rtype: false,
  208. errorType: ['toast'],
  209. rules: {
  210. fBsdate: [{
  211. required: true,
  212. message: '请选择出库日期',
  213. // blur和change事件触发检验
  214. trigger: ['blur', 'change']
  215. }],
  216. fGoodsid: [{
  217. required: true,
  218. type: 'number',
  219. message: '请选择品名',
  220. // blur和change事件触发检验
  221. trigger: ['blur', 'change']
  222. }],
  223. fQty: [{
  224. required: true,
  225. type: 'number',
  226. message: '请输入件数',
  227. // blur和change事件触发检验
  228. trigger: ['blur', 'change']
  229. }],
  230. fGrossweight: [{
  231. required: true,
  232. message: '请输入毛重',
  233. type: 'number',
  234. // blur和change事件触发检验
  235. trigger: ['blur', 'change']
  236. }],
  237. fNetweight: [{
  238. required: true,
  239. message: '请输入净重',
  240. type: 'number',
  241. // blur和change事件触发检验
  242. trigger: ['blur', 'change']
  243. }],
  244. fTruckno: [{
  245. required: true,
  246. message: '请输入车号',
  247. // blur和change事件触发检验
  248. trigger: ['blur', 'change']
  249. }],
  250. fOriginalbillno: [{
  251. required: true,
  252. message: '请输入提单号',
  253. // blur和change事件触发检验
  254. trigger: ['blur', 'change']
  255. }],
  256. },
  257. title: '', //标题
  258. fQty: false,
  259. iness: false,
  260. fBusiness: [],
  261. fBusinessType: '',
  262. action: 'https://test.wms.tubaosoft.com/prod-api/common/upload',
  263. // action: 'https://test.tms.tubaosoft.com/prod-api/common/upload',
  264. headers: {
  265. Authorization: 'Bearer ' + uni.getStorageSync('vuex_token')
  266. },
  267. content: '是否确认提交',
  268. fileList: [],
  269. submIt: false,
  270. operationType: '',
  271. goods: false,
  272. good_s: [],
  273. lists: [],
  274. list: [],
  275. form: {
  276. fBsdate: '',
  277. fGoodsid: '',
  278. fBusinessType: '',
  279. fMarks: '',
  280. fWarehouseInformation: '',
  281. fQty: '',
  282. fGrossweight: '',
  283. fNetweight: '',
  284. fTruckno: '',
  285. fFleet: '',
  286. fCntrno: '',
  287. fcntrtype: '',
  288. fCntqty: '',
  289. labour: '',
  290. fStevedore: '',
  291. fOriginalbillno: ''
  292. },
  293. fEleet: false,
  294. fleEt: [],
  295. labour: '',
  296. laBour: false,
  297. laboUr: [],
  298. shOw: false,
  299. fFleet: '',
  300. fId: '',
  301. fGoodsid: '',
  302. fWarehouseInformation: '',
  303. warehouseBills: {},
  304. planNumber: {},
  305. datalisi: [],
  306. popup: true,
  307. background: {
  308. backgroundColor: '#3b63cf',
  309. },
  310. CheckStatus:false,
  311. content2:"数据发生变化,是否需要返回到列表?",
  312. }
  313. },
  314. onLoad(option) {
  315. // #ifdef APP-PLUS
  316. uni.setNavigationBarTitle({
  317. title: '导入库存总账'
  318. });
  319. // #endif
  320. let data = {
  321. fCorpid: JSON.parse(decodeURIComponent(option.item)).fCorpid,
  322. fWarehouseid: JSON.parse(decodeURIComponent(option.item)).fWarehouseid,
  323. fTrademodeid: JSON.parse(decodeURIComponent(option.item)).fTrademodeid,
  324. }
  325. this.$u.get('/warehouseBusiness/whgenleg/list',data).then(res => {
  326. // console.log(res.rows)
  327. if (res.rows) {
  328. res.rows.map((item, index) => {
  329. this.datalisi.push(Object.assign({}, item, {
  330. checked: false
  331. }, {
  332. disabled: false
  333. }))
  334. })
  335. }
  336. console.log(this.datalisi)
  337. }).catch(err => {
  338. console.log(err)
  339. })
  340. console.log(JSON.parse(decodeURIComponent(option.item)))
  341. this.planNumber.fQty = JSON.parse(decodeURIComponent(option.item)).fQty
  342. this.planNumber.fGrossweight = JSON.parse(decodeURIComponent(option.item)).fGrossweight
  343. this.planNumber.fNetweight = JSON.parse(decodeURIComponent(option.item)).fNetweight
  344. this.fGoodsid = JSON.parse(decodeURIComponent(option.item)).goodsName
  345. this.form.fOriginalbillno = JSON.parse(decodeURIComponent(option.item)).fMblno
  346. // this.form.fBsdate = JSON.parse(decodeURIComponent(option.item)).fBsdate
  347. let lists = {
  348. fId: JSON.parse(decodeURIComponent(option.item)).fId
  349. }
  350. this.fId = JSON.parse(decodeURIComponent(option.item)).fId
  351. this.$u.get('/warehouseBusiness/applets/appBasicInformation',lists).then(res => {
  352. // console.log(res.data)
  353. this.form.fBillno = res.data.warehouseBills.fBillno
  354. this.fcnt = res.data.cntrList
  355. this.list = res.data.warehouse
  356. this.fBusiness = res.data.attributes
  357. this.good_s = res.data.goodsList
  358. this.fleEt = res.data.feelCorpList
  359. this.laboUr = res.data.corpsList
  360. this.warehouseBills = res.data.warehouseBills
  361. // console.log(res.data.warehouseBills)
  362. this.form.fGoodsid = res.data.warehouseBills.fGoodsid
  363. this.form.fBillno = res.data.warehouseBills.fBillno
  364. this.form.fMblno = res.data.warehouseBills.fMblno
  365. this.form.fBillingway = res.data.warehouseBills.fBillingway
  366. console.log(this.list)
  367. }).catch(err => {
  368. console.log(err)
  369. })
  370. },
  371. onReady() {
  372. this.$refs.uForm.setRules(this.rules);
  373. },
  374. methods: {
  375. goBack(){
  376. uni.navigateBack()
  377. },
  378. appCheckCode() {
  379. this.$u.get('/warehouseBusiness/applets/appCheckCode',{
  380. fId: this.warehouseBills.fId,
  381. fType: "warehouse",
  382. codeVal: this.warehouseBills.fDateChanged,
  383. }).then(res => {
  384. if (!res.data) {
  385. this.CheckStatus=true
  386. } else {
  387. this.submIt=true
  388. }
  389. }).catch(err => {
  390. uni.showToast({
  391. icon: 'none',
  392. title: '网络繁忙请稍后再试',
  393. position: "bottom"
  394. })
  395. })
  396. },
  397. confirmImport() {
  398. for (let item in this.datalisi) {
  399. if (this.datalisi[item].checked == true) {
  400. console.log(this.datalisi[item].fQtyblc)
  401. if (this.datalisi[item].fQtyblc == 0) {
  402. uni.showToast({
  403. icon: 'none',
  404. title: '结余数量为0不允许导入',
  405. position: "bottom"
  406. })
  407. } else {
  408. this.popup = false
  409. // #ifdef APP-PLUS
  410. uni.setNavigationBarTitle({
  411. title: '出库新行'
  412. });
  413. // #endif
  414. console.log(this.datalisi)
  415. this.form.fOriginalbilldate = this.datalisi[item].fOriginalbilldate
  416. this.form.fChargedate = this.datalisi[item].fOriginalbilldate
  417. this.form.fBsdate = this.datalisi[item].createTime
  418. //库区
  419. // this.form.fWarehouseInformation = this.datalisi[item].fWarehouseLocationid
  420. this.fWarehouseInformation = this.datalisi[item].fWarehouseids
  421. this.form.fWarehouseInformation = this.datalisi[item].fWarehouseids
  422. this.form.fWarehouselocid = this.datalisi[item].fWarehouseLocationid
  423. // console.log(this.datalisi[item].fOriginalbilldate,this.datalisi[item].fWarehouseids,this.datalisi[item].fWarehouseLocationid)
  424. //品名
  425. this.form.fGoodsid = this.datalisi[item].fGoodsid
  426. this.fGoodsid = this.datalisi[item].fGoodsids
  427. //箱号
  428. this.form.fCntrno = this.datalisi[item].fCntrno
  429. //件数
  430. this.form.fQty = this.datalisi[item].fQtyblc
  431. //净重
  432. this.form.fNetweight = this.datalisi[item].fNetweightblc
  433. //毛重
  434. this.form.fGrossweight = this.datalisi[item].fGrossweightblc
  435. //货物属性
  436. this.fBusinessType = this.datalisi[item].fBusinessTypes
  437. this.form.fBusinessType = this.datalisi[item].fBusinessType
  438. //属性详情
  439. this.form.fMarks = this.datalisi[item].fMarks
  440. //提单号
  441. this.form.fOriginalbillno = this.datalisi[item].fOriginalbillno
  442. }
  443. }
  444. }
  445. },
  446. checkboxChange(e) {
  447. for (let item in this.datalisi) {
  448. if (this.datalisi[item].fId == e.name) {
  449. this.datalisi[item].disabled = false
  450. } else if (e.value == false) {
  451. this.datalisi[item].disabled = false
  452. } else {
  453. this.datalisi[item].disabled = true
  454. }
  455. }
  456. },
  457. calculation() {
  458. // console.log(this.form.fQty)
  459. // this.warehouseBills.fQty //总件数
  460. // this.warehouseBills.fGrossweight //总净重
  461. // this.warehouseBills.fNetweight //总毛重
  462. let sumQty=this.warehouseBills.fPlanqty-this.warehouseBills.fQty
  463. console.log(sumQty)
  464. if (this.form.fQty <= sumQty) {
  465. console.log(this.form.fQty)
  466. let fQty = Number(this.warehouseBills.fPlangrossweight / this.warehouseBills.fPlanqty)
  467. let fqTy = Number(this.warehouseBills.fPlannetweight / this.warehouseBills.fPlanqty)
  468. let fGrossweight = fQty * this.form.fQty
  469. let fNetweight = fqTy * this.form.fQty
  470. this.form.fGrossweight = fGrossweight.toFixed(2)
  471. this.form.fNetweight = fNetweight.toFixed(2)
  472. } else {
  473. this.form.fQty = ''
  474. this.form.fGrossweight = ''
  475. this.form.fNetweight = ''
  476. uni.showToast({
  477. icon: 'none',
  478. title: '总计划件数为:' + sumQty + '不能大于总计划件数',
  479. position: "bottom"
  480. })
  481. }
  482. },
  483. fcntrtPe(e) {
  484. // console.log(e)
  485. this.form.fcntrtype = e[0].value
  486. this.fcntrtype = e[0].label
  487. },
  488. business(e) {
  489. // console.log(e)
  490. this.form.fBusinessType = e[0].value
  491. this.fBusinessType = e[0].label
  492. },
  493. bsdate(e) {
  494. // console.log(e)
  495. this.form.fBsdate = e.result
  496. },
  497. confiLm(e) {
  498. // console.log(e)
  499. this.form.labour = e[0].value
  500. this.labour = e[0].label
  501. },
  502. confiEm(e) {
  503. // console.log(e)
  504. this.form.fFleet = e[0].value
  505. this.fFleet = e[0].label
  506. },
  507. confiRm(e) {
  508. // console.log(e)
  509. this.form.fGoodsid = e[0].value
  510. this.fGoodsid = e[0].label
  511. },
  512. confirm(e) {
  513. // console.log(e)
  514. let res = ''
  515. let id = ''
  516. for (let item in e) {
  517. id = e[item].value
  518. res += e[item].label + '/'
  519. }
  520. this.form.fWarehouseInformation = id
  521. this.fWarehouseInformation = res.substr(0, res.length - 1)
  522. },
  523. receiving(id, i) {
  524. // 获取当前时间
  525. let date = new Date();
  526. let dateYear = date.getFullYear(); //获取年 
  527. let dateMonth = date.getMonth(); //获取月  
  528. let dateDate = date.getDate(); //获取当日
  529. uni.setNavigationBarTitle({
  530. title: this.title
  531. })
  532. this.$u.post('/fleet/ftmsorderbillscars/selectDriver',{
  533. id: id
  534. }).then(res => {
  535. // console.log(res)
  536. this.form = res.data.cars
  537. switch (i) {
  538. case 1:
  539. this.form.acceptDate = dateYear + '-' + dateMonth + '-' + dateDate
  540. break
  541. case 3:
  542. this.form.loadDate = dateYear + '-' + dateMonth + '-' + dateDate
  543. break
  544. case 4:
  545. this.form.mdLoadDate = dateYear + '-' + dateMonth + '-' + dateDate
  546. break
  547. case 5:
  548. this.form.unLoadDate = dateYear + '-' + dateMonth + '-' + dateDate
  549. break
  550. default:
  551. uni.showToast({
  552. icon: 'none',
  553. title: '未知错误状态=' + i,
  554. position: "bottom"
  555. })
  556. break
  557. }
  558. if (this.form.acceptDate) {
  559. this.form.acceptDate = this.form.acceptDate.slice(0, 10)
  560. }
  561. if (this.form.loadDate) {
  562. this.form.loadDate = this.form.loadDate.slice(0, 10)
  563. }
  564. if (this.form.mdLoadDate) {
  565. this.form.mdLoadDate = this.form.mdLoadDate.slice(0, 10)
  566. }
  567. if (this.form.unLoadDate) {
  568. this.form.unLoadDate = this.form.unLoadDate.slice(0, 10)
  569. }
  570. }).catch(err => {
  571. uni.showToast({
  572. icon: 'none',
  573. title: '网络繁忙请稍后再试',
  574. position: "bottom"
  575. })
  576. })
  577. },
  578. success(data, index, lists, name) {
  579. // console.log(data)
  580. // console.log(index)
  581. // console.log(lists)
  582. // console.log(name)
  583. // console.log(this.fileList)
  584. },
  585. attachmentP() {
  586. this.lists = []
  587. console.log(this.fileList)
  588. console.log(this.$refs.uUpload.lists)
  589. let lists = this.$refs.uUpload.lists
  590. if (lists.length != 0) {
  591. for (let item in this.$refs.uUpload.lists) {
  592. console.log(this.$refs.uUpload.lists[item].response)
  593. if (this.$refs.uUpload.lists[item].response) {
  594. this.lists.push({
  595. fUrl: this.$refs.uUpload.lists[item].response.url,
  596. fName: this.$refs.uUpload.lists[item].response.fileName
  597. })
  598. }
  599. }
  600. }
  601. let fileList = []
  602. console.log(this.fileList)
  603. if (this.fileList.length != 0) {
  604. for (let item in this.fileList) {
  605. fileList.push({
  606. fUrl: this.fileList[item].response.url,
  607. fName: this.fileList[item].response.fileName
  608. })
  609. }
  610. }
  611. this.lists = this.lists.concat(fileList)
  612. // console.log(this.lists)
  613. this.$u.post('/warehouseBusiness/applets/saveWarehouse',{
  614. 'warehousebillsitems': JSON.stringify({
  615. fId: this.form.fId,
  616. fQty: this.form.fQty,
  617. fGrossweight: this.form.fGrossweight,
  618. fNetweight: this.form.fNetweight,
  619. fPid: this.form.fPid
  620. }),
  621. 'tEnclosure': JSON.stringify(this.lists)
  622. }).then(res => {
  623. // console.log(res)
  624. if (res.code == 500) {
  625. if (res.msg == 'parseDecimal error, field : oilAmt') {
  626. uni.showToast({
  627. icon: 'none',
  628. title: '数字不正确,请检查后再提交',
  629. position: "bottom"
  630. })
  631. } else {
  632. uni.showToast({
  633. icon: 'none',
  634. title: res.msg,
  635. position: "bottom"
  636. })
  637. }
  638. } else if (res.code == 200) {
  639. // uni.navigateBack();
  640. uni.showToast({
  641. icon: 'none',
  642. title: '保存成功',
  643. position: "bottom"
  644. })
  645. }
  646. }).catch(err => {
  647. uni.showToast({
  648. icon: 'none',
  649. title: '网络繁忙请稍后再试',
  650. position: "bottom"
  651. })
  652. })
  653. },
  654. //提交
  655. submit() {
  656. this.$refs.uForm.validate(valid => {
  657. if (valid) {
  658. console.log(valid)
  659. this.lists = []
  660. console.log(this.fileList)
  661. console.log(this.$refs.uUpload.lists)
  662. let lists = this.$refs.uUpload.lists
  663. if (lists.length != 0) {
  664. for (let item in this.$refs.uUpload.lists) {
  665. console.log(this.$refs.uUpload.lists[item].response)
  666. if (this.$refs.uUpload.lists[item].response) {
  667. this.lists.push({
  668. fUrl: this.$refs.uUpload.lists[item].response.url,
  669. fName: this.$refs.uUpload.lists[item].response.fileName
  670. })
  671. }
  672. }
  673. }
  674. let fileList = []
  675. console.log(this.fileList)
  676. if (this.fileList.length != 0) {
  677. for (let item in this.fileList) {
  678. fileList.push({
  679. fUrl: this.fileList[item].response.url,
  680. fName: this.fileList[item].response.fileName
  681. })
  682. }
  683. }
  684. this.lists = this.lists.concat(fileList)
  685. // this.form.fChargedate = this.form.fOriginalbilldate = this.form.fBsdate
  686. // this.form.fChargedate = this.form.fBsdate
  687. this.form.fPid = this.fId
  688. this.form.fBilltype = 'SJCK'
  689. this.$u.post('/warehouseBusiness/applets/saveWarehouse',{
  690. item: this.form,
  691. attachs: this.lists
  692. }).then(res => {
  693. console.log(res)
  694. if (res.code == 500) {
  695. if (res.msg == 'parseDecimal error, field : oilAmt') {
  696. uni.showToast({
  697. icon: 'none',
  698. title: '数字不正确,请检查后再提交',
  699. position: "bottom"
  700. })
  701. } else {
  702. uni.showToast({
  703. icon: 'none',
  704. title: res.msg,
  705. position: "bottom"
  706. })
  707. }
  708. } else if (res.code == 200) {
  709. uni.navigateBack();
  710. }
  711. }).catch(err => {
  712. uni.showToast({
  713. icon: 'none',
  714. title: '网络繁忙请稍后再试',
  715. position: "bottom"
  716. })
  717. })
  718. } else {
  719. // console.log('验证失败');
  720. // console.log(this.form.fGoodsid)
  721. }
  722. })
  723. }
  724. }
  725. };
  726. </script>
  727. <style scoped lang="scss">
  728. .basIc {
  729. width: 100%;
  730. margin: 10rpx auto;
  731. display: flex;
  732. justify-content: space-between;
  733. }
  734. .basIc>view {
  735. margin-bottom: 10rpx;
  736. }
  737. .basIc>view:nth-child(1) {
  738. color: #797979;
  739. }
  740. .basic {
  741. width: 94%;
  742. margin: 10rpx auto;
  743. display: flex;
  744. justify-content: space-between;
  745. }
  746. .basic>view {
  747. margin-bottom: 10rpx;
  748. }
  749. .basic>view:nth-child(1) {
  750. color: #797979;
  751. }
  752. .license {
  753. float: left;
  754. font-size: 32rpx;
  755. }
  756. .ordertop {
  757. width: 96%;
  758. background-color: #fff;
  759. margin: 20rpx auto;
  760. border-radius: 20rpx;
  761. padding-top: 20rpx;
  762. box-shadow: 0px 0px 8px 0px rgba(165, 189, 251, 0.4);
  763. padding-bottom: 10rpx;
  764. }
  765. .ordertop>view:nth-child(1) {
  766. width: 98%;
  767. margin-bottom: 60rpx;
  768. }
  769. .iconblue {
  770. width: 10rpx;
  771. height: 45rpx;
  772. float: left;
  773. background-color: #3a63cf;
  774. margin-right: 10rpx;
  775. }
  776. .various {
  777. float: right;
  778. width: 150rpx;
  779. border: 2rpx solid #3a63cf;
  780. text-align: center;
  781. border-radius: 100rpx;
  782. color: #3a63cf;
  783. }
  784. .line {
  785. width: 92%;
  786. margin: 0 auto;
  787. }
  788. </style>