12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127 |
- <template>
- <div class="detail-container">
- <div v-show="!isShowCheckOrder">
- <el-page-header @back="goBack" content="详情"></el-page-header>
- <div id="printData">
- <div class="main-title">
- <div class="title">工程订单</div>
- </div>
- <div class="diy-table-1">
- <el-row>
- <el-col :span="8" class="item">
- <div class="label">工程订单号</div>
- <div class="value">{{ detailData.enginOrderNo }}</div>
- </el-col>
- <el-col :span="8" class="item">
- <div class="label">订单日期</div>
- <div class="value">{{ detailData.orderDate }}</div>
- </el-col>
- <el-col :span="8" class="item">
- <div class="label">单据状态</div>
- <div class="value">
- {{ detailData.examineStatus | statusFilter }}
- </div>
- </el-col>
- <el-col :span="8" class="item">
- <div class="label">经销商编码</div>
- <div class="value">{{ detailData.customerNumber }}</div>
- </el-col>
- <el-col :span="8" class="item">
- <div class="label">经销商名称</div>
- <div class="value">{{ detailData.customerName }}</div>
- </el-col>
- <el-col :span="8" class="item">
- <div class="label">机型类别</div>
- <div class="value">{{ detailData.refMachineType }}</div>
- </el-col>
- <el-col :span="8" class="item">
- <div class="label">工程登录编号</div>
- <div class="value">{{ detailData.refEnginRecordNo }}</div>
- </el-col>
- <el-col :span="8" class="item">
- <div class="label">项目类别</div>
- <div class="value">{{ detailData.refProjectCategory }}</div>
- </el-col>
- <el-col :span="8" class="item">
- <div class="label">行业类别</div>
- <div class="value">{{ detailData.refTradeCategory }}</div>
- </el-col>
- <el-col :span="8" class="item">
- <div class="label">跨区厂编号</div>
- <div class="value">{{ detailData.refFactoryNo }}</div>
- </el-col>
- <el-col :span="8" class="item">
- <div class="label">使用单位</div>
- <div class="value">{{ detailData.refUseUnit }}</div>
- </el-col>
- <el-col :span="8" class="item">
- <div class="label">购买单位</div>
- <div class="value">{{ detailData.refBuyUnitName }}</div>
- </el-col>
- <el-col :span="8" class="item">
- <div class="label">区域</div>
- <div class="value">{{ detailData.refRegionWork }}</div>
- </el-col>
- <el-col :span="8" class="item">
- <div class="label">销售类型</div>
- <div class="value">{{ detailData.saleTypeName }}</div>
- </el-col>
- <el-col :span="8" class="item">
- <div class="label">第几次申报</div>
- <div class="value">{{ detailData.refDeclareNo }}</div>
- </el-col>
- <el-col :span="8" class="item">
- <div class="label">联系人</div>
- <div class="value">{{ detailData.refLinkman }}</div>
- </el-col>
- <el-col :span="8" class="item">
- <div class="label">固定电话</div>
- <div class="value">{{ detailData.refTel }}</div>
- </el-col>
- <el-col :span="8" class="item">
- <div class="label">移动电话</div>
- <div class="value">{{ detailData.refPhone }}</div>
- </el-col>
- <el-col :span="16" class="item">
- <div class="label">安装地址</div>
- <div class="value">{{ detailData.refInstallAddress }}</div>
- </el-col>
- <el-col :span="8" class="item">
- <div class="label">保证函</div>
- <div class="value">{{ detailData.refPromiseProvide }}</div>
- </el-col>
- <el-col :span="8" class="item">
- <div class="label">不扣押金</div>
- <div class="value">
- {{ detailData.takeDeposit ? '是' : '否' }}
- </div>
- </el-col>
- <el-col :span="8" class="item">
- <div class="label">文件编号</div>
- <div class="value">{{ detailData.fileNo }}</div>
- </el-col>
- <el-col :span="8" class="item">
- <div class="label">业务员</div>
- <div class="value">{{ detailData.serviceName }}</div>
- </el-col>
- <!-- <el-col :span="24" class="item">
- <div class="label">格力回复</div>
- <div class="value">{{detailData.note1}}</div>
- </el-col> -->
- <el-col :span="16" class="item">
- <div class="label">项目说明</div>
- <div class="value">{{ detailData.refProjectNote }}</div>
- </el-col>
- <el-col :span="8" class="item">
- <div class="label">项目类型</div>
- <div class="value">{{ detailData.refProjectType }}</div>
- </el-col>
- <el-col :span="24" class="item">
- <div class="label">其他附件审批意见</div>
- <div class="value">{{ detailData.refOtherAnnexIdea }}</div>
- </el-col>
- <el-col :span="24" class="item" v-if="!isDealer">
- <div class="label">格力内部备注</div>
- <div class="value">
- <el-input v-model="detailData.geLiInerNote" placeholder="请输入格力内部备注"></el-input>
- <el-divider direction="vertical"></el-divider>
- <el-button type="text" @click="saveRemark">保存备注</el-button>
- </div>
- </el-col>
- <el-col :span="24" class="item">
- <div class="label">备注</div>
- <div class="value">{{ detailData.remark }}</div>
- </el-col>
- <el-col :span="6" class="item">
- <div class="label">制单人</div>
- <div class="value">{{ detailData.createName }}</div>
- </el-col>
- <el-col :span="6" class="item">
- <div class="label">制单日期</div>
- <div class="value">{{ detailData.createTime }}</div>
- </el-col>
- <el-col :span="6" class="item">
- <div class="label">审核人</div>
- <div class="value">{{ detailData.confirmName }}</div>
- </el-col>
- <el-col :span="6" class="item">
- <div class="label">审核日期</div>
- <div class="value">{{ detailData.confirmTime }}</div>
- </el-col>
- <el-col :span="6" class="item">
- <div class="label">最后更新人</div>
- <div class="value">{{ detailData.updateName }}</div>
- </el-col>
- <el-col :span="6" class="item">
- <div class="label">最后更新日期</div>
- <div class="value">{{ detailData.updateTime }}</div>
- </el-col>
- <el-col :span="6" class="item">
- <div class="label">关闭人</div>
- <div class="value">{{ detailData.closeName }}</div>
- </el-col>
- <el-col :span="6" class="item">
- <div class="label">关闭日期</div>
- <div class="value">{{ detailData.closeTime }}</div>
- </el-col>
- <el-col :span="24" class="item">
- <div class="label">审批说明</div>
- <div class="value">{{ detailData.examineNote }}</div>
- </el-col>
- <el-col :span="24" class="item" v-if="!isDealer">
- <div class="label">引用记录</div>
- <div class="value">
- {{ detailData.items[0] && detailData.items[0].useRefCount }}
- </div>
- </el-col>
- </el-row>
- </div>
- <div class="main-title">
- <div class="title">货品信息</div>
- </div>
- <div class="table" style="margin-top: 20px">
- <el-table
- :data="detailData.items"
- element-loading-text="Loading"
- border
- fit
- highlight-current-row
- stripe
- max-height="400"
- show-summary
- :summary-method="$getSummaries"
- >
- <el-table-column align="center" label="序号" type="index" width="50"></el-table-column>
- <el-table-column
- align="left"
- label="销售类型"
- prop="saleTypeName"
- min-width="100"
- show-overflow-tooltip
- ></el-table-column>
- <el-table-column
- align="left"
- label="物料编码"
- prop="materialNumber"
- min-width="120"
- show-overflow-tooltip
- ></el-table-column>
- <el-table-column
- align="left"
- label="产品编码"
- prop="materialOldNumber"
- min-width="120"
- show-overflow-tooltip
- ></el-table-column>
- <el-table-column
- align="left"
- label="产品名称"
- prop="materialName"
- min-width="160"
- show-overflow-tooltip
- ></el-table-column>
- <el-table-column
- align="left"
- label="规格型号"
- prop="specification"
- min-width="350"
- show-overflow-tooltip
- ></el-table-column>
- <el-table-column
- align="left"
- label="实装规格型号"
- prop="realSpecification"
- min-width="300"
- show-overflow-tooltip
- >
- <template slot-scope="scope">
- <div :style="scope.row.realSpecification != scope.row.specification ? { color: 'blue' } : ''">
- {{ scope.row.realSpecification }}
- </div>
- </template>
- </el-table-column>
- <el-table-column
- align="right"
- label="数量"
- prop="qty"
- min-width="100"
- show-overflow-tooltip
- ></el-table-column>
- <el-table-column align="right" label="单价" prop="price" min-width="100" show-overflow-tooltip>
- <template slot-scope="scope">
- {{ scope.row.price | numToFixed }}
- </template>
- </el-table-column>
- <el-table-column align="right" label="订单金额" prop="totalAmount" min-width="100" show-overflow-tooltip>
- <template slot-scope="scope">
- {{ scope.row.totalAmount | numToFixed }}
- </template>
- </el-table-column>
- <el-table-column
- align="right"
- label="工程登录数量"
- prop="enginNum"
- min-width="120"
- show-overflow-tooltip
- ></el-table-column>
- <el-table-column
- align="left"
- label="现金钱包"
- prop="customerWalletName"
- min-width="100"
- show-overflow-tooltip
- ></el-table-column>
- <el-table-column
- align="right"
- label="返利类型"
- prop="customerWalletName2"
- min-width="100"
- show-overflow-tooltip
- ></el-table-column>
- <el-table-column
- align="right"
- label="实付返利金额"
- prop="payRebateAmount"
- min-width="100"
- show-overflow-tooltip
- >
- <template slot-scope="scope">
- {{ scope.row.payRebateAmount | numToFixed }}
- </template>
- </el-table-column>
- <el-table-column align="right" label="格力折扣" prop="discAmount" min-width="100" show-overflow-tooltip>
- <template slot-scope="scope">
- {{ scope.row.discAmount | numToFixed }}
- </template>
- </el-table-column>
- <el-table-column align="right" label="实付金额" prop="payAmount" min-width="100" show-overflow-tooltip>
- <template slot-scope="scope">
- {{ scope.row.payAmount | numToFixed }}
- </template>
- </el-table-column>
- <el-table-column
- align="left"
- label="是否直调"
- prop="isDirectTransfer"
- min-width="100"
- show-overflow-tooltip
- >
- <template slot-scope="scope">
- {{ scope.row.isDirectTransfer ? '是' : '否' }}
- </template>
- </el-table-column>
- <el-table-column
- align="right"
- label="直调数量"
- prop="directTransferQty"
- min-width="100"
- show-overflow-tooltip
- ></el-table-column>
- <el-table-column
- align="right"
- label="已发货数量"
- prop="hasSendQty"
- min-width="100"
- show-overflow-tooltip
- ></el-table-column>
- <!-- <el-table-column align="right" label="原订单数量" prop="oldQty" min-width="100" show-overflow-tooltip></el-table-column> -->
- <el-table-column
- align="left"
- label="备注"
- prop="remark"
- min-width="160"
- show-overflow-tooltip
- ></el-table-column>
- <el-table-column
- align="left"
- label="实装物料编号"
- prop="realMaterialNumber"
- min-width="150"
- show-overflow-tooltip
- >
- <template slot-scope="scope">
- <div :style="scope.row.realMaterialNumber != scope.row.materialNumber ? { color: 'blue' } : ''">
- {{ scope.row.realMaterialNumber }}
- </div>
- </template>
- </el-table-column>
- <el-table-column
- align="left"
- label="实装厂产品编码"
- prop="realMaterialOldNumber"
- min-width="200"
- show-overflow-tooltip
- >
- <template slot-scope="scope">
- <div :style="scope.row.realMaterialOldNumber != scope.row.materialOldNumber ? { color: 'blue' } : ''">
- {{ scope.row.realMaterialOldNumber }}
- </div>
- </template>
- </el-table-column>
- <el-table-column
- align="left"
- label="税率"
- prop="tax"
- min-width="100"
- show-overflow-tooltip
- ></el-table-column>
- <el-table-column
- align="left"
- label="单位"
- prop="unit"
- min-width="100"
- show-overflow-tooltip
- ></el-table-column>
- </el-table>
- </div>
- </div>
- <div class="page-footer">
- <div class="footer">
- <el-button type="success" @click="toCheckOrder">联查单据</el-button>
- <el-button
- type="danger"
- @click="closeData"
- v-if="!isDealer && (detailData.examineStatus === 'SAVE' || detailData.examineStatus === 'WAIT')"
- >关闭订单</el-button
- >
- <!-- <el-button type="primary" @click="openDirectDialog" v-if="!isDealer">提前开票</el-button> -->
- <el-button type="primary" @click="overData" :disabled="detailData.directTransferStatus" v-if="!isDealer"
- >直调完结</el-button
- >
- <el-button
- type="primary"
- @click="openDeliverDialog"
- :disabled="detailData.directTransferStatus"
- v-if="!isDealer"
- >直调发货</el-button
- >
- <el-button @click="goBack">返回列表</el-button>
- </div>
- </div>
- </div>
- <el-dialog title="直调发货" :visible.sync="isShowDeliverDialog" width="80%">
- <el-form
- ref="deliverForm"
- :model="deliverForm"
- :rules="deliverFormRules"
- label-width="120px"
- size="small"
- label-position="left"
- >
- <el-row :gutter="20">
- <!-- <el-col :xs="8" :sm="8" :lg="8" style="height: 51px">-->
- <!-- <el-form-item label="发货日期" prop="date">-->
- <!-- <el-date-picker-->
- <!-- v-model="deliverForm.date"-->
- <!-- type="date"-->
- <!-- value-format="yyyy-MM-dd"-->
- <!-- style="width: 100%"-->
- <!-- placeholder="选择日期"-->
- <!-- >-->
- <!-- </el-date-picker>-->
- <!-- </el-form-item>-->
- <!-- </el-col>-->
- <el-col :xs="8" :sm="8" :lg="8">
- <el-form-item label="选择仓位" prop="position">
- <el-select v-model="deliverForm.position" placeholder="请选择仓位" style="width: 100%" filterable>
- <el-option v-for="item in positionList" :key="item.id" :label="item.name" :value="item.id"></el-option>
- </el-select>
- </el-form-item>
- </el-col>
- <el-col :xs="8" :sm="8" :lg="8">
- <el-form-item label="发货申请备注" prop="remark">
- <el-input v-model="deliverForm.remark" placeholder="请输入发货申请备注" clearable></el-input>
- </el-form-item>
- </el-col>
- </el-row>
- </el-form>
- <div class="table" style="margin-top: 20px">
- <el-table
- :data="deliverGoodsList"
- element-loading-text="Loading"
- border
- fit
- highlight-current-row
- stripe
- max-height="400"
- >
- <el-table-column align="center" label="序号" type="index" width="50"></el-table-column>
- <el-table-column
- align="center"
- label="销售类型"
- prop="saleTypeName"
- min-width="100"
- show-overflow-tooltip
- ></el-table-column>
- <el-table-column
- align="center"
- label="物料编码"
- prop="materialNumber"
- min-width="160"
- show-overflow-tooltip
- ></el-table-column>
- <el-table-column
- align="center"
- label="产品名称"
- prop="materialName"
- min-width="160"
- show-overflow-tooltip
- ></el-table-column>
- <el-table-column
- align="center"
- label="规格型号"
- prop="specification"
- min-width="160"
- show-overflow-tooltip
- ></el-table-column>
- <el-table-column
- align="center"
- label="单位"
- prop="unit"
- min-width="100"
- show-overflow-tooltip
- ></el-table-column>
- <el-table-column
- align="right"
- label="订单数量"
- prop="qty"
- min-width="100"
- show-overflow-tooltip
- ></el-table-column>
- <el-table-column
- align="right"
- label="发货数量"
- prop="hasSendQty"
- min-width="100"
- show-overflow-tooltip
- ></el-table-column>
- <el-table-column
- align="right"
- label="直调数量"
- prop="directTransferQty"
- min-width="100"
- show-overflow-tooltip
- >
- <template slot-scope="scope">
- <el-input
- v-model="scope.row.realDirectTransferQty"
- :disabled="!scope.row.isDirectTransfer"
- size="small"
- type="number"
- @mousewheel.native.prevent
- ></el-input>
- </template>
- </el-table-column>
- <el-table-column
- align="right"
- label="单价"
- prop="price"
- min-width="100"
- show-overflow-tooltip
- ></el-table-column>
- <el-table-column
- align="right"
- label="金额"
- prop="totalAmount"
- min-width="100"
- show-overflow-tooltip
- ></el-table-column>
- <el-table-column
- align="right"
- label="实际返利金额"
- prop="payRebateAmount"
- min-width="110"
- show-overflow-tooltip
- ></el-table-column>
- <el-table-column
- align="center"
- label="备注"
- prop="remark"
- min-width="160"
- show-overflow-tooltip
- ></el-table-column>
- </el-table>
- </div>
- <span slot="footer" class="dialog-footer">
- <el-button @click="closeDeliverDialog">取 消</el-button>
- <el-button type="primary" @click="submitDeliverForm" :loading="formLoading">确 定</el-button>
- </span>
- </el-dialog>
- <el-dialog title="直接调拨单(提前开票)" :visible.sync="isShowDirectDialog" width="80%">
- <el-form
- ref="directForm"
- :model="directForm"
- :rules="directFormRules"
- label-width="80px"
- size="small"
- label-position="left"
- >
- <el-row :gutter="20">
- <el-col :xs="12" :sm="6" :lg="6">
- <el-form-item label="调出仓库" prop="warehouse1">
- <el-select
- v-model="directForm.warehouse1"
- placeholder="请选择调出仓库"
- style="width: 100%"
- filterable
- @change="changeWarehouse1"
- >
- <el-option
- v-for="item in warehouseList1"
- :key="item.id"
- :label="item.name"
- :value="item.id"
- ></el-option>
- </el-select>
- </el-form-item>
- </el-col>
- <el-col :xs="12" :sm="6" :lg="6">
- <el-form-item label="调出仓位" prop="position1">
- <el-select
- v-model="directForm.position1"
- placeholder="请调出仓位"
- style="width: 100%"
- filterable
- @change="changePosition1"
- >
- <el-option v-for="item in positionList1" :key="item.id" :label="item.name" :value="item.id"></el-option>
- </el-select>
- </el-form-item>
- </el-col>
- <el-col :xs="12" :sm="6" :lg="6">
- <el-form-item label="调入仓库" prop="warehouse2">
- <el-select
- v-model="directForm.warehouse2"
- placeholder="请选择调入仓库"
- style="width: 100%"
- filterable
- @change="changeWarehouse2"
- >
- <el-option
- v-for="item in warehouseList2"
- :key="item.id"
- :label="item.name"
- :value="item.id"
- ></el-option>
- </el-select>
- </el-form-item>
- </el-col>
- <el-col :xs="12" :sm="6" :lg="6">
- <el-form-item label="调入仓位" prop="position2">
- <el-select
- v-model="directForm.position2"
- placeholder="请调入仓位"
- style="width: 100%"
- filterable
- @change="changePosition2"
- >
- <el-option v-for="item in positionList2" :key="item.id" :label="item.name" :value="item.id"></el-option>
- </el-select>
- </el-form-item>
- </el-col>
- </el-row>
- </el-form>
- <div class="table" style="margin-top: 20px">
- <el-table
- :data="directGoodsList"
- element-loading-text="Loading"
- border
- fit
- highlight-current-row
- stripe
- max-height="400"
- >
- <el-table-column align="center" label="序号" type="index" width="50"></el-table-column>
- <el-table-column
- align="center"
- label="销售类型"
- prop="saleTypeName"
- min-width="100"
- show-overflow-tooltip
- ></el-table-column>
- <el-table-column
- align="center"
- label="物料代码"
- prop="materialNumber"
- min-width="160"
- show-overflow-tooltip
- ></el-table-column>
- <el-table-column
- align="center"
- label="产品编码"
- prop="materialOldNumber"
- min-width="160"
- show-overflow-tooltip
- ></el-table-column>
- <el-table-column
- align="center"
- label="产品名称"
- prop="materialName"
- min-width="160"
- show-overflow-tooltip
- ></el-table-column>
- <el-table-column
- align="center"
- label="规格型号"
- prop="specification"
- min-width="160"
- show-overflow-tooltip
- ></el-table-column>
- <el-table-column
- align="center"
- label="单位"
- prop="unit"
- min-width="100"
- show-overflow-tooltip
- ></el-table-column>
- <el-table-column
- align="center"
- label="数量"
- prop="qty"
- min-width="100"
- show-overflow-tooltip
- ></el-table-column>
- <el-table-column
- align="center"
- label="调出仓库"
- prop="warehouse1"
- min-width="100"
- show-overflow-tooltip
- ></el-table-column>
- <el-table-column
- align="center"
- label="调出仓位"
- prop="position1"
- min-width="100"
- show-overflow-tooltip
- ></el-table-column>
- <el-table-column
- align="center"
- label="调入仓库"
- prop="warehouse2"
- min-width="100"
- show-overflow-tooltip
- ></el-table-column>
- <el-table-column
- align="center"
- label="调入仓位"
- prop="position2"
- min-width="100"
- show-overflow-tooltip
- ></el-table-column>
- <el-table-column
- align="center"
- label="调出库存状态"
- prop="status1"
- min-width="110"
- show-overflow-tooltip
- ></el-table-column>
- <el-table-column
- align="center"
- label="调入库存状态"
- prop="status2"
- min-width="110"
- show-overflow-tooltip
- ></el-table-column>
- <el-table-column align="center" label="调出货主" min-width="100" show-overflow-tooltip>
- <template slot-scope="">弘格</template>
- </el-table-column>
- <el-table-column align="center" label="调入货主" min-width="100" show-overflow-tooltip>
- <template slot-="scope">弘格</template>
- </el-table-column>
- <el-table-column
- align="center"
- label="备注"
- prop="remark"
- min-width="160"
- show-overflow-tooltip
- ></el-table-column>
- </el-table>
- </div>
- <span slot="footer" class="dialog-footer">
- <el-button @click="closeDirectDialog">取 消</el-button>
- <el-button type="primary" @click="submitDirectForm" :loading="formLoading">确 定</el-button>
- </span>
- </el-dialog>
- <CheckOrder :checkOrderId="checkOrderId" v-if="isShowCheckOrder" @backDetail="backDetail" />
- </div>
- </template>
- <script>
- import {
- getOrderDetail,
- closeHome,
- overOrder,
- getWarehouseList,
- deliverOrder,
- directOrder,
- getPositionList,
- editRemarkHome
- } from '@/api/supply/engin'
- import CheckOrder from '@/components/Common/check-order'
- export default {
- name: 'HomeDetail',
- componentName: 'HomeDetail',
- components: {
- CheckOrder
- },
- props: ['listItem'],
- filters: {
- statusFilter(val) {
- const statusList = [
- { label: '已保存', value: 'SAVE' },
- { label: '待审核', value: 'WAIT' },
- { label: '审核通过', value: 'OK' },
- // { label: '审核驳回', value: 'FAIL' },,
- { label: '已关闭', value: 'CLOSE' }
- ]
- let obj = statusList.find(o => o.value == val)
- return obj ? obj.label : ''
- }
- },
- data() {
- return {
- detailData: {},
- isShowDeliverDialog: false,
- deliverForm: {
- date: '',
- position: '',
- remark: ''
- },
- deliverFormRules: {
- // date: [
- // { required: true, message: "请选择发货日期", trigger: "change" },
- // ],
- position: [{ required: true, message: '请选择仓位', trigger: 'change' }]
- },
- positionList: [],
- deliverGoodsList: [],
- isShowDirectDialog: false,
- directForm: {
- warehouse1: '',
- position1: '',
- warehouse2: '',
- position2: ''
- },
- directFormRules: {
- warehouse1: [{ required: true, message: '请选择调出仓库', trigger: 'change' }],
- position1: [{ required: true, message: '请选择调出仓位', trigger: 'change' }],
- warehouse2: [{ required: true, message: '请选择调入仓库', trigger: 'change' }],
- position2: [{ required: true, message: '请选择调入仓位', trigger: 'change' }]
- },
- warehouseList1: [],
- warehouseList2: [],
- positionList1: [],
- positionList2: [],
- directGoodsList: [],
- formLoading: false,
- checkOrderId: {},
- isShowCheckOrder: false
- }
- },
- computed: {
- isExamine() {
- return this.detailData.examineStatus === 'OK' || this.detailData.examineStatus === 'FAIL'
- },
- isDealer() {
- console.log(JSON.parse(localStorage.getItem('supply_user')).isCustomer, '898')
- return JSON.parse(localStorage.getItem('supply_user')).isCustomer
- }
- },
- created() {
- this.getDetail()
- },
- methods: {
- // 返回列表
- goBack() {
- this.$emit('backListFormDetail')
- },
- // 获取仓库列表
- getWarehouseList() {
- getWarehouseList({
- pageNum: 1,
- pageSize: -1
- }).then(res => {
- this.warehouseList1 = res.data.records
- this.warehouseList2 = res.data.records
- })
- },
- // 获取虚拟仓位列表
- getPositionList() {
- getPositionList({
- pageNum: 1,
- pageSize: -1,
- type: 2
- }).then(res => {
- this.positionList = res.data.records
- })
- },
- // 获取详情
- getDetail() {
- getOrderDetail({ id: this.listItem.parentId }).then(res => {
- if (res.data.items) {
- res.data.items.forEach(item => {
- item.number = (item.qty * 100 - item.retiredQty * 100) / 100
- item.sums1 = ['number', 'directTransferQty', 'qty', 'enginNum', 'oldQty', 'hasSendQty']
- item.sums2 = ['totalAmount', 'payAmount', 'price', 'payRebateAmount', 'discAmount']
- })
- }
- this.detailData = res.data
- })
- },
- // 关闭订单
- closeData() {
- this.$confirm('此操作将关闭订单, 是否继续?', '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning'
- })
- .then(() => {
- closeHome({
- id: this.listItem.parentId,
- refEnginRecordNo: this.detailData.refEnginRecordNo
- }).then(res => {
- this.$successMsg()
- this.getDetail()
- })
- })
- .catch(() => {})
- },
- // 直调完结
- overData() {
- this.$confirm('此操作将直调完结订单, 是否继续?', '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning'
- })
- .then(() => {
- overOrder({
- id: this.listItem.parentId,
- refEnginRecordNo: this.detailData.refEnginRecordNo
- }).then(res => {
- this.$successMsg()
- this.getDetail()
- })
- })
- .catch(() => {})
- },
- // 更改仓库
- changeWarehouse() {
- this.deliverForm.position = ''
- let obj = this.warehouseList.find(o => o.id == this.deliverForm.warehouse)
- this.positionList = obj.kingDeeStocks
- },
- // 打开 直调发货
- openDeliverDialog() {
- this.isShowDeliverDialog = true
- this.deliverGoodsList = this.detailData.items
- this.deliverGoodsList.forEach(item => {
- item.warehouse1 = ''
- item.warehouse2 = ''
- item.position1 = ''
- item.position2 = ''
- item.status1 = ''
- item.status2 = ''
- this.$set(item, 'realDirectTransferQty', item.refundableQty)
- })
- this.getPositionList()
- },
- // 关闭 直调发货
- closeDeliverDialog() {
- this.isShowDeliverDialog = false
- },
- // 提交 直调发货
- submitDeliverForm() {
- this.$refs.deliverForm.validate(valid => {
- if (valid) {
- for (let i = 0; i < this.deliverGoodsList.length; i++) {
- if (!this.deliverGoodsList[i].directTransferQty && this.deliverGoodsList[i].directTransferQty !== 0) {
- this.$errorMsg('请输入直调数量')
- return
- }
- }
- let params = {
- enginOrderId: this.detailData.enginOrderId,
- enginOrderType: 'HOME', // TRADE=商用 HOME=家用
- deliverDate: '',
- correspondId: this.deliverForm.position,
- remark: this.deliverForm.remark,
- refEnginRecordNo: this.detailData.refEnginRecordNo,
- items: this.deliverGoodsList
- }
- this.formLoading = true
- deliverOrder(params)
- .then(res => {
- this.$successMsg()
- this.isShowDeliverDialog = false
- this.getDetail()
- })
- .finally(res => {
- this.formLoading = false
- })
- }
- })
- },
- // 更改调出仓库
- changeWarehouse1() {
- this.directForm.position1 = ''
- let obj = this.warehouseList1.find(o => o.id == this.directForm.warehouse1)
- this.positionList1 = obj.kingDeeStocks
- this.directGoodsList.forEach(item => {
- item.warehouse1 = obj.name
- })
- },
- // 更改调入仓库
- changeWarehouse2() {
- this.directForm.position2 = ''
- let obj = this.warehouseList2.find(o => o.id == this.directForm.warehouse2)
- this.positionList2 = obj.kingDeeStocks
- this.directGoodsList.forEach(item => {
- item.warehouse2 = obj.name
- })
- },
- // 更改调出仓位
- changePosition1() {
- let obj = this.positionList1.find(o => o.id == this.directForm.position1)
- this.directGoodsList.forEach(item => {
- item.position1 = obj.name
- item.status1 = obj.defStockStatusName
- })
- },
- // 更改调入仓位
- changePosition2() {
- let obj = this.positionList2.find(o => o.id == this.directForm.position2)
- this.directGoodsList.forEach(item => {
- item.position2 = obj.name
- item.status2 = obj.defStockStatusName
- })
- },
- // 打开 提前开票
- openDirectDialog() {
- this.isShowDirectDialog = true
- this.directGoodsList = this.detailData.items
- this.getWarehouseList()
- },
- // 关闭 提前开票
- closeDirectDialog() {
- this.isShowDirectDialog = false
- },
- // 提交 提前开票
- submitDirectForm() {
- this.$refs.directForm.validate(valid => {
- if (valid) {
- let warehouseItem1 = this.warehouseList1.find(o => o.id == this.directForm.warehouse1)
- let positionItem1 = this.positionList1.find(o => o.id == this.directForm.position1)
- let warehouseItem2 = this.warehouseList2.find(o => o.id == this.directForm.warehouse2)
- let positionItem2 = this.positionList2.find(o => o.id == this.directForm.position2)
- let params = {
- orderNo: this.detailData.enginOrderId,
- orderType: 'HOME', // TRADE=商用 HOME=家用 RETAIL=零售单 RETAIL_POLICY 销售政策单
- correspondId: this.directForm.warehouse1,
- correspondName: warehouseItem1.name,
- stockId: this.directForm.position1,
- stockName: positionItem1.name,
- inCorrespondId: this.directForm.warehouse2,
- inCorrespondName: warehouseItem2.name,
- inStockId: this.directForm.position2,
- inStockName: positionItem2.name,
- refEnginRecordNo: this.detailData.refEnginRecordNo || ''
- }
- this.formLoading = true
- directOrder(params)
- .then(res => {
- this.$successMsg()
- this.isShowDirectDialog = false
- this.getDetail()
- })
- .finally(res => {
- this.formLoading = false
- })
- }
- })
- },
- // 联查单据
- toCheckOrder() {
- this.checkOrderId = this.detailData.enginOrderId
- this.isShowCheckOrder = true
- },
- // 保存备注
- saveRemark() {
- editRemarkHome({
- enginOrderId: this.detailData.enginOrderId,
- geLiInerNote: this.detailData.geLiInerNote,
- refEnginRecordNo: this.detailData.refEnginRecordNo
- }).then(res => {
- this.$successMsg('编辑成功')
- this.getDetail()
- })
- },
- backDetail() {
- this.isShowCheckOrder = false
- }
- }
- }
- </script>
- <style scoped lang="scss">
- .detail-container {
- width: 100%;
- height: 100%;
- }
- .main-title {
- display: flex;
- justify-content: space-between;
- align-items: center;
- margin-top: 20px;
- height: 60px;
- border-bottom: 1px solid #dcdfe6;
- margin-bottom: 20px;
- .title {
- font-size: 16px;
- font-weight: 600;
- padding-left: 10px;
- }
- }
- </style>
|