123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454 |
- <template>
- <div class="detail-container">
- <el-page-header @back="goBack" content="审批"></el-page-header>
- <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="16" 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.refEnginRecordNo}}</div>
- </el-col>
- <el-col :span="8" class="item">
- <div class="label">项目类别</div>
- <div class="value">{{detailData.refProjectName}}</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">
- <el-select v-model="detailData.saleTypeId" placeholder="选择销售类型" style="width: 100%" clearable>
- <el-option v-for="item in salesTypeList" :key="item.id" :label="item.saleName" :value="item.id"></el-option>
- </el-select>
- </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="24" 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.takeDeposit ? '是':'否'}}
- <!-- <el-checkbox v-model="detailData.takeDeposit">{{detailData.takeDeposit ? '是':'否'}}</el-checkbox> -->
- </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">
- <el-input v-model="detailData.note1" placeholder="请输入格力回复"></el-input>
- </div>
- </el-col>
- <el-col :span="24" class="item">
- <div class="label">格力内部备注</div>
- <div class="value">
- <el-input v-model="detailData.note2" placeholder="请输入格力内部备注"></el-input>
- </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.geLiInerNote}}</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.refDeclareNo}}</div>
- </el-col>
- <el-col :span="6" class="item">
- <div class="label">制单人</div>
- <div class="value">{{detailData.createBy}}</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.closeBy}}</div>
- </el-col>
- <el-col :span="6" class="item">
- <div class="label">关闭日期</div>
- <div class="value">{{detailData.closeTime}}</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">
- <el-table-column align="center" label="序号" type="index" width="50"></el-table-column>
- <el-table-column align="center" label="引用记录" prop="useRefCount" min-width="160" show-overflow-tooltip></el-table-column>
- <el-table-column align="center" label="销售类型" prop="saleTypeName" min-width="160" show-overflow-tooltip></el-table-column>
- <el-table-column align="center" label="物料编码" prop="materialNumber" min-width="120" show-overflow-tooltip></el-table-column>
- <el-table-column align="center" label="产品编码" prop="materialOldNumber" min-width="120" 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="price" min-width="100" show-overflow-tooltip>
- <template slot-scope="scope">
- <!-- {{ scope.row.price | numToFixed }} -->
- <el-input v-model="scope.row.price" size="small" type="number"></el-input>
- </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="right" label="数量" prop="qty" min-width="100" show-overflow-tooltip>
- <template slot-scope="scope">
- <!-- {{ (scope.row.qty*100 - scope.row.directTransferQty*100 - scope.row.retiredQty*100) / 100 }} -->
- <el-input v-model="scope.row.qty" size="small" type="number"></el-input>
- </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="center" label="返利类型" prop="customerWalletName2" min-width="140" show-overflow-tooltip></el-table-column>
- <el-table-column align="right" label="使用返利金额" prop="rebateAmount" min-width="120" show-overflow-tooltip>
- <template slot-scope="scope">
- {{ scope.row.rebateAmount | numToFixed }}
- </template>
- </el-table-column> -->
- <el-table-column align="center" label="返利类型" prop="customerWalletId2" min-width="160" show-overflow-tooltip>
- <template slot-scope="scope">
- <el-select v-model="scope.row.customerWalletId2" placeholder="选择返利类型" size="small" clearable @change="changeFlWallet(scope.$index)">
- <el-option
- v-for="item in scope.row.rebateWallets"
- :key="item.customerWalletId"
- :label="item.customerWalletName"
- :value="item.customerWalletId">
- </el-option>
- </el-select>
- </template>
- </el-table-column>
- <el-table-column align="right" label="返利金额" min-width="100" show-overflow-tooltip>
- <template slot-scope="scope">
- {{(scope.row.price * scope.row.qty * (scope.row.rebateRate * 100)) / 100}}
- </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="center" label="现金钱包" prop="customerWalletName" min-width="140" show-overflow-tooltip></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="center" label="现金钱包" prop="customerWalletId" min-width="160" show-overflow-tooltip>
- <template slot-scope="scope">
- <el-select v-model="scope.row.customerWalletId" placeholder="选择现金钱包" size="small" clearable @change="changeXjWallet(scope.$index)">
- <el-option
- v-for="item in scope.row.wallets"
- :key="item.customerWalletId"
- :label="item.customerWalletName"
- :value="item.customerWalletId">
- </el-option>
- </el-select>
- </template>
- </el-table-column>
- <el-table-column align="right" label="实付金额" prop="qty" min-width="100" show-overflow-tooltip>
- <template slot-scope="scope">
- {{(((scope.row.price * scope.row.qty) * 100 - ((scope.row.price * scope.row.qty * (scope.row.rebateRate * 100)) / 100) * 100 - ((scope.row.qty * (scope.row.discAmount * 100)) / 100) * 100) / 100) | numToFixed}}
- </template>
- </el-table-column>
- <el-table-column align="center" 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="center" label="备注" prop="remark" min-width="160" show-overflow-tooltip></el-table-column>
- <el-table-column align="center" label="税率" prop="tax" min-width="100" show-overflow-tooltip></el-table-column>
- </el-table>
- </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">{{userName}}</div>
- </el-col>
- <el-col :span="12" class="item">
- <div class="label">审批日期</div>
- <div class="value">{{getDate()}}</div>
- </el-col>
- <el-col :span="24" class="item">
- <div class="label">审批说明</div>
- <div class="value"><el-input v-model="examineForm.remark" placeholder="请输入审批说明"></el-input></div>
- </el-col>
- </el-row>
- </div>
- <div class="page-footer">
- <div class="footer">
- <el-button type="primary" @click="clickSubmitForm(1)" :loading="formLoading">审批通过</el-button>
- <el-button type="warning" @click="clickSubmitForm(0)" :loading="formLoading">审批驳回</el-button>
- <el-popconfirm title="确定关闭吗?" @onConfirm="goBack" style="margin-left: 10px;">
- <el-button slot="reference">关 闭</el-button>
- </el-popconfirm>
- </div>
- </div>
- </div>
- </template>
- <script>
- import { getOrderDetail, examineHome } from "@/api/supply/engin";
- import { getTypeList } from '@/api/common'
- export default {
- name: 'HomeExamine',
- componentName: 'HomeExamine',
- 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 {
- userName: JSON.parse(localStorage.getItem("supply_user")).nickName,
- detailData: {},
- examineForm: {
- remark: '',
- },
- salesTypeList: [],
- formLoading: false,
- }
- },
- created() {
- this.getSalesTypeList();
- this.getDetail();
- },
- 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;
- },
- // 获取销售类型列表
- getSalesTypeList() {
- getTypeList({
- pageNum: 1,
- pageSize: -1
- }).then((res) => {
- this.salesTypeList = res.data.records;
- })
- },
- // 返回列表
- goBack() {
- this.$emit('backListFormDetail');
- },
- // 获取详情
- getDetail() {
- getOrderDetail({id: this.listItem.parentId}).then(res => {
- if(res.data.items) {
- res.data.items.forEach(item => {
- item.sums1 = ['directTransferQty', 'qty', 'enginNum', 'refundableQty', 'tdQty', 'hasSendQty'];
- item.sums2 = ['totalAmount', 'payAmount', 'price', 'discAmount', 'rebateAmount'];
- })
- }
- res.data.items.forEach(item => {
- item.rebateWallets = item.customerWalletList.filter(item => {
- return item.type === 'REBATE';
- });
- item.wallets = item.customerWalletList.filter(item => {
- return item.type === 'COMMONLY';
- });
- })
- this.detailData = res.data;
- })
- },
- // 修改返利钱包
- changeFlWallet(index) {
- if(this.detailData.items[index].customerWalletId2) {
- let obj = this.detailData.items[index].rebateWallets.find(o => o.customerWalletId == this.detailData.items[index].customerWalletId2);
- this.detailData.items[index].rebateRate = obj.rebateRate;
- this.detailData.items[index].customerWalletName2 = obj.customerWalletName;
- }else {
- this.detailData.items[index].rebateRate = '';
- this.detailData.items[index].customerWalletName2 = '';
- }
- },
- // 修改现金钱包
- changeXjWallet(index) {
- if(this.detailData.items[index].customerWalletId) {
- let obj = this.detailData.items[index].wallets.find(o => o.customerWalletId == this.detailData.items[index].customerWalletId);
- this.detailData.items[index].customerWalletName = obj.customerWalletName;
- }else {
- this.detailData.items[index].customerWalletName = '';
- }
- },
- // 审批
- clickSubmitForm(val) {
- this.$confirm('此操作将审批订单, 是否继续?', '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning'
- }).then(() => {
- let saleTypeItem = this.salesTypeList.find(o => o.id == this.detailData.saleTypeId);
- let params = JSON.parse(JSON.stringify(this.detailData));
- params.examineNote = this.examineForm.remark;
- params.examineResult = val;
- params.saleTypeId = this.detailData.saleTypeId;
- params.saleTypeCode = saleTypeItem.saleCode;
- params.saleTypeName = saleTypeItem.saleName;
- this.formLoading = true;
- examineHome(params).then(res => {
- if(!res.data) {
- this.$successMsg();
- this.goBack();
- this.$parent.getList();
- }else {
- this.$confirm('审批成功!是否跳转下一张待审批订单?', '提示', {
- confirmButtonText: '跳转',
- cancelButtonText: '取消',
- type: 'warning'
- }).then(() => {
- this.$successMsg('进入下一张待审批订单');
- this.detailData = res.data;
- }).catch(() => {
- this.goBack();
- this.$parent.getList();
- });
- }
- }).finally(res => {
- this.formLoading = false;
- })
- }).catch(() => {});
- },
- }
- }
- </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>
|