12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484 |
- <template>
- <el-dialog
- v-dialog-drag
- title="快速入库"
- :visible.sync="visible"
- width="80%"
- :append-to-body="true"
- :close-on-click-modal="false"
- :before-close="closeDialog"
- >
- <el-form :model="form" :rules="rules" label-width="80px" ref="form">
- <el-row>
- <el-col :xs="12" :sm="6">
- <el-form-item label="客户名称" prop="fCorpid">
- <el-select
- v-model="form.fCorpid"
- clearable
- filterable
- placeholder="请输入关键词"
- style="width: 100%"
- >
- <el-option
- v-for="(item, index) in fMblnoOptions"
- :key="index.fId"
- :label="item.fName"
- :value="item.fId"
- ></el-option>
- </el-select>
- </el-form-item>
- </el-col>
- <el-col :xs="12" :sm="6">
- <el-form-item label="提单号" prop="fMblno">
- <el-input
- v-model="form.fMblno"
- placeholder="请输入提单号"
- clearable
- style="width: 100%"
- />
- </el-form-item>
- </el-col>
- <el-col :xs="12" :sm="6">
- <el-form-item label="入库日期" prop="fBsdate">
- <el-date-picker
- type="date"
- v-model="form.fBsdate"
- value-format="timestamp"
- format="yyyy-MM-dd"
- placeholder="请选择计划日期"
- style="width: 100%"
- ></el-date-picker>
- </el-form-item>
- </el-col>
- <el-col :xs="12" :sm="6">
- <el-form-item label="入库时间" prop="fBstime">
- <el-time-picker
- v-model="form.fBstime"
- :picker-options="{
- selectableRange: '00:00:00 - 23:59:59',
- }"
- value-format="timestamp"
- placeholder="任意时间点"
- style="width: 100%"
- ></el-time-picker>
- </el-form-item>
- </el-col>
- <el-col :xs="12" :sm="6">
- <el-form-item label="仓库" prop="fWarehouseid">
- <el-select
- v-model="form.fWarehouseid"
- filterable
- placeholder="请选择"
- @change="changefWarehouseid"
- style="width: 100%"
- :disabled="detailList.length > 0"
- >
- <el-option
- v-for="(item, index) in warehouseOptions"
- :key="index.fId"
- :label="item.fName"
- :value="item.fId"
- ></el-option>
- </el-select>
- </el-form-item>
- </el-col>
- <el-col :xs="12" :sm="6">
- <el-form-item label="品名" prop="fGoodsid">
- <el-select
- filterable
- v-model="form.fGoodsid"
- placeholder="请选择品名"
- style="width: 100%"
- >
- <el-option
- v-for="(item, index) in goodsOptions"
- :key="index.fId"
- :label="item.fName"
- :value="item.fId"
- ></el-option>
- </el-select>
- </el-form-item>
- </el-col>
- <el-col :xs="12" :sm="6">
- <el-form-item label="品名属性" prop="fGoodsType">
- <el-select
- filterable
- v-model="form.fGoodsType"
- placeholder="请选择商品属性"
- style="width: 100%"
- >
- <el-option
- v-for="(item, index) in fStorageTypeOptions"
- :key="index.dictValue"
- :label="item.dictLabel"
- :value="item.dictValue"
- />
- </el-select>
- </el-form-item>
- </el-col>
- <el-col :xs="12" :sm="6">
- <el-form-item label="属性内容">
- <el-input
- v-model="form.fMarks"
- placeholder="请填写属性描述"
- clearable
- style="width: 100%"
- />
- </el-form-item>
- </el-col>
- <el-col :xs="12" :sm="6">
- <el-form-item label="车号" prop="fTruckno">
- <el-input
- v-model="form.fTruckno"
- placeholder="车号"
- clearable
- style="width: 100%"
- />
- </el-form-item>
- </el-col>
- <el-col :xs="12" :sm="6" v-if="form.fTrademodeid == 1 && showfCustomno == 1 ? true : false">
- <el-form-item
- label="报关单号"
- prop="fCustomno"
- :rules="{
- required: form.fTrademodeid == 1 && showfCustomno == 1 ? true : false,
- message: ' ',
- trigger: ['blur', 'change'],
- }"
- >
- <el-input
- v-model="form.fCustomno"
- style="width: 100%"
- placeholder="报关单号"
- />
- </el-form-item>
- </el-col>
- <el-col :xs="12" :sm="6">
- <el-form-item label="备注" label-width="80px">
- <el-input
- type="textarea"
- :autosize="{ minRows: 2, maxRows: 4}"
- placeholder="请输入备注"
- v-model="form.remark"
- style="width: 100%"
- >
- </el-input>
- </el-form-item>
- </el-col>
- </el-row>
- </el-form>
- <div>
- <!-- 列设置-->
- <el-dialog title="提示" :visible.sync="showSetting" width="700px" v-dialogDrag append-to-body>
- <template slot="title">
- <div class="avue-crud__dialog__header">
- <span class="el-dialog__title">
- <span
- style="display:inline-block;width:3px;height:20px;margin-right:5px; float: left;margin-top:2px"></span>
- </span>
- </div>
- </template>
- <div>配置排序列数据(拖动调整顺序)</div>
- <div style="margin-left: 17px">
- <el-checkbox
- v-model="allCheck"
- label="全选"
- @change="allChecked"
- ></el-checkbox>
- </div>
- <div style="padding: 4px; display: flex; justify-content: center">
- <draggable
- v-model="setRowList"
- group="site"
- animation="300"
- @start="onStart"
- @end="onEnd"
- handle=".indraggable"
- >
- <transition-group>
- <div
- v-for="item in setRowList"
- :key="item.surface"
- class="listStyle"
- >
- <div style="width: 500px" class="indraggable">
- <div class="progress" :style="{ width: item.width + 'px' }">
- <el-checkbox
- :label="item.name"
- v-model="item.checked"
- :true-label="0"
- :false-label="1"
- >{{ item.name }}
- </el-checkbox>
- </div>
- </div>
- <el-input-number
- v-model.number="item.width"
- controls-position="right"
- :min="1"
- :max="500"
- size="mini"
- ></el-input-number>
- </div>
- </transition-group>
- </draggable>
- </div>
- <span slot="footer" class="dialog-footer">
- <el-button @click="showSetting = false">取 消</el-button>
- <el-button @click="delRow" type="danger">重 置</el-button>
- <el-button type="primary" @click="save()">确 定</el-button>
- </span>
- </el-dialog>
- <el-tabs v-model="activeName">
- <el-tab-pane label="入库明细" name="inStockList">
- <div style="margin: 10px 10px">
- <el-button
- size="small"
- style="float:left;"
- type="primary"
- @click="addList"
- >
- 录入明细
- </el-button>
- <el-button type="primary" size="small" @click="downloadExcel">
- 下载模板
- </el-button>
- <el-button size="small" type="primary" @click="openUploadExcel"
- >导入Execl</el-button>
- <el-button
- icon="el-icon-setting"
- size="mini"
- circle
- @click="showSetting = !showSetting"
- style="float: right"
- ></el-button>
- </div>
- <el-table
- :data="detailList"
- tooltip-effect="dark"
- stripe
- ref="multipleTables"
- show-summary
- :summary-method="getSummaries"
- @selection-change="handleSelection"
- >
- <!-- <el-table-column type="selection" width="50" align="center" fixed/>-->
- <el-table-column
- label="序号"
- type="index"
- width="50"
- fixed
- align="center"
- />
- <el-table-column
- v-for="(item, index) in getRowList"
- :key="index"
- :label="item.name"
- :width="item.width"
- :prop="item.label"
- align="center"
- :fixed="item.fixed"
- :show-overflow-tooltip="true"
- sortable
- >
- <template slot-scope="scope">
- <span v-if="item.label == 'fCntrno'">
- <el-input
- v-model="scope.row.fCntrno"
- placeholder="箱号"
- clearable
- ></el-input>
- </span>
- <span v-else-if="item.label == 'fSealno'">
- <el-input
- v-model="scope.row.fSealno"
- placeholder="封号"
- clearable
- ></el-input>
- </span>
- <span v-else-if="item.label == 'fGoodsid'">
- <el-select
- filterable
- clearable
- v-model="scope.row.fGoodsid"
- placeholder="请选择品名"
- >
- <el-option
- v-for="(item, index) in goodsOptions"
- :key="index.fId"
- :label="item.fName"
- :value="item.fId"
- ></el-option>
- </el-select>
- </span>
- <span v-else-if="item.label == 'fBusinessType'">
- <el-select
- filterable
- v-model="scope.row.fBusinessType"
- placeholder="请选择商品属性"
- >
- <el-option
- v-for="(item, index) in fStorageTypeOptions"
- :key="index.dictValue"
- :label="item.dictLabel"
- :value="item.dictValue"
- />
- </el-select>
- </span>
- <span v-else-if="item.label == 'fMarks'">
- <el-input
- v-model="scope.row.fMarks"
- placeholder="属性详情"
- clearable
- ></el-input>
- </span>
- <span v-else-if="item.label == 'fWarehouseInformation'">
- <treeselect
- v-model="scope.row.fWarehouseInformation"
- :options="fWarehouseidOptions"
- :show-count="true"
- :disable-branch-nodes="true"
- placeholder="请选择库区"
- :append-to-body="true"
- z-index="9999"
- @select="(tree)=>{getAlltree(scope.row,tree)}"
- />
- </span>
- <span v-else-if="item.label == 'fQty'">
- <el-input
- v-model="scope.row.fQty"
- placeholder="件数"
- v-input-limit="0"
- clearable
- ></el-input>
- </span>
- <span v-else-if="item.label == 'fGrossweight'">
- <el-input
- v-model="scope.row.fGrossweight"
- placeholder="毛重"
- v-input-limit="2"
- clearable
- ></el-input>
- </span>
- <span v-else-if="item.label == 'fNetweight'">
- <el-input
- v-model="scope.row.fNetweight"
- placeholder="净重"
- v-input-limit="2"
- clearable
- ></el-input>
- </span>
- <span v-else-if="item.label == 'remark'">
- <el-input
- v-model="scope.row.remark"
- placeholder="备注"
- clearable
- ></el-input>
- </span>
- </template>
- </el-table-column>
- <el-table-column
- header-align="center"
- align="center"
- label="操作"
- width="160px"
- fixed="right"
- >
- <template slot-scope="scope">
- <el-button
- type="text"
- @click.native.prevent="wDeleteRow(scope.$index, detailList)"
- size="small"
- >移除
- </el-button
- >
- </template>
- </el-table-column>
- </el-table>
- </el-tab-pane>
- <el-tab-pane label="收款信息" name="DrList">
- <div style="margin: 10px 10px">
- <el-button
- size="small"
- style="float:left;"
- type="primary"
- @click="addDrList"
- >
- 新行
- </el-button>
- </div>
- <el-table
- ref="DrTable"
- :data="DrList"
- tooltip-effect="dark"
- stripe
- >
- <el-table-column label="序号" type="index" width="50" fixed></el-table-column>
- <el-table-column
- prop="fCorpid"
- header-align="center"
- align="center"
- width="300px"
- label="客户名称"
- >
- <template slot-scope="scope">
- <el-select
- v-model="scope.row.fCorpid"
- filterable
- clearable
- placeholder="客户名称"
- >
- <el-option
- v-for="(item, index) in fMblnoOptions"
- :key="index.fId"
- :label="item.fName"
- :value="item.fId"
- ></el-option>
- </el-select>
- </template>
- </el-table-column>
- <el-table-column
- prop="fFeeid"
- header-align="center"
- align="center"
- width="240px"
- label="费用名称"
- >
- <template slot-scope="scope">
- <el-select
- v-model="scope.row.fFeeid"
- clearable
- filterable
- placeholder="费用名称"
- >
- <el-option
- v-for="(item, index) in fDNameOptions"
- :key="index.fId"
- :label="item.fName"
- :value="item.fId"
- ></el-option>
- </el-select>
- </template>
- </el-table-column>
- <el-table-column
- prop="fFeeUnitid"
- header-align="center"
- align="center"
- width="180px"
- label="计价单位"
- >
- <template slot-scope="scope">
- <el-select
- v-model="scope.row.fFeeUnitid"
- placeholder="请选择计价单位"
- clearable
- @change="changeFeeUnit(scope.row)"
- >
- <el-option
- v-for="(item, index) in fFeetUnitOptions"
- :key="index.dictValue"
- :label="item.dictLabel"
- :value="item.dictValue"
- />
- </el-select>
- </template>
- </el-table-column>
- <el-table-column
- prop="fQty"
- header-align="center"
- align="center"
- width="130px"
- label="数量"
- >
- <template slot-scope="scope">
- <el-input
- oninput='this.value=this.value.replace(/[^\-?\d.]/g,"").replace(/^(\-)*(\d+)\.(\d\d).*$/, "$1$2.$3")'
- v-model="scope.row.fQty"
- placeholder="数量"
- @change="changeContractAmt(scope.row)"
- show-word-limit
- />
- </template>
- </el-table-column>
- <el-table-column
- prop="fUnitprice"
- header-align="center"
- align="center"
- width="130px"
- label="单价"
- >
- <template slot-scope="scope">
- <el-input
- oninput='this.value=this.value.replace(/[^\-?\d.]/g,"").replace(/^(\-)*(\d+)\.(\d\d).*$/, "$1$2.$3")'
- v-model="scope.row.fUnitprice"
- placeholder="单价"
- @change="changeContractAmt(scope.row)"
- show-word-limit
- />
- </template>
- </el-table-column>
- <el-table-column
- prop="fAmount"
- header-align="center"
- align="center"
- width="130px"
- label="金额"
- >
- <template slot-scope="scope">
- <el-input
- oninput='this.value=this.value.replace(/[^\-?\d.]/g,"").replace(/^(\-)*(\d+)\.(\d\d).*$/, "$1$2.$3")'
- v-model="scope.row.fAmount"
- placeholder="金额"
- show-word-limit
- />
- </template>
- </el-table-column>
- <el-table-column
- prop="fMblno"
- header-align="center"
- align="center"
- width="130px"
- label="提单号"
- >
- <template slot-scope="scope">
- <el-input
- v-model="scope.row.fMblno"
- placeholder="提单号"
- show-word-limit
- />
- </template>
- </el-table-column>
- <el-table-column
- prop="fProductName"
- header-align="center"
- align="center"
- width="140px"
- label="品名"
- >
- <template slot-scope="scope">
- <el-input
- v-model="scope.row.fProductName"
- placeholder="品名"
- show-word-limit
- />
- </template>
- </el-table-column>
- <el-table-column
- prop="fMarks"
- header-align="center"
- align="center"
- width="130px"
- label="品牌"
- >
- <template slot-scope="scope">
- <el-input
- v-model="scope.row.fMarks"
- placeholder="品牌"
- show-word-limit
- />
- </template>
- </el-table-column>
- <el-table-column
- prop="fSrcTypeId"
- header-align="center"
- align="center"
- width="130px"
- label="来源"
- >
- <template slot-scope="scope">
- <span v-if="scope.row.fSrcTypeId === 0">录入</span>
- <span v-if="scope.row.fSrcTypeId == 1">协议</span>
- <span v-if="scope.row.fSrcTypeId == 10">变更</span>
- </template>
- </el-table-column>
- <el-table-column
- prop="remark"
- header-align="center"
- align="center"
- width="150px"
- label="备注"
- >
- <template slot-scope="scope">
- <el-input
- v-model="scope.row.remark"
- placeholder="备注"
- show-word-limit
- />
- </template>
- </el-table-column>
- <el-table-column
- header-align="center"
- align="center"
- label="操作"
- width="200px"
- fixed="right"
- >
- <template slot-scope="scope">
- <el-button
- @click.native.prevent="deleteDrRow(scope.$index, DrList)"
- size="small"
- >移除
- </el-button>
- <el-button
- size="small"
- @click="listCheck(scope.row)"
- v-if="scope.row.fBillstatus < 6"
- >请核</el-button>
- <el-button
- size="small"
- @click="revokeListCheck(scope.row)"
- v-if="scope.row.fBillstatus == 6"
- >撤销请核</el-button>
- </template>
- </el-table-column>
- </el-table>
- <!-- 导入Excel-->
- <upload-excel
- ref="upexcel"
- :uploadExcelVisible="uploadExcel"
- @changeShow="showAddOrUpdate2"
- @adddetailList="adddetailList"
- ></upload-excel>
- </el-tab-pane>
- <!-- <el-tab-pane label="付款信息" name="CrList">-->
- <!-- </el-tab-pane>-->
- </el-tabs>
- </div>
- <!-- 打印-->
- <el-dialog
- append-to-body
- :close-on-click-modal="false"
- :modal="false"
- :visible.sync="printVisible"
- >
- <div id="print_rkd">
- <div style="text-align: center;font-size: 24px;margin-bottom: 5px;">{{ company }}入库单</div>
- <div class="print_table" style="display: flex">
- <table border="0" cellspacing="0" cellpadding="0" style="width: 100%; line-height: 30px">
- <tr>
- <td>客户名称</td>
- <td v-for="item in fMblnoOptions" v-if="item.fId == form.fCorpid">{{ item.fName }}</td>
- <td>入库日期</td>
- <td>{{ form.fBsdate | fBsdateFormat }}</td>
- <td>车号</td>
- <td>{{ form.fTruckno }}</td>
- <td>提单号</td>
- <td>{{ form.fMblno }}</td>
- </tr>
- <tr>
- <td>货名</td>
- <td>箱号</td>
- <td>封号</td>
- <td>件数</td>
- <td>毛重(吨)</td>
- <td>净重(吨)</td>
- <td>区位</td>
- <td>备注</td>
- </tr>
- <tr v-for="(item, index) in detailList" :key="index">
- <td v-for="row in goodsOptions" v-if="row.fId == item.fGoodsid">{{ row.fName }}</td>
- <td>{{ item.fCntrno }}</td>
- <td>{{ item.fSealno }}</td>
- <td>{{ item.fQty }}</td>
- <td v-if="item.fGrossweight">
- {{ (item.fGrossweight / 1000).toFixed(4) }}
- </td>
- <td v-else></td>
- <td>{{ (item.fNetweight/1000).toFixed(4)}}</td>
- <td>{{item.fWarehouseInformation}}</td>
- <td>{{ item.remark }}</td>
- </tr>
- <tr>
- <td>备注</td>
- <td colspan="4">{{ form.remark }}</td>
- <td>总件数</td>
- <td colspan="2">{{ allfQty }}</td>
- </tr>
- </table>
- </div>
- </div>
- <span slot="footer" class="dialog-footer">
- <el-button
- type="primary"
- @click="
- addprint('rkd');
- printVisible = false;
- "
- >打印
- </el-button>
- <el-button @click="printVisible = false">取消</el-button>
- </span>
- </el-dialog>
- <span slot="footer" class="dialog-footer">
- <el-button type="success" @click="handleSave">暂存</el-button>
- <el-button type="warning" @click="openPrint" :disabled="detailList.length == 0">打印</el-button>
- <el-button type="primary" @click="handleConfirm" :disabled="detailList.length == 0">确认入库</el-button>
- <el-button @click="closeDialog">取消</el-button>
- </span>
- </el-dialog>
- </template>
- <script>
- import {listCorps} from "@/api/basicdata/corps";
- import {
- treeselect,
- listWarehousesss,
- } from "@/api/basicdata/warehouse";
- import {listGoods} from "@/api/basicdata/goods";
- import Cookies from "js-cookie";
- import {addSet, resetModule, select} from '@/api/system/set';
- import draggable from "vuedraggable";
- import Treeselect from "@riophae/vue-treeselect";
- import "@riophae/vue-treeselect/dist/vue-treeselect.css";
- import {queryUserVal} from "@/api/system/user";
- import print from "print-js";
- import {fastInStock, saveInstock} from "@/api/warehouseBusiness/fastInStock";
- import {listFees, getFees} from "@/api/basicdata/fees";
- import uploadExcel from "./uploadExcel";
- import {feesCheck,revokefeeCheck} from "@/api/warehouseBusiness/warehouseInStock";
- export default {
- name: "fastInStock",
- props: {},
- components: {
- draggable,
- Treeselect,
- uploadExcel,
- },
- data() {
- return {
- loading: false,
- activeName: 'inStockList',
- visible: false,
- form: {},
- rules: {
- fCorpid: [{required: true, message: " ", trigger: "change"}],
- fMblno: [{required: true, message: " ", trigger: "blur"}],
- fBsdate: [{required: true, message: " ", trigger: "blur"}],
- fWarehouseid: [{required: true, message: " ", trigger: "change"}],
- fGoodsid: [{required: true, message: " ", trigger: "change"}],
- fBstime: [{required: true, message: " ", trigger: "blur"}],
- fTruckno: [{required: false, message: " ", trigger: "blur"}],
- },
- fMblnoOptions: [],
- // 仓库
- warehouseOptions: [],
- // 品名
- goodsOptions: [],
- // 品名属性
- fStorageTypeOptions: [],
- selection: [],
- detailList: [],
- fWarehouseidOptions: [],
- deptOptions: [],
- printVisible: false,
- company: '',
- allfQty: 0,
- userVal:'',
- DrList: [],
- // 收费
- fDNameOptions: [],
- // 计价单位
- fFeetUnitOptions: [],
- uploadExcel: false,
- // 设置列开关
- showSetting: false,
- setRowList: [],
- getRowList: [],
- tableDate: [
- {
- surface: "1",
- label: "fCntrno",
- name: "箱号",
- checked: 0,
- width: 100,
- },
- {
- surface: "2",
- label: "fSealno",
- name: "封号",
- checked: 0,
- width: 100,
- },
- {
- surface: "3",
- label: "fGoodsid",
- name: "品名",
- checked: 0,
- width: 150,
- },
- {
- surface: "4",
- label: "fBusinessType",
- name: "货物属性",
- checked: 0,
- width: 100,
- },
- {
- surface: "5",
- label: "fMarks",
- name: "属性详情",
- checked: 0,
- width: 100,
- },
- {
- surface: "6",
- label: "fWarehouseInformation",
- name: "库区",
- checked: 0,
- width: 200,
- },
- {
- surface: "7",
- label: "fQty",
- name: "件数",
- checked: 0,
- width: 120,
- },
- {
- surface: "8",
- label: "fNetweight",
- name: "净重(kg)",
- checked: 0,
- width: 120,
- },
- {
- surface: "9",
- label: "fGrossweight",
- name: "毛重(kg)",
- checked: 0,
- width: 120,
- },
- {
- surface: "10",
- label: "remark",
- name: "备注",
- checked: 0,
- width: 100,
- },
- ],
- showfCustomno: null,
- //自定义列宽
- allCheck: false,
- drag: false,
- }
- },
- created() {
- this.setRowList = this.tableDate;
- this.getRowList = this.tableDate;
- listCorps({type: 1}).then((response) => {
- this.fMblnoOptions = response.rows;
- });
- listWarehousesss({fStatus: 0, delFlag: 0}).then((response) => {
- this.warehouseOptions = response.rows;
- });
- listGoods({fStatus: 0, delFlag: 0}).then((response) => {
- this.goodsOptions = response.rows;
- });
- listFees({fDc: "D"}).then((response) => {
- this.fDNameOptions = response.rows;
- });
- this.getDicts("storage_type").then((response) => {
- this.fStorageTypeOptions = response.data;
- localStorage.setItem("fStorageTypeList", JSON.stringify(response.data));
- });
- this.getDicts("data_unitfees").then((response) => {
- this.fFeetUnitOptions = response.data;
- });
- this.getConfigKey("show_fCustomno").then((response) => {
- this.showfCustomno = response.msg;
- });
- this.getRow()
- },
- filters: {
- fBsdateFormat(row) {
- if (row) {
- const dateMat = new Date(row);
- const year = dateMat.getFullYear();
- const month = dateMat.getMonth() + 1;
- const day = dateMat.getDate();
- const timeFormat = year + "-" + month + "-" + day;
- return timeFormat;
- }
- },
- },
- methods: {
- // 打开
- init() {
- this.queryUser();
- this.company = Cookies.get("companyName")
- this.visible = true;
- },
- // 关闭弹窗
- closeDialog() {
- this.visible = false;
- this.form = {}
- this.detailList = []
- this.$refs.form.clearValidate();
- this.$emit("closeDialog")
- },
- //获取登陆人
- queryUser() {
- queryUserVal().then((response) => {
- if (response.user !== null) {
- this.userVal = response.user;
- this.$set(this.form, "fDeptid", this.userVal.deptId);
- this.$set(this.form, "createBy", this.userVal.userName);
- this.$set(this.form, "fStorekeeper", this.userVal.nickName);
- this.$set(this.form, "fIfdamage", "1");
- this.$set(this.form, "fIfweigh", "1");
- this.$set(this.form, "fTrademodeid", "1");
- this.$set(this.form, "createTime", Date.parse(new Date()));
- this.$set(this.form, "fBstime", Date.parse(new Date()));
- this.$set(this.form, "fFeetUnit", "2");
- this.$set(this.form, "fFeetunit", 2);
- this.$set(this.form, "fChargetype", "1");
- this.$set(this.form, "fBusinessType", "0");
- }
- if (response.dept !== null) {
- this.deptOptions = [];
- this.deptOptions.push(response.dept);
- }
- });
- },
- //从表库位弹窗下拉树状事件
- getAlltree(row, tree) {
- this.$set(row, 'fWarehouselocid', tree.id)
- this.$nextTick(() => {
- row.fWarehouseInformation = tree.fWarehouseInformation
- })
- },
- handleSelection(list) {
- this.selection = list
- },
- // 合计
- getSummaries(param) {
- const {columns, data} = param;
- const sums = [];
- var values = [];
- columns.forEach((column, index) => {
- if (index === 0) {
- sums[index] = "";
- return;
- }
- if (column.property === "fGrossweight") {
- values = data.map((item) => Number(item["fGrossweight"]));
- }
- if (column.property === "fNetweight") {
- values = data.map((item) => Number(item["fNetweight"]));
- }
- if (column.property === "fQty") {
- values = data.map((item) => Number(item["fQty"]));
- }
- if (column.property === "fCntqty") {
- values = data.map((item) => Number(item["fCntqty"]));
- }
- if (
- column.property === "fGrossweight" ||
- column.property === "fNetweight" ||
- column.property === "fQty" ||
- column.property === "fCntqty"
- ) {
- sums[index] = values.reduce((prev, curr) => {
- const value = Number(curr);
- if (!isNaN(value)) {
- if (column.property === "fGrossweight") {
- this.fGrossweight = prev + curr;
- }
- if (column.property === "fNetweight") {
- this.fNetweight = prev + curr;
- }
- if (column.property === "fQty") {
- this.fQty = prev + curr;
- this.sumMum = prev + curr;
- }
- if (column.property === "fCntqty") {
- this.fCntqty = prev + curr;
- }
- return prev + curr;
- } else {
- return prev;
- }
- }, 0);
- if (column.property === "fGrossweight") {
- sums[index] = (sums[index] / 1000).toFixed(4) + "吨";
- } else if (column.property === "fNetweight") {
- sums[index] = (sums[index] / 1000).toFixed(4) + "吨";
- } else {
- // sums[index] = sums[index].toFixed(2);
- sums[index] = sums[index]
- }
- }
- });
- this.sums = sums;
- return sums;
- },
- // 录入明细
- addList() {
- this.$refs["form"].validate((valid) => {
- if (valid) {
- let data = {
- fCntrno: null,
- fSealno: null,
- fGoodsid: this.form.fGoodsid,
- fBusinessType: this.form.fGoodsType,
- fMarks: this.form.fMarks,
- fWarehouseInformation: null,
- fQty: null,
- fGrossweight: 0,
- fNetweight: 0,
- remark: null
- }
- this.detailList.push(data)
- }
- })
- },
- // 新增应收明细
- addDrList() {
- this.$refs["form"].validate((valid) => {
- if (valid) {
- this.DrList.push({
- fCorpid: this.form.fCorpid,
- fMblno: this.form.fMblno,
- fFeeid: null,
- fFeeUnitid: null,
- fQty: null,
- fUnitprice: null,
- fAmount: null,
- fProductName: this.form.fProductName,
- fMarks: this.form.fMarks,
- fCurrency: "RMB",
- fExrate: "1",
- fTaxrate: null,
- fCxrate: null,
- fRate: null,
- fStltypeid: '1',
- fSrcTypeId: 0,
- fBusinessType: '0',
- remarks: null,
- fDc: 'D',
- })
- }
- })
- },
- changefWarehouseid() {
- treeselect(this.form.fWarehouseid).then((response) => {
- this.fWarehouseidOptions = response.data;
- });
- },
- // 确认入库
- handleConfirm() {
- this.$refs["form"].validate((valid) => {
- if (valid) {
- if (!this.form.fId) return this.$message.error('数据未保存,请先暂存')
- for (let item in this.detailList) {
- if (!this.detailList[item].fId) {
- return this.$message.error('数据未保存,请先暂存')
- }
- if (!this.detailList[item].fGoodsid) {
- return this.$message.error('第' + (Number(item) + 1) + '行品名不能为空')
- }
- if (!this.detailList[item].fWarehouseInformation) {
- return this.$message.error('第' + (Number(item) + 1) + '行库区不能为空')
- }
- this.goodsOptions.map((e) => {
- if (this.detailList[item].fGoodsid == e.fId) {
- if (e.ifCntrno == "1") {
- if (!this.detailList[item].fCntrno) {
- return this.$message.error('第' + (Number(item) + 1) + '行箱号不能为空')
- }
- }
- }
- });
- if (!this.detailList[item].fBusinessType) {
- return this.$message.error('第' + (Number(item) + 1) + '行属性不能为空')
- }
- if (!this.detailList[item].fMarks) {
- return this.$message.error('第' + (Number(item) + 1) + '行属性详情不能为空')
- }
- if (!this.detailList[item].fQty) {
- return this.$message.error('第' + (Number(item) + 1) + '行件数不能为空')
- }
- if (this.detailList[item].fNetweight == 0) {
- return this.$message.error('第' + (Number(item) + 1) + '行净重不能为空')
- }
- if (this.detailList[item].fGrossweight == 0) {
- return this.$message.error('第' + (Number(item) + 1) + '行毛重不能为空')
- }
- }
- let fPlanqty = 0;
- let fPlannetweight = 0;
- let fPlangrossweight = 0;
- this.detailList.forEach(item => {
- this.$set(item, 'fBsdate', this.form.fBsdate)
- this.$set(item, 'fChargedate', this.form.fBsdate)
- this.$set(item, 'fMblno', this.form.fMblno)
- this.$set(item, 'fOriginalbillno', this.form.fMblno)
- this.$set(item, 'fPlanqty', item.fQty)
- this.$set(item, 'fPlannetweight', item.fNetweight)
- this.$set(item, 'fPlangrossweight', item.fGrossweight)
- fPlanqty += Number(item.fQty)
- fPlannetweight += Number(item.fNetweight)
- fPlangrossweight += Number(item.fGrossweight)
- })
- this.$set(this.form, 'fPlanqty', fPlanqty)
- this.$set(this.form, 'fPlannetweight', fPlannetweight)
- this.$set(this.form, 'fPlangrossweight', fPlangrossweight)
- this.$set(this.form, 'fStltypeid', '1')
- this.$set(this.form, 'fChargedate', this.form.fBsdate)
- let fProductName = []
- this.detailList.map((e) => {
- this.goodsOptions.map((item) => {
- if (e.fGoodsid == item.fId) {
- fProductName.push(item.fName);
- }
- });
- });
- fProductName = [...new Set(fProductName)];
- this.form.fProductName = fProductName.join(",");
- let fMarks = []
- this.detailList.map((e) => {
- fMarks.push(e.fMarks);
- });
- fMarks = [...new Set(fMarks)];
- this.form.fMarks = fMarks.join(",");
- this.DrList.forEach(item => {
- this.$set(item, 'fFeeunitid', Number(item.fFeeUnitid))
- })
- let data = {warehousebillsitemsList: this.detailList,warehousebillsfeesList: this.DrList}
- data = Object.assign({}, data, this.form)
- this.loading = true
- fastInStock(data).then(res => {
- this.$message.success('入库成功')
- this.closeDialog()
- this.loading = false
- })
- }
- })
- },
- // 明细删除
- wDeleteRow(index, rows) {
- rows.splice(index, 1);
- this.sumMum = 0;
- this.detailList.map((e) => {
- if (e.fQty) {
- this.sumMum += e.fQty;
- }
- });
- if (this.detailList.length == 0) {
- this.form.fProductName = "";
- this.form.fMarks = "";
- this.form.fNetweight = 0;
- this.form.fPlanvolumn = 0;
- this.form.fGrossweight = 0;
- }
- },
- // 打开打印窗口
- openPrint() {
- for (let item in this.detailList) {
- if (!this.detailList[item].fId) {
- return this.$message.error('数据未保存,请先暂存')
- }
- if (!this.detailList[item].fCntrno) {
- return this.$message.error('第' + (Number(item) + 1) + '行箱号不能为空')
- }
- if (!this.detailList[item].fGoodsid) {
- return this.$message.error('第' + (Number(item) + 1) + '行品名不能为空')
- }
- if (!this.detailList[item].fBusinessType) {
- return this.$message.error('第' + (Number(item) + 1) + '行属性不能为空')
- }
- if (!this.detailList[item].fMarks) {
- return this.$message.error('第' + (Number(item) + 1) + '行属性详情不能为空')
- }
- if (!this.detailList[item].fQty) {
- return this.$message.error('第' + (Number(item) + 1) + '行件数不能为空')
- }
- }
- this.allfQty = 0;
- this.detailList.forEach(item => {
- this.allfQty += Number(item.fQty)
- })
- this.printVisible = true;
- },
- addprint(status) {
- const style =
- "@page { } " +
- "@media print { .print-div{ padding:8px;background-color:#cccccc;} .print-title{display:flex;justify-content: center;font-size:24px} .print_form{font-size:12px} .print_table table {border-right: 1px solid #000;border-bottom: 1px solid #000;font-size:12px} .print_table table td {border-left: 1px solid #000;border-top: 1px solid #000;padding:2px;vertical-align:middle;text-align: center;}";
- if (status == 'rkd') {
- print({
- printable: "print_rkd",
- type: "html",
- style: style, // 亦可使用引入的外部css;
- scanStyles: false,
- });
- }
- },
- // 暂存
- handleSave() {
- this.$refs["form"].validate(valid => {
- if (valid) {
- if (this.detailList.length !== 0) {
- for (let item in this.detailList) {
- if (!this.detailList[item].fGoodsid) {
- return this.$message.error('第' + (Number(item) + 1) + '行品名不能为空')
- }
- this.goodsOptions.map((e) => {
- if (this.detailList[item].fGoodsid == e.fId) {
- if (e.ifCntrno == "1") {
- if (!this.detailList[item].fCntrno) {
- return this.$message.error('第' + (Number(item) + 1) + '行箱号不能为空')
- }
- }
- }
- });
- if (!this.detailList[item].fBusinessType) {
- return this.$message.error('第' + (Number(item) + 1) + '行属性不能为空')
- }
- if (!this.detailList[item].fMarks) {
- return this.$message.error('第' + (Number(item) + 1) + '行属性详情不能为空')
- }
- if (!this.detailList[item].fQty) {
- return this.$message.error('第' + (Number(item) + 1) + '行件数不能为空')
- }
- }
- }
- let fPlanqty = 0;
- let fPlannetweight = 0;
- let fPlangrossweight = 0;
- this.detailList.forEach(item => {
- this.$set(item, 'fBsdate', this.form.fBsdate)
- this.$set(item, 'fChargedate', this.form.fBsdate)
- this.$set(item, 'fMblno', this.form.fMblno)
- this.$set(item, 'fOriginalbillno', this.form.fMblno)
- this.$set(item, 'fPlanqty', item.fQty)
- this.$set(item, 'fPlannetweight', item.fNetweight)
- this.$set(item, 'fPlangrossweight', item.fGrossweight)
- fPlanqty += Number(item.fQty)
- fPlannetweight += Number(item.fNetweight)
- fPlangrossweight += Number(item.fGrossweight)
- })
- this.$set(this.form, 'fPlanqty', fPlanqty)
- this.$set(this.form, 'fPlannetweight', fPlannetweight)
- this.$set(this.form, 'fPlangrossweight', fPlangrossweight)
- this.$set(this.form, 'fStltypeid', '1')
- this.$set(this.form, 'fChargedate', this.form.fBsdate)
- let fProductName = []
- this.detailList.map((e) => {
- this.goodsOptions.map((item) => {
- if (e.fGoodsid == item.fId) {
- fProductName.push(item.fName);
- }
- });
- });
- fProductName = [...new Set(fProductName)];
- this.form.fProductName = fProductName.join(",");
- let fMarks = []
- this.detailList.map((e) => {
- fMarks.push(e.fMarks);
- });
- fMarks = [...new Set(fMarks)];
- this.form.fMarks = fMarks.join(",");
- this.DrList.forEach(item => {
- this.$set(item, 'fFeeunitid', Number(item.fFeeUnitid))
- })
- let data = {warehousebillsitemsList: this.detailList,warehousebillsfeesList: this.DrList}
- data = Object.assign({}, data, this.form)
- this.loading = true
- saveInstock(data).then(res => {
- this.form = res.data
- this.detailList = res.data.warehousebillsitemsList
- this.DrList = res.data.warehousebillsfeesList
- delete this.form.warehousebillsitemsList
- delete this.form.warehousebillsfeesList
- this.form.fBsdate = this.form.bsDate
- this.form.fBstime = this.form.bsTime
- this.detailList.forEach(item => {
- item.fBusinessType = String(item.fBusinessType)
- })
- this.DrList.forEach(item => {
- this.$set(item, 'fFeeUnitid', String(item.fFeeunitid))
- })
- this.$message.success('暂存成功')
- this.loading = false
- })
- }
- })
- },
- changeFeeUnit() {},
- // 数量计算
- changeContractAmt(row) {
- let fQty = 0;
- let fUnitprice = 0;
- if (row.fUnitprice) {
- fUnitprice = row.fUnitprice;
- }
- if (row.fQty) {
- fQty = row.fQty;
- }
- this.$set(row, "fAmount", Number(fUnitprice) * Number(fQty)).toFixed(2);
- },
- // 收费明细删除
- deleteDrRow(index, rows) {
- rows.splice(index, 1);
- },
- // 下载模板
- downloadExcel() {
- window.location.href = "http://121.36.212.131:8080/file/入库模板.xlsx";
- },
- openUploadExcel() {
- this.$refs["form"].validate(valid => {
- if (valid) {
- this.uploadExcel = !this.uploadExcel;
- this.$refs.upexcel.init(this.form, this.detailList);
- }
- })
- },
- showAddOrUpdate2(data) {
- this.uploadExcel = data;
- },
- adddetailList(rows) {
- rows.map((e) => {
- e.fMblno = this.form.fMblno;
- e.fBillstatus = 10;
- });
- this.detailList.push(...rows);
- },
- // 费用明细请核
- listCheck(row) {
- feesCheck(row.fId).then(res => {
- this.$message.success('请核成功')
- res.data.fFeeUnitid = res.data.fFeeunitid.toString();
- if (res.data.fDc == 'D') {
- let index = this.DrList.findIndex(item => item.fId == res.data.fId)
- this.DrList.splice(index, 1, res.data)
- } else {
- // let index = this.warehouseCrList.findIndex(item => item.fId == res.data.fId)
- // this.warehouseCrList.splice(index, 1, res.data)
- }
- })
- },
- // 费用明细撤销请核
- revokeListCheck(row) {
- revokefeeCheck(row.fId).then(res => {
- res.data.fFeeUnitid = res.data.fFeeunitid.toString();
- this.$message.success('操作成功')
- if (res.data.fDc == 'D') {
- let index = this.DrList.findIndex(item => item.fId == res.data.fId)
- this.DrList.splice(index, 1, res.data)
- } else {
- // let index = this.CrList.findIndex(item => item.fId == res.data.fId)
- // this.CrList.splice(index, 1, res.data)
- }
- })
- },
- //列设置全选
- allChecked() {
- if (this.allCheck == true) {
- this.setRowList.map((e) => {
- return (e.checked = 0);
- });
- } else {
- this.setRowList.map((e) => {
- return (e.checked = 1);
- });
- }
- },
- //开始拖拽事件
- onStart() {
- this.drag = true;
- },
- //拖拽结束事件
- onEnd() {
- this.drag = false;
- },
- //重置列表
- delRow() {
- this.data = {
- tableName: "快速入库明细",
- userId: Cookies.get("userName"),
- };
- resetModule(this.data).then((res) => {
- if (res.code == 200) {
- this.showSetting = false;
- this.setRowList = this.tableDate;
- console.log(this.setRowList)
- this.getRowList = this.tableDate;
- }
- });
- },
- //保存列设置
- save() {
- this.showSetting = false;
- this.data = {
- tableName: "快速入库明细",
- userId: Cookies.get("userName"),
- sysTableSetList: this.setRowList,
- };
- addSet(this.data).then((res) => {
- this.getRowList = this.setRowList.filter((e) => e.checked == 0);
- });
- },
- //查询列数据
- getRow() {
- let that = this;
- this.data = {
- tableName: "快速入库明细",
- userId: Cookies.get("userName"),
- };
- select(this.data).then((res) => {
- if (res.data.length != 0) {
- this.getRowList = res.data.filter((e) => e.checked == 0);
- this.setRowList = res.data;
- this.setRowList = this.setRowList.reduce((res, item) => {
- res.push({
- surface: item.surface,
- label: item.label,
- name: item.name,
- checked: item.checked,
- width: item.width,
- fixed: item.fixed,
- });
- return res;
- }, []);
- }
- });
- },
- },
- }
- </script>
- <style scoped lang="scss">
- .print-div {
- color: #000;
- }
- .print_table {
- table {
- border-right: 1px solid #000;
- border-bottom: 1px solid #000;
- font-size: 12px;
- margin-bottom: 5px;
- }
- table td {
- border-left: 1px solid #000;
- border-top: 1px solid #000;
- vertical-align: middle;
- padding: 2px;
- text-align: center;
- }
- }
- .print_form {
- font-size: 12px;
- }
- /deep/ .el-tabs .el-tabs__content {
- overflow-x: visible !important;
- }
- </style>
|