123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038 |
- <template>
- <div class="detail-container">
- <div v-show="!isShowCheckOrder">
- <el-page-header content="详情" @back="goBack" />
- <div class="main-title">
- <div class="title">提货进度</div>
- </div>
- <div class="progress-container">
- <el-progress
- :text-inside="true"
- :stroke-width="26"
- :percentage="
- detailData.thjd ? +((detailData.thjd * 1000) / 10).toFixed(2) : 0
- "
- />
- </div>
- <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.id }}</div>
- </el-col>
- <el-col :span="8" class="item">
- <div class="label">订单日期</div>
- <div class="value">{{ detailData.theTime }}</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="16" class="item">
- <div class="label">备注</div>
- <div class="value">{{ detailData.remark }}</div>
- </el-col>
- <el-col :span="8" class="item">
- <div class="label">业务员</div>
- <div class="value">{{ detailData.k3ServiceName }}</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.createName }}</div>
- </el-col>
- <el-col :span="8" class="item">
- <div class="label">制单日期</div>
- <div class="value">{{ detailData.createTime }}</div>
- </el-col>
- <el-col :span="8" class="item">
- <div class="label">审核人</div>
- <div class="value">{{ detailData.examineName }}</div>
- </el-col>
- <el-col :span="8" class="item">
- <div class="label">审核日期</div>
- <div class="value">{{ detailData.examineTime }}</div>
- </el-col>
- <el-col :span="8" class="item">
- <div class="label">关闭人</div>
- <div class="value">{{ detailData.closeName }}</div>
- </el-col>
- <el-col :span="8" class="item">
- <div class="label">关闭日期</div>
- <div class="value">{{ detailData.closeTime }}</div>
- </el-col>
- <el-col :span="16" class="item">
- <div class="label">销售政策说明</div>
- <div class="value">{{ detailData.policyRemark }}</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.retailOrderItemList"
- element-loading-text="Loading"
- border
- fit
- highlight-current-row
- stripe
- max-height="400"
- show-summary
- :summary-method="$getSummaries"
- >
- <el-table-column align="left" label="序号" type="index" width="50" />
- <el-table-column
- align="left"
- label="销售类型"
- prop="saleTypeName"
- min-width="100"
- show-overflow-tooltip
- />
- <el-table-column
- align="left"
- label="物料编码"
- prop="materialCode"
- min-width="160"
- show-overflow-tooltip
- >
- <template slot-scope="scope">
- <CopyButton :copyText="scope.row.materialCode" />
- <span>{{scope.row.materialCode}}</span>
- </template>
- </el-table-column>
- <el-table-column
- align="left"
- label="产品名称"
- prop="materialName"
- min-width="160"
- show-overflow-tooltip
- >
- <template slot-scope="scope">
- <CopyButton :copyText="scope.row.materialName" />
- <span>{{scope.row.materialName}}</span>
- </template>
- </el-table-column>
- <el-table-column
- align="left"
- label="规格型号"
- prop="specification"
- min-width="160"
- show-overflow-tooltip
- >
- <template slot-scope="scope">
- <CopyButton :copyText="scope.row.specification" />
- <span>{{scope.row.specification}}</span>
- </template>
- </el-table-column>
- <el-table-column
- align="left"
- label="单位"
- prop="unit"
- min-width="100"
- show-overflow-tooltip
- />
- <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="qty"
- min-width="100"
- show-overflow-tooltip
- />
- <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="left"
- label="返利类型"
- prop="customerWalletName2"
- min-width="100"
- show-overflow-tooltip
- >
- <template slot-scope="scope">
- <!-- v-for="item in scope.row.rebateWallets" -->
- <el-tag
- v-if="scope.row.customerWalletName2"
- type="success"
- size="small"
- >
- {{ scope.row.customerWalletName2 }}
- </el-tag>
- </template>
- </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="totalDiscAmount"
- min-width="100"
- show-overflow-tooltip
- >
- <template slot-scope="scope">
- {{ scope.row.totalDiscAmount | numToFixed }}
- </template>
- </el-table-column>
- <el-table-column
- align="left"
- label="现金钱包"
- prop="customerWalletName"
- min-width="100"
- show-overflow-tooltip
- >
- <template slot-scope="scope">
- <!-- v-for="item in scope.row.wallets" -->
- <el-tag type="success" size="small">
- {{ scope.row.customerWalletName }}
- </el-tag>
- </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
- align="left"
- label="已退数量"
- prop="retiredQty"
- 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
- align="left"
- label="表体业务员"
- prop="serviceName"
- min-width="100"
- show-overflow-tooltip
- />
- <el-table-column
- align="left"
- label="备注"
- prop="remark"
- min-width="160"
- show-overflow-tooltip
- />
- <el-table-column
- align="left"
- label="税率"
- prop="tax"
- min-width="100"
- show-overflow-tooltip
- />
- </el-table>
- </div>
- <div>
- <div class="main-title">
- <div class="title">审批记录</div>
- </div>
- <div class="diy-table-1">
- <el-row :gutter="0">
- <el-col :span="12" class="item">
- <div class="label">审批人</div>
- <div class="value">{{ detailData.examineName }}</div>
- </el-col>
- <el-col :span="12" class="item">
- <div class="label">审批结果</div>
- <div class="value">
- {{ detailData.examineStatus | statusFilter(detailData.examineTime) }}
- </div>
- </el-col>
- <el-col :span="24" class="item">
- <div class="label">审批说明</div>
- <div class="value">{{ detailData.examineRemark }}</div>
- </el-col>
- </el-row>
- </div>
- </div>
- </div>
- <div class="page-footer">
- <div class="footer" :class="classObj">
- <el-button type="success" @click="toCheckOrder">联查单据</el-button>
- <el-button v-if="isCustomer" type="primary" :disabled="detailData.examineStatus !== 'OK'" @click="openDirectDialog">提前开票</el-button>
- <el-button
- v-if="isCustomer"
- :type="status ? 'info' : 'primary'"
- :disabled="detailData.examineStatus !== 'OK' || status "
- @click="openDeliverDialog"
- >直调发货</el-button>
- <el-button
- v-if="isCustomer"
- :type="status ? 'info' : 'primary'"
- :disabled="detailData.examineStatus !== 'OK' || status"
- @click="handleFinish"
- >直调完成</el-button>
- <!-- <el-button @click="goBack">关 闭</el-button> -->
- </div>
- </div>
- <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-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-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-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-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="left" label="序号" type="index" width="50" />
- <el-table-column align="left" label="销售类型" prop="saleTypeName" min-width="100" show-overflow-tooltip />
- <el-table-column align="left" label="物料编码" prop="materialCode" min-width="160" show-overflow-tooltip >
- <template slot-scope="scope">
- <CopyButton :copyText="scope.row.materialCode" />
- <span>{{scope.row.materialCode}}</span>
- </template>
- </el-table-column>
- <el-table-column align="left" label="产品编码" prop="materialOldNumber" min-width="160" show-overflow-tooltip >
- <template slot-scope="scope">
- <CopyButton :copyText="scope.row.materialOldNumber" />
- <span>{{scope.row.materialOldNumber}}</span>
- </template>
- </el-table-column>
- <el-table-column align="left" label="产品名称" prop="materialName" min-width="160" show-overflow-tooltip >
- <template slot-scope="scope">
- <CopyButton :copyText="scope.row.materialName" />
- <span>{{scope.row.materialName}}</span>
- </template>
- </el-table-column>
- <el-table-column align="left" label="规格型号" prop="specification" min-width="160" show-overflow-tooltip >
- <template slot-scope="scope">
- <CopyButton :copyText="scope.row.specification" />
- <span>{{scope.row.specification}}</span>
- </template>
- </el-table-column>
- <el-table-column align="left" label="单位" prop="unit" min-width="100" show-overflow-tooltip />
- <el-table-column align="right" label="数量" prop="refundableQty" min-width="100" show-overflow-tooltip />
- <el-table-column align="left" label="调出仓库" prop="warehouse1" min-width="100" show-overflow-tooltip />
- <el-table-column align="left" label="调出仓位" prop="position1" min-width="100" show-overflow-tooltip />
- <el-table-column align="left" label="调入仓库" prop="warehouse2" min-width="100" show-overflow-tooltip />
- <el-table-column align="left" label="调入仓位" prop="position2" min-width="100" show-overflow-tooltip />
- <el-table-column align="left" label="调出库存状态" prop="status1" min-width="110" show-overflow-tooltip />
- <el-table-column align="left" label="调入库存状态" prop="status2" min-width="110" show-overflow-tooltip />
- <el-table-column align="left" label="调出货主" min-width="100" show-overflow-tooltip>
- <template slot-scope="">弘格</template>
- </el-table-column>
- <el-table-column align="left" label="调入货主" min-width="100" show-overflow-tooltip>
- <template slot-="scope">弘格</template>
- </el-table-column>
- <el-table-column align="left" label="备注" prop="remark" min-width="160" show-overflow-tooltip />
- </el-table>
- </div>
- <span slot="footer" class="dialog-footer">
- <el-button @click="closeDirectDialog">取 消</el-button>
- <el-button type="primary" @click="submitDirectForm">确 定</el-button>
- </span>
- </el-dialog>
- <el-dialog title="直调发货" :visible.sync="isShowDeliverDialog" width="80%">
- <el-form
- ref="deliverForm"
- :model="deliverForm"
- :rules="deliverFormRules"
- label-width="80px"
- 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"
- disabled
- value-format="yyyy-MM-dd"
- style="width: 100%"
- placeholder="选择日期"
- />
- </el-form-item>
- </el-col>
- <!-- <el-col :xs="8" :sm="8" :lg="8">-->
- <!-- <el-form-item label="发货仓库" prop="warehouse">-->
- <!-- <el-select-->
- <!-- v-model="deliverForm.warehouse"-->
- <!-- placeholder="请选择发货仓库"-->
- <!-- style="width: 100%"-->
- <!-- filterable-->
- <!-- @change="changeWarehouse"-->
- <!-- >-->
- <!-- <el-option-->
- <!-- v-for="item in warehouseList"-->
- <!-- :key="item.id"-->
- <!-- :label="item.name"-->
- <!-- :value="item.id"-->
- <!-- />-->
- <!-- </el-select>-->
- <!-- </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-select>
- </el-form-item>
- </el-col>
- </el-row>
- </el-form>
- <div class="table" style="margin-top: 20px">
- <el-table
- :data="goodsList"
- element-loading-text="Loading"
- border
- fit
- highlight-current-row
- stripe
- max-height="400"
- show-summary
- :summary-method="$getSummaries"
- >
- <el-table-column
- align="left"
- label="序号"
- type="index"
- width="50"
- />
- <el-table-column
- align="left"
- label="销售类型"
- prop="saleTypeName"
- min-width="100"
- show-overflow-tooltip
- />
- <el-table-column
- align="left"
- label="物料编码"
- prop="materialCode"
- min-width="160"
- show-overflow-tooltip
- >
- <template slot-scope="scope">
- <CopyButton :copyText="scope.row.materialCode" />
- <span>{{scope.row.materialCode}}</span>
- </template>
- </el-table-column>
- <el-table-column
- align="left"
- label="产品名称"
- prop="materialName"
- min-width="160"
- show-overflow-tooltip
- >
- <template slot-scope="scope">
- <CopyButton :copyText="scope.row.materialName" />
- <span>{{scope.row.materialName}}</span>
- </template>
- </el-table-column>
- <el-table-column
- align="left"
- label="规格型号"
- prop="specification"
- min-width="160"
- show-overflow-tooltip
- >
- <template slot-scope="scope">
- <CopyButton :copyText="scope.row.specification" />
- <span>{{scope.row.specification}}</span>
- </template>
- </el-table-column>
- <el-table-column
- align="left"
- label="单位"
- prop="unit"
- min-width="100"
- show-overflow-tooltip
- />
- <el-table-column
- align="right"
- label="订单数量"
- prop="qty"
- min-width="100"
- show-overflow-tooltip
- />
- <!-- refundableQty -->
- <el-table-column
- align="right"
- label="发货数量"
- prop="hasSendQty"
- min-width="100"
- show-overflow-tooltip
- />
- <el-table-column
- align="right"
- label="直调数量"
- prop="adjustNum"
- min-width="100"
- show-overflow-tooltip
- >
- <template slot-scope="scope">
- <el-input
- v-model="scope.row.adjustNum"
- size="small"
- type="number"
- :disabled="!scope.row.isDirectTransfer"
- />
- </template>
- </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="payRebateAmount"
- min-width="100"
- show-overflow-tooltip
- >
- <template slot-scope="scope">
- {{ scope.row.payRebateAmount | numToFixed }}
- </template>
- </el-table-column>
- <el-table-column
- align="left"
- label="表体备注"
- prop="itemRemark"
- min-width="160"
- show-overflow-tooltip
- />
- </el-table>
- </div>
- <span slot="footer" class="dialog-footer">
- <el-button @click="closeDeliverDialog">取 消</el-button>
- <el-button type="primary" @click="submitDeliverForm">确 定</el-button>
- </span>
- </el-dialog>
- <CheckOrder v-if="isShowCheckOrder" :check-order-id="checkOrderId" @backDetail="backDetail" />
- </div>
- </template>
- <script>
- import { getDetail } from '@/api/supply/policy'
- import { adjustDeliver, directOrder, finishData, getPositionList, getWarehouseList } from '@/api/supply/retail'
- import { mapState } from 'vuex'
- import CheckOrder from '@/components/Common/check-order'
- export default {
- name: 'RetailDetail',
- componentName: 'RetailDetail',
- components: {
- CheckOrder
- },
- filters: {
- statusFilter(val, time) {
- const statusList = [
- { label: '已保存', value: 'SAVE' },
- { label: '待审核', value: 'WAIT' },
- { label: '审核通过', value: 'OK' },
- // { label: '审核驳回', value: 'FAIL' },
- ]
- const obj = statusList.find((o) => o.value === val)
- if (!time) {
- return obj ? obj.label : ''
- } else {
- return val === 'SAVE' && time ? '驳回' : obj.label
- }
- }
- },
- props: ['listItem'],
- data() {
- return {
- detailData: {},
- isShowDeliverDialog: false,
- deliverForm: {
- date: '',
- position: ''
- },
- deliverFormRules: {
- date: [
- { required: true, message: '请选择发货日期', trigger: 'change' }
- ],
- position: [
- { required: true, message: '请选择虚拟仓位', trigger: 'change' }
- ]
- },
- positionList: [],
- goodsList: [],
- 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: [],
- status: false,
- checkOrderId: {},
- isShowCheckOrder: false
- }
- },
- computed: {
- sidebar() {
- return this.$store.state.app.sidebar
- },
- classObj() {
- return {
- hideSidebar: !this.sidebar.opened,
- openSidebar: this.sidebar.opened
- }
- },
- isExamine() {
- return (
- this.detailData.examineStatus === 'OK' ||
- this.detailData.examineStatus === 'FAIL'
- )
- },
- isDealer() {
- return JSON.parse(localStorage.getItem('supply_user')).isCustomer
- },
- progress() {
- if (this.detailData.totalQty == 0) return 0
- return (this.detailData.takeQty * 100) / (this.detailData.totalQty * 100)
- },
- ...mapState({
- isCustomer: ({ user }) => {
- return !(user.customerName || user.customerNumber)
- }
- })
- },
- created() {
- this.getDetail()
- this.deliverForm.date = this.getDate()
- },
- methods: {
- getDate() {
- var date = new Date();
- var seperator1 = "-";
- var year = date.getFullYear();
- var month = date.getMonth() + 1;
- var strDate = date.getDate();
- if (month >= 1 && month <= 9) {
- month = "0" + month;
- }
- if (strDate >= 0 && strDate <= 9) {
- strDate = "0" + strDate;
- }
- var currentdate = year + seperator1 + month + seperator1 + strDate;
- return currentdate;
- },
- // 返回列表
- goBack() {
- this.$emit('backListFormDetail')
- },
- // 是否直调完成
- directTransferStatus(val) {
- this.status = val.retailOrderItemList.some((k) => {
- return k.directTransferStatus == true
- })
- console.log(this.status, '4554545')
- },
- // 获取详情
- getDetail() {
- getDetail({ id: this.listItem.id }).then((res) => {
- if (res.data.retailOrderItemList) {
- res.data.retailOrderItemList.forEach((item) => {
- item.sums1 = [
- 'directTransferQty',
- 'qty',
- 'refundableQty',
- 'oldQty'
- ]
- item.sums2 = [
- 'totalAmount',
- 'payAmount',
- 'price',
- 'payRebateAmount',
- 'discAmount',
- 'totalDiscAmount'
- ]
- })
- }
- this.detailData = res.data
- this.directTransferStatus(res.data)
- })
- },
- // 直调完成
- handleFinish() {
- this.$confirm('此操作将直调完成, 是否继续?', '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning'
- })
- .then(() => {
- finishData({
- id: this.listItem.id
- }).then((res) => {
- this.$successMsg()
- this.getDetail()
- })
- })
- .catch(() => {})
- },
- // 获取仓库列表
- getWarehouseList() {
- getWarehouseList({
- pageNum: 1,
- pageSize: -1
- }).then((res) => {
- this.warehouseList = res.data.records
- })
- },
- // 更改仓库
- changeWarehouse() {
- this.deliverForm.position = ''
- const obj = this.warehouseList.find(
- (o) => o.id == this.deliverForm.warehouse
- )
- this.positionList = obj.kingDeeStocks
- },
- // 打开 直调发货
- openDeliverDialog() {
- this.isShowDeliverDialog = true
- this.detailData.retailOrderItemList.forEach(item => {
- if(item.isDirectTransfer){
- this.$set(item,'adjustNum',item.refundableQty)
- }else{
- this.$set(item,'adjustNum',0)
- }
- })
- this.goodsList = this.detailData.retailOrderItemList
- this.getPositionList()
- },
- // 获取虚拟仓位列表
- getPositionList() {
- getPositionList({
- pageNum: 1,
- pageSize: -1,
- type: 2
- }).then(res => {
- this.positionList = res.data.records
- })
- },
- // 关闭 直调发货
- closeDeliverDialog() {
- this.isShowDeliverDialog = false
- },
- // 联查单据
- toCheckOrder() {
- this.checkOrderId = this.detailData.id
- this.isShowCheckOrder = true
- },
- // 关闭 提前开票
- closeDirectDialog() {
- this.isShowDirectDialog = false
- },
- // 更改调出仓库
- changeWarehouse1() {
- this.directForm.position1 = ''
- const 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 = ''
- const obj = this.warehouseList2.find(o => o.id == this.directForm.warehouse2)
- this.positionList2 = obj.kingDeeStocks
- this.directGoodsList.forEach(item => {
- item.warehouse2 = obj.name
- })
- },
- // 获取仓库列表
- getWarehouseList() {
- getWarehouseList({
- pageNum: 1,
- pageSize: -1
- }).then(res => {
- this.warehouseList1 = res.data.records
- this.warehouseList2 = res.data.records
- })
- },
- // 更改调出仓位
- changePosition1() {
- const obj = this.positionList1.find(o => o.id == this.directForm.position1)
- this.directGoodsList.forEach(item => {
- item.position1 = obj.name
- item.status1 = obj.defStockStatusName
- })
- },
- // 更改调入仓位
- changePosition2() {
- const obj = this.positionList2.find(o => o.id == this.directForm.position2)
- this.directGoodsList.forEach(item => {
- item.position2 = obj.name
- item.status2 = obj.defStockStatusName
- })
- },
- // 提交 提前开票
- submitDirectForm() {
- this.$refs.directForm.validate((valid) => {
- if (valid) {
- const warehouseItem1 = this.warehouseList1.find(o => o.id == this.directForm.warehouse1)
- const positionItem1 = this.positionList1.find(o => o.id == this.directForm.position1)
- const warehouseItem2 = this.warehouseList2.find(o => o.id == this.directForm.warehouse2)
- const positionItem2 = this.positionList2.find(o => o.id == this.directForm.position2)
- const params = {
- orderNo: this.detailData.id,
- orderType: 'RETAIL', // 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
- }
- directOrder(params).then(res => {
- this.$successMsg()
- this.isShowDirectDialog = false
- this.getDetail()
- })
- }
- })
- },
- backDetail() {
- this.isShowCheckOrder = false
- },
- // 提交 直调发货
- submitDeliverForm() {
- this.$refs.deliverForm.validate((valid) => {
- if (valid) {
- for (let i = 0; i < this.goodsList.length; i++) {
- if (
- !this.goodsList[i].adjustNum &&
- this.goodsList[i].isDirectTransfer
- ) {
- this.$errorMsg('请输入直调数量')
- return
- }
- }
- const goodsList = this.goodsList.map((item) => {
- return {
- itemId: item.id,
- qty: item.adjustNum || 0
- }
- })
- const params = {
- orderNo: this.listItem.id,
- orderDate: this.deliverForm.date + ' 00:00:00',
- correspondId: this.deliverForm.position,
- directItems: goodsList
- }
- adjustDeliver(params).then((res) => {
- this.$successMsg()
- this.isShowDeliverDialog = false
- this.getDetail()
- })
- }
- })
- },
- // 打开 提前开票
- openDirectDialog() {
- this.isShowDirectDialog = true
- this.directGoodsList = this.detailData.retailOrderItemList
- this.getWarehouseList()
- }
- }
- }
- </script>
- <style scoped lang="scss">
- .detail-container {
- width: 100%;
- height: 100%;
- margin-bottom: 80px;
- }
- .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;
- }
- }
- .progress-container {
- display: flex;
- .el-progress {
- width: 500px;
- }
- }
- .page-footer{
- height: 0;
- }
- </style>
|