123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805 |
- <template>
- <view>
- <view class="ordertop">
- <view>
- <view class="iconblue"></view>
- <text class="license">基础信息</text>
- </view>
- <view class="line">
- <u-line color="#ccc" border-style='dashed' />
- </view>
- <u-form :model="form" :rules="rules" ref="uForm" :errorType="errorType">
- <view class="basic" style="margin: 0 auto;height: 55rpx;">
- <u-form-item style="width: 100%;" :border-bottom="false" label-width="150rpx" label="出库日期:" prop="fBsdate"
- required>
- <u-input type="type" :clearable="false" placeholder="请选择出库日期" v-model="form.fBsdate" disabled @click="shOw = !shOw" />
- <u-calendar v-model="shOw" mode="date" @change="bsdate"></u-calendar>
- </u-form-item>
- </view>
- <view class="basic" style="margin: 0 auto;height: 55rpx;">
- <u-form-item style="width: 100%;" :border-bottom="false" label-width="100rpx" label="品名:" prop="fGoodsid" required>
- <u-input type="type" :clearable="false" placeholder="请选品名" v-model="fGoodsid" disabled @click="goods = !goods" />
- <u-select v-model="goods" @confirm="confiRm" :list="good_s" label-name="fName" value-name="fId">
- </u-select>
- </u-form-item>
- </view>
- <view class="basic" style="margin: 0 auto;height: 55rpx;">
- <u-form-item style="width: 100%;" :border-bottom="false" label-width="150rpx" label="货物属性:" prop="fBusinessType"
- disabled>
- <u-input type="type" :clearable="false" placeholder="请选择货物属性" v-model="fBusinessType" disabled @click="iness = !iness" />
- <!-- <u-select v-model="iness" @confirm="business" :list="fBusiness" label-name="dictLabel" value-name="dictSort" /> -->
- </u-form-item>
- </view>
- <view class="basic" style="margin: 0 auto;height: 55rpx;">
- <u-form-item style="width: 100%;" :border-bottom="false" label-width="150rpx" label="属性详情:" prop="fMarks">
- <u-input type="type" :clearable="false" placeholder="请输入属性详情" v-model="form.fMarks" disabled />
- </u-form-item>
- </view>
- <view class="basic" style="margin: 0 auto;height: 55rpx;">
- <u-form-item style="width: 100%;" :border-bottom="false" label-width="100rpx" label="库区:" prop="fWarehouseInformation">
- <!-- <u-select v-model="fQty" mode="mutil-column-auto" :list="list" @confirm="confirm" label-name="label" value-name="id" child-name="children"></u-select> -->
- <u-input type="type" :clearable="false" placeholder="请选库区" v-model="fWarehouseInformation" disabled @click="fQty = !fQty" />
- </u-form-item>
- </view>
- <view class="basic" style="margin: 0 auto;height: 55rpx;">
- <u-form-item style="width: 100%;" :border-bottom="false" label-width="100rpx" label="件数:" prop="fQty" required>
- <u-input type="digit" :clearable="false" placeholder="请输入件数" v-model="form.fQty" @input="calculation" />
- </u-form-item>
- </view>
- <view class="basic" style="margin: 0 auto;height: 55rpx;">
- <u-form-item style="width: 100%;" :border-bottom="false" label-width="100rpx" label="毛重:" prop="fGrossweight"
- required>
- <u-input type="digit" :clearable="false" placeholder="请输入毛重" v-model="form.fGrossweight" />
- </u-form-item>
- </view>
- <view class="basic" style="margin: 0 auto;height: 55rpx;">
- <u-form-item style="width: 100%;" :border-bottom="false" label-width="100rpx" label="净重:" prop="fNetweight"
- required>
- <u-input type="digit" :clearable="false" placeholder="请输入净重" v-model="form.fNetweight" />
- </u-form-item>
- </view>
- <view class="basic" style="margin: 0 auto;height: 55rpx;">
- <u-form-item style="width: 100%;" :border-bottom="false" label-width="100rpx" label="车号:" prop="fTruckno" required>
- <u-input type="type" :clearable="false" placeholder="请输入车号" v-model="form.fTruckno" />
- </u-form-item>
- </view>
- <view class="basic" style="margin: 0 auto;height: 55rpx;">
- <u-form-item style="width: 100%;" :border-bottom="false" label-width="100rpx" label="车队:" prop="fFleet">
- <u-input type="type" :clearable="false" placeholder="请选车队" v-model="fFleet" disabled @click="fEleet = !fEleet" />
- <u-select v-model="fEleet" @confirm="confiEm" :list="fleEt" label-name="fName" value-name="fId">
- </u-select>
- </u-form-item>
- </view>
- <view class="basic" style="margin: 0 auto;height: 55rpx;">
- <u-form-item style="width: 100%;" :border-bottom="false" label-width="100rpx" label="箱号:" prop="fCntrno">
- <u-input type="type" :clearable="false" placeholder="请输入箱号" v-model="form.fCntrno" disabled />
- </u-form-item>
- </view>
- <view class="basic" style="margin: 0 auto;height: 55rpx;">
- <u-form-item style="width: 100%;" :border-bottom="false" label-width="100rpx" label="箱型:" prop="fcntrtype">
- <u-input type="type" :clearable="false" placeholder="请输入箱型" v-model="fcntrtype" disabled @click="rtype = !rtype" />
- <u-select v-model="rtype" @confirm="fcntrtPe" :list="fcnt" label-name="fName" value-name="fId"></u-select>
- </u-form-item>
- </view>
- <view class="basic" style="margin: 0 auto;height: 55rpx;">
- <u-form-item style="width: 100%;" :border-bottom="false" label-width="100rpx" label="箱量:" prop="fCntqty">
- <u-input type="digit" :clearable="false" placeholder="请输入箱量" v-model="form.fCntqty" />
- </u-form-item>
- </view>
- <view class="basic" style="margin: 0 auto;height: 55rpx;">
- <u-form-item style="width: 100%;" :border-bottom="false" label-width="150rpx" label="劳务公司:" prop="labour">
- <u-input type="type" :clearable="false" placeholder="请选择劳务公司" v-model="labour" disabled @click="laBour = !laBour" />
- <u-select v-model="laBour" @confirm="confiLm" :list="laboUr" label-name="fName" value-name="fId">
- </u-select>
- </u-form-item>
- </view>
- <view class="basic" style="margin: 0 auto;height: 55rpx;">
- <u-form-item style="width: 100%;" :border-bottom="false" label-width="130rpx" label="装卸工:" prop="fStevedore">
- <u-input type="type" :clearable="false" placeholder="请输入装卸工" v-model="form.fStevedore" />
- </u-form-item>
- </view>
- <view class="basic" style="margin: 0 auto;height: 55rpx;">
- <u-form-item style="width: 100%;" :border-bottom="false" label-width="130rpx" label="提单号:" prop="fOriginalbillno">
- <u-input type="type" :clearable="false" placeholder="请输入提单号" v-model="form.fOriginalbillno" disabled />
- </u-form-item>
- </view>
- <view class="basic" style="margin: 0 auto;height: 55rpx;">
- <u-form-item style="width: 100%;" :border-bottom="false" label-width="100rpx" label="司机:" prop="fDriverName">
- <u-input type="type" :clearable="false" placeholder="请输入司机" v-model="form.fDriverName" />
- </u-form-item>
- </view>
- <view class="basic" style="margin: 0 auto;">
- <u-form-item style="width: 100%;" :border-bottom="false" label-width="100rpx" label="备注:">
- <u-input type="textarea" height="20rpx" placeholder="请输入备注" :clearable="false" v-model="form.remark" />
- </u-form-item>
- </view>
- </u-form>
- </view>
- <view class="ordertop" style="margin-bottom: 60rpx;">
- <view>
- <view class="iconblue"></view>
- <text class="license">附件上传</text>
- <!-- <view class="various" @click="attachmentP">保存附件</view> -->
- </view>
- <view class="line">
- <u-line color="#ccc" border-style='dashed' />
- </view>
- <view style="width: 94%;margin: 0 auto;">
- <u-upload ref="uUpload" :deletable="false" :action="action" :header="headers" @on-success="success" :file-list="fileList">
- </u-upload>
- </view>
- </view>
- <br>
- <view style="width: 100%;position:fixed; bottom:0;background-color: #FFFFFF;padding-left: 20px;padding-right: 20px;">
- <u-button type="primary" @click="appCheckCode">提交保存</u-button>
- </view>
- <u-modal v-model="submIt" @confirm="submit" :content="content" @cancel="submIt = false" :show-cancel-button="true" />
- <u-modal v-model="CheckStatus" @confirm="goBack" :content="content2" @cancel="CheckStatus = false"
- :show-cancel-button="true" />
- <u-popup v-model="popup" close-icon-pos="top-left" width="100%" mode='left' :mask-close-able="false">
- <!-- #ifdef H5 -->
- <u-navbar title="导入库存总账" :background="background" title-color="#fff" back-icon-color="#fff"></u-navbar>
- <!-- #endif -->
- <view style="width: 98%;box-shadow: 0px 0px 8px 0px rgb(165 189 251 / 40%);margin: 0 auto;margin-top: 20rpx;padding: 10px;"
- v-for="(item,index) in datalisi" :key="index">
- <view style="width: 99%;margin: 0 auto;margin-bottom: 20rpx;">
- <view>
- <span>提单号:{{item.fMblno}}</span>
- <u-checkbox-group style="float: right;margin-right: -30rpx;background-color: ;">
- <span style="width: 70rpx;">
- {{item.checked == false?'选择':'取消'}}
- </span>
- <u-checkbox max="1" v-model="item.checked" :disabled="item.disabled" @change="checkboxChange" active-color="#5677FC"
- :name="item.fId"></u-checkbox>
- </u-checkbox-group>
- </view>
- <view class="line">
- <u-line color="#ccc" border-style='dashed' />
- </view>
- <view class="basIc">
- <view>出库日期</view>
- <view>{{item.createTime}}</view>
- </view>
- <view class="basIc">
- <view>品名</view>
- <view>{{item.fGoodsids}}</view>
- </view>
- <view class="basIc">
- <view>箱号</view>
- <view>{{item.fCntrno}}</view>
- </view>
- <view class="basIc">
- <view>结余数量</view>
- <view>{{item.fQtyblc}}</view>
- </view>
- <view class="basIc">
- <view>毛重</view>
- <view>{{item.fGrossweightblc}}</view>
- </view>
- <view class="basIc">
- <view>净重</view>
- <view>{{item.fNetweightblc}}</view>
- </view>
- <view class="basIc">
- <view>库位</view>
- <view>{{item.fWarehouseids}}</view>
- </view>
- <view class="basIc">
- <view>品牌</view>
- <view>{{item.fMarks}}</view>
- </view>
- </view>
- </view>
- <view style="width: 100%;background-color: #FFFFFF;padding-bottom: 20rpx;position: fixed;bottom: 0;">
- <view style="width: 86%;margin: 0 auto;">
- <u-button type="primary" @click="confirmImport">确认导入</u-button>
- </view>
- </view>
- </u-popup>
- </view>
- </template>
- <script>
- export default {
- data() {
- return {
- fcntrtype: '',
- fcnt: [],
- rtype: false,
- errorType: ['toast'],
- rules: {
- fBsdate: [{
- required: true,
- message: '请选择出库日期',
- // blur和change事件触发检验
- trigger: ['blur', 'change']
- }],
- fGoodsid: [{
- required: true,
- type: 'number',
- message: '请选择品名',
- // blur和change事件触发检验
- trigger: ['blur', 'change']
- }],
- fQty: [{
- required: true,
- type: 'number',
- message: '请输入件数',
- // blur和change事件触发检验
- trigger: ['blur', 'change']
- }],
- fGrossweight: [{
- required: true,
- message: '请输入毛重',
- type: 'number',
- // blur和change事件触发检验
- trigger: ['blur', 'change']
- }],
- fNetweight: [{
- required: true,
- message: '请输入净重',
- type: 'number',
- // blur和change事件触发检验
- trigger: ['blur', 'change']
- }],
- fTruckno: [{
- required: true,
- message: '请输入车号',
- // blur和change事件触发检验
- trigger: ['blur', 'change']
- }],
- fOriginalbillno: [{
- required: true,
- message: '请输入提单号',
- // blur和change事件触发检验
- trigger: ['blur', 'change']
- }],
- },
- title: '', //标题
- fQty: false,
- iness: false,
- fBusiness: [],
- fBusinessType: '',
- action: 'https://test.wms.tubaosoft.com/prod-api/common/upload',
- // action: 'https://test.tms.tubaosoft.com/prod-api/common/upload',
- headers: {
- Authorization: 'Bearer ' + uni.getStorageSync('vuex_token')
- },
- content: '是否确认提交',
- fileList: [],
- submIt: false,
- operationType: '',
- goods: false,
- good_s: [],
- lists: [],
- list: [],
- form: {
- fBsdate: '',
- fGoodsid: '',
- fBusinessType: '',
- fMarks: '',
- fWarehouseInformation: '',
- fQty: '',
- fGrossweight: '',
- fNetweight: '',
- fTruckno: '',
- fFleet: '',
- fCntrno: '',
- fcntrtype: '',
- fCntqty: '',
- labour: '',
- fStevedore: '',
- fOriginalbillno: ''
- },
- fEleet: false,
- fleEt: [],
- labour: '',
- laBour: false,
- laboUr: [],
- shOw: false,
- fFleet: '',
- fId: '',
- fGoodsid: '',
- fWarehouseInformation: '',
- warehouseBills: {},
- planNumber: {},
- datalisi: [],
- popup: true,
- background: {
- backgroundColor: '#3b63cf',
- },
- CheckStatus:false,
- content2:"数据发生变化,是否需要返回到列表?",
- }
- },
- onLoad(option) {
- // #ifdef APP-PLUS
- uni.setNavigationBarTitle({
- title: '导入库存总账'
- });
- // #endif
- let data = {
- fCorpid: JSON.parse(decodeURIComponent(option.item)).fCorpid,
- fWarehouseid: JSON.parse(decodeURIComponent(option.item)).fWarehouseid,
- fTrademodeid: JSON.parse(decodeURIComponent(option.item)).fTrademodeid,
- }
- this.$u.get('/warehouseBusiness/whgenleg/list',data).then(res => {
- // console.log(res.rows)
- if (res.rows) {
- res.rows.map((item, index) => {
- this.datalisi.push(Object.assign({}, item, {
- checked: false
- }, {
- disabled: false
- }))
- })
- }
- console.log(this.datalisi)
- }).catch(err => {
- console.log(err)
- })
- console.log(JSON.parse(decodeURIComponent(option.item)))
- this.planNumber.fQty = JSON.parse(decodeURIComponent(option.item)).fQty
- this.planNumber.fGrossweight = JSON.parse(decodeURIComponent(option.item)).fGrossweight
- this.planNumber.fNetweight = JSON.parse(decodeURIComponent(option.item)).fNetweight
- this.fGoodsid = JSON.parse(decodeURIComponent(option.item)).goodsName
- this.form.fOriginalbillno = JSON.parse(decodeURIComponent(option.item)).fMblno
- // this.form.fBsdate = JSON.parse(decodeURIComponent(option.item)).fBsdate
- let lists = {
- fId: JSON.parse(decodeURIComponent(option.item)).fId
- }
- this.fId = JSON.parse(decodeURIComponent(option.item)).fId
- this.$u.get('/warehouseBusiness/applets/appBasicInformation',lists).then(res => {
- // console.log(res.data)
- this.form.fBillno = res.data.warehouseBills.fBillno
- this.fcnt = res.data.cntrList
- this.list = res.data.warehouse
- this.fBusiness = res.data.attributes
- this.good_s = res.data.goodsList
- this.fleEt = res.data.feelCorpList
- this.laboUr = res.data.corpsList
- this.warehouseBills = res.data.warehouseBills
- // console.log(res.data.warehouseBills)
- this.form.fGoodsid = res.data.warehouseBills.fGoodsid
- this.form.fBillno = res.data.warehouseBills.fBillno
- this.form.fMblno = res.data.warehouseBills.fMblno
- this.form.fBillingway = res.data.warehouseBills.fBillingway
- console.log(this.list)
- }).catch(err => {
- console.log(err)
- })
- },
- onReady() {
- this.$refs.uForm.setRules(this.rules);
- },
- methods: {
- goBack(){
- uni.navigateBack()
- },
- appCheckCode() {
- this.$u.get('/warehouseBusiness/applets/appCheckCode',{
- fId: this.warehouseBills.fId,
- fType: "warehouse",
- codeVal: this.warehouseBills.fDateChanged,
- }).then(res => {
- if (!res.data) {
- this.CheckStatus=true
- } else {
- this.submIt=true
- }
- }).catch(err => {
- uni.showToast({
- icon: 'none',
- title: '网络繁忙请稍后再试',
- position: "bottom"
- })
- })
- },
- confirmImport() {
- for (let item in this.datalisi) {
- if (this.datalisi[item].checked == true) {
- console.log(this.datalisi[item].fQtyblc)
- if (this.datalisi[item].fQtyblc == 0) {
- uni.showToast({
- icon: 'none',
- title: '结余数量为0不允许导入',
- position: "bottom"
- })
- } else {
- this.popup = false
- // #ifdef APP-PLUS
- uni.setNavigationBarTitle({
- title: '出库新行'
- });
- // #endif
- console.log(this.datalisi)
- this.form.fOriginalbilldate = this.datalisi[item].fOriginalbilldate
- this.form.fChargedate = this.datalisi[item].fOriginalbilldate
- this.form.fBsdate = this.datalisi[item].createTime
- //库区
- // this.form.fWarehouseInformation = this.datalisi[item].fWarehouseLocationid
- this.fWarehouseInformation = this.datalisi[item].fWarehouseids
- this.form.fWarehouseInformation = this.datalisi[item].fWarehouseids
- this.form.fWarehouselocid = this.datalisi[item].fWarehouseLocationid
- // console.log(this.datalisi[item].fOriginalbilldate,this.datalisi[item].fWarehouseids,this.datalisi[item].fWarehouseLocationid)
- //品名
- this.form.fGoodsid = this.datalisi[item].fGoodsid
- this.fGoodsid = this.datalisi[item].fGoodsids
- //箱号
- this.form.fCntrno = this.datalisi[item].fCntrno
- //件数
- this.form.fQty = this.datalisi[item].fQtyblc
- //净重
- this.form.fNetweight = this.datalisi[item].fNetweightblc
- //毛重
- this.form.fGrossweight = this.datalisi[item].fGrossweightblc
- //货物属性
- this.fBusinessType = this.datalisi[item].fBusinessTypes
- this.form.fBusinessType = this.datalisi[item].fBusinessType
- //属性详情
- this.form.fMarks = this.datalisi[item].fMarks
- //提单号
- this.form.fOriginalbillno = this.datalisi[item].fOriginalbillno
- }
- }
- }
- },
- checkboxChange(e) {
- for (let item in this.datalisi) {
- if (this.datalisi[item].fId == e.name) {
- this.datalisi[item].disabled = false
- } else if (e.value == false) {
- this.datalisi[item].disabled = false
- } else {
- this.datalisi[item].disabled = true
- }
- }
- },
- calculation() {
- // console.log(this.form.fQty)
- // this.warehouseBills.fQty //总件数
- // this.warehouseBills.fGrossweight //总净重
- // this.warehouseBills.fNetweight //总毛重
- let sumQty=this.warehouseBills.fPlanqty-this.warehouseBills.fQty
- console.log(sumQty)
- if (this.form.fQty <= sumQty) {
- console.log(this.form.fQty)
- let fQty = Number(this.warehouseBills.fPlangrossweight / this.warehouseBills.fPlanqty)
- let fqTy = Number(this.warehouseBills.fPlannetweight / this.warehouseBills.fPlanqty)
- let fGrossweight = fQty * this.form.fQty
- let fNetweight = fqTy * this.form.fQty
- this.form.fGrossweight = fGrossweight.toFixed(2)
- this.form.fNetweight = fNetweight.toFixed(2)
- } else {
- this.form.fQty = ''
- this.form.fGrossweight = ''
- this.form.fNetweight = ''
- uni.showToast({
- icon: 'none',
- title: '总计划件数为:' + sumQty + '不能大于总计划件数',
- position: "bottom"
- })
- }
- },
- fcntrtPe(e) {
- // console.log(e)
- this.form.fcntrtype = e[0].value
- this.fcntrtype = e[0].label
- },
- business(e) {
- // console.log(e)
- this.form.fBusinessType = e[0].value
- this.fBusinessType = e[0].label
- },
- bsdate(e) {
- // console.log(e)
- this.form.fBsdate = e.result
- },
- confiLm(e) {
- // console.log(e)
- this.form.labour = e[0].value
- this.labour = e[0].label
- },
- confiEm(e) {
- // console.log(e)
- this.form.fFleet = e[0].value
- this.fFleet = e[0].label
- },
- confiRm(e) {
- // console.log(e)
- this.form.fGoodsid = e[0].value
- this.fGoodsid = e[0].label
- },
- confirm(e) {
- // console.log(e)
- let res = ''
- let id = ''
- for (let item in e) {
- id = e[item].value
- res += e[item].label + '/'
- }
- this.form.fWarehouseInformation = id
- this.fWarehouseInformation = res.substr(0, res.length - 1)
- },
- receiving(id, i) {
- // 获取当前时间
- let date = new Date();
- let dateYear = date.getFullYear(); //获取年
- let dateMonth = date.getMonth(); //获取月
- let dateDate = date.getDate(); //获取当日
- uni.setNavigationBarTitle({
- title: this.title
- })
- this.$u.post('/fleet/ftmsorderbillscars/selectDriver',{
- id: id
- }).then(res => {
- // console.log(res)
- this.form = res.data.cars
- switch (i) {
- case 1:
- this.form.acceptDate = dateYear + '-' + dateMonth + '-' + dateDate
- break
- case 3:
- this.form.loadDate = dateYear + '-' + dateMonth + '-' + dateDate
- break
- case 4:
- this.form.mdLoadDate = dateYear + '-' + dateMonth + '-' + dateDate
- break
- case 5:
- this.form.unLoadDate = dateYear + '-' + dateMonth + '-' + dateDate
- break
- default:
- uni.showToast({
- icon: 'none',
- title: '未知错误状态=' + i,
- position: "bottom"
- })
- break
- }
- if (this.form.acceptDate) {
- this.form.acceptDate = this.form.acceptDate.slice(0, 10)
- }
- if (this.form.loadDate) {
- this.form.loadDate = this.form.loadDate.slice(0, 10)
- }
- if (this.form.mdLoadDate) {
- this.form.mdLoadDate = this.form.mdLoadDate.slice(0, 10)
- }
- if (this.form.unLoadDate) {
- this.form.unLoadDate = this.form.unLoadDate.slice(0, 10)
- }
- }).catch(err => {
- uni.showToast({
- icon: 'none',
- title: '网络繁忙请稍后再试',
- position: "bottom"
- })
- })
- },
- success(data, index, lists, name) {
- // console.log(data)
- // console.log(index)
- // console.log(lists)
- // console.log(name)
- // console.log(this.fileList)
- },
- attachmentP() {
- this.lists = []
- console.log(this.fileList)
- console.log(this.$refs.uUpload.lists)
- let lists = this.$refs.uUpload.lists
- if (lists.length != 0) {
- for (let item in this.$refs.uUpload.lists) {
- console.log(this.$refs.uUpload.lists[item].response)
- if (this.$refs.uUpload.lists[item].response) {
- this.lists.push({
- fUrl: this.$refs.uUpload.lists[item].response.url,
- fName: this.$refs.uUpload.lists[item].response.fileName
- })
- }
- }
- }
- let fileList = []
- console.log(this.fileList)
- if (this.fileList.length != 0) {
- for (let item in this.fileList) {
- fileList.push({
- fUrl: this.fileList[item].response.url,
- fName: this.fileList[item].response.fileName
- })
- }
- }
- this.lists = this.lists.concat(fileList)
- // console.log(this.lists)
- this.$u.post('/warehouseBusiness/applets/saveWarehouse',{
- 'warehousebillsitems': JSON.stringify({
- fId: this.form.fId,
- fQty: this.form.fQty,
- fGrossweight: this.form.fGrossweight,
- fNetweight: this.form.fNetweight,
- fPid: this.form.fPid
- }),
- 'tEnclosure': JSON.stringify(this.lists)
- }).then(res => {
- // console.log(res)
- if (res.code == 500) {
- if (res.msg == 'parseDecimal error, field : oilAmt') {
- uni.showToast({
- icon: 'none',
- title: '数字不正确,请检查后再提交',
- position: "bottom"
- })
- } else {
- uni.showToast({
- icon: 'none',
- title: res.msg,
- position: "bottom"
- })
- }
- } else if (res.code == 200) {
- // uni.navigateBack();
- uni.showToast({
- icon: 'none',
- title: '保存成功',
- position: "bottom"
- })
- }
- }).catch(err => {
- uni.showToast({
- icon: 'none',
- title: '网络繁忙请稍后再试',
- position: "bottom"
- })
- })
- },
- //提交
- submit() {
- this.$refs.uForm.validate(valid => {
- if (valid) {
- console.log(valid)
- this.lists = []
- console.log(this.fileList)
- console.log(this.$refs.uUpload.lists)
- let lists = this.$refs.uUpload.lists
- if (lists.length != 0) {
- for (let item in this.$refs.uUpload.lists) {
- console.log(this.$refs.uUpload.lists[item].response)
- if (this.$refs.uUpload.lists[item].response) {
- this.lists.push({
- fUrl: this.$refs.uUpload.lists[item].response.url,
- fName: this.$refs.uUpload.lists[item].response.fileName
- })
- }
- }
- }
- let fileList = []
- console.log(this.fileList)
- if (this.fileList.length != 0) {
- for (let item in this.fileList) {
- fileList.push({
- fUrl: this.fileList[item].response.url,
- fName: this.fileList[item].response.fileName
- })
- }
- }
- this.lists = this.lists.concat(fileList)
- // this.form.fChargedate = this.form.fOriginalbilldate = this.form.fBsdate
- // this.form.fChargedate = this.form.fBsdate
- this.form.fPid = this.fId
- this.form.fBilltype = 'SJCK'
- this.$u.post('/warehouseBusiness/applets/saveWarehouse',{
- item: this.form,
- attachs: this.lists
- }).then(res => {
- console.log(res)
- if (res.code == 500) {
- if (res.msg == 'parseDecimal error, field : oilAmt') {
- uni.showToast({
- icon: 'none',
- title: '数字不正确,请检查后再提交',
- position: "bottom"
- })
- } else {
- uni.showToast({
- icon: 'none',
- title: res.msg,
- position: "bottom"
- })
- }
- } else if (res.code == 200) {
- uni.navigateBack();
- }
- }).catch(err => {
- uni.showToast({
- icon: 'none',
- title: '网络繁忙请稍后再试',
- position: "bottom"
- })
- })
- } else {
- // console.log('验证失败');
- // console.log(this.form.fGoodsid)
- }
- })
- }
- }
- };
- </script>
- <style scoped lang="scss">
- .basIc {
- width: 100%;
- margin: 10rpx auto;
- display: flex;
- justify-content: space-between;
- }
- .basIc>view {
- margin-bottom: 10rpx;
- }
- .basIc>view:nth-child(1) {
- color: #797979;
- }
- .basic {
- width: 94%;
- margin: 10rpx auto;
- display: flex;
- justify-content: space-between;
- }
- .basic>view {
- margin-bottom: 10rpx;
- }
- .basic>view:nth-child(1) {
- color: #797979;
- }
- .license {
- float: left;
- font-size: 32rpx;
- }
- .ordertop {
- width: 96%;
- background-color: #fff;
- margin: 20rpx auto;
- border-radius: 20rpx;
- padding-top: 20rpx;
- box-shadow: 0px 0px 8px 0px rgba(165, 189, 251, 0.4);
- padding-bottom: 10rpx;
- }
- .ordertop>view:nth-child(1) {
- width: 98%;
- margin-bottom: 60rpx;
- }
- .iconblue {
- width: 10rpx;
- height: 45rpx;
- float: left;
- background-color: #3a63cf;
- margin-right: 10rpx;
- }
- .various {
- float: right;
- width: 150rpx;
- border: 2rpx solid #3a63cf;
- text-align: center;
- border-radius: 100rpx;
- color: #3a63cf;
- }
- .line {
- width: 92%;
- margin: 0 auto;
- }
- </style>
|