123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118 |
- <template>
- <div>
- <div class="customer-head">
- <div class="customer-back">
- <el-button type="danger" style="border: none;background: none;color: red" icon="el-icon-arrow-left"
- @click="backToList(0)">返回列表
- </el-button>
- </div>
- <div class="add-customer-btn">
- <el-button class="el-button--small-yh" style="margin-left: 6px;"
- type="primary" size="small" v-if="editButton" @click="confirmEditing">编 辑
- </el-button>
- <el-button class="el-button--small-yh" v-else style="margin-left: 6px;" type="primary" size="small"
- :disabled="isSaveBtn" @click="editCustomer">保 存
- </el-button>
- <el-button class="el-button--small-yh" style="margin-left: 6px;" :type="buttonColor" size="small"
- :disabled="isDisabledTask || form.status !== '待确认' && form.status !== '待收货'" @click="generateOutbound">
- {{ buttonText }}
- </el-button>
- <el-dropdown style="padding: 0 6px;line-height: 0">
- <el-button v-show="!(!form.id || viewDisabled)" type="danger" :loading="buttonLoading" :disabled="!form.id || viewDisabled" size="small">
- 请 核<i class="el-icon-arrow-down el-icon--right"></i>
- </el-button>
- <el-dropdown-menu slot="dropdown">
- <el-dropdown-item @click.native="applySettlement('申请')"
- :disabled="isApplySettlement || form.status !== '录入'">请核数据
- </el-dropdown-item>
- <!-- <el-dropdown-item @click.native="confirmRefundBtn('确认')" :disabled="isConfirmRefundBtn">确认退款
- </el-dropdown-item> -->
- <el-dropdown-item @click.native="revocationRequest('撤销')" :disabled="isRevocationRequest">撤销请核
- </el-dropdown-item>
- </el-dropdown-menu>
- </el-dropdown>
- <el-dropdown style="line-height: 0">
- <el-button type="warning" :loading="buttonLoading" :disabled="!form.id || viewDisabled" size="small">
- 审 批<i class="el-icon-arrow-down el-icon--right"></i>
- </el-button>
- <el-dropdown-menu slot="dropdown">
- <el-dropdown-item @click.native="examineBtn('审批')" :disabled="isExamineBtn && !detailData.check">审批
- </el-dropdown-item>
- <el-dropdown-item @click.native="checkScheduleDialog = true, checkId = form.id">审核进度
- </el-dropdown-item>
- </el-dropdown-menu>
- </el-dropdown>
- <el-button class="el-button--small-yh" style="margin-left: 6px;" v-if="form.id"
- type="success" size="small"
- :disabled="form.shortcutWarehousingStatus == '1'"
- @click="oneClickStorage" >一键采购入库
- </el-button>
- </div>
- </div>
- <div style="margin-top: 50px">
- <trade-card title="基础信息">
- <avue-form :option="optionForm" v-model="form" ref="form">
- <template slot-scope="{row,index}" slot="contacts">
- <!-- 联系人 -->
- <el-select v-model="form.contacts" placeholder="请选择" size="small" style="width:60%"
- clearable filterable allow-create default-first-option
- @change="contactsChange($event)" :disabled=isContacts>
- <el-option v-for="item in contactsOption" :key="item.cname" :label="item.cname"
- :value="item.contacts" />
- </el-select>
- </template>
- <template slot-scope="{row,index}" slot="recAddress">
- <!-- 地址 -->
- <el-select v-model="form.recAddress" placeholder="请选择" size="small" style="width:60%"
- clearable filterable allow-create default-first-option
- :disabled=isContacts>
- <el-option v-for="item in recAddressOption" :key="item.id"
- :label="item.belongtoarea + item.detailedAddress"
- :value="item.belongtoarea + item.detailedAddress" />
- </el-select>
- </template>
- </avue-form>
- </trade-card>
- <trade-card title="明细信息">
- <el-tabs v-model="activeName" type="card">
- <el-tab-pane label="采购明细" name="sale_detail">
- <avue-crud :option="optionContacts" v-model="formContacts" ref="formContacts"
- :data="form.orderItemsList" :key="key" @row-save="rowSave" @row-update="rowUpdate"
- @row-close="rowClose" :before-close="beforeClose"
- @resetColumn="resetColumnTwo('formContacts', 'optionContacts', 'optionContactsBack', 269.1)"
- @saveColumn="saveColumnTwo('formContacts', 'optionContacts', 'optionContactsBack', 269.1)">
- <template slot-scope="{scope,row}" slot="menuLeft">
- <el-button type="primary" icon="el-icon-plus" size="small" :disabled="isAddBtn"
- @click="rowAdd(row)">添加轮胎</el-button>
- <el-button type="success" size="small" :disabled="isAddBtn" icon="el-icon-bottom" @click="excelBox = true">导入
- </el-button>
- <el-button type="primary" icon="el-icon-printer" size="small"
- @click="handlePrint">打印</el-button>
- </template>
- <template slot="goodsId" slot-scope="{ row }">
- <!--<el-select v-if="row.$cellEdit" v-model="row.goodsId" allow-create filterable default-first-option >-->
- <!-- <el-option v-for="(item, index) in goodsIdoptions" :key="index" :label="item.cname"-->
- <!-- :value="item.id"></el-option>-->
- <!--</el-select>-->
- <span>{{ row.goodsName }}</span>
- </template>
- <template slot="goodsNum" slot-scope="{ row }">
- <el-input v-if="!mingxibaocun" size="small" v-model="row.goodsNum" style="width: 100%"></el-input>
- <span v-else>{{ row.goodsNum }}</span>
- </template>
- <template slot="price" slot-scope="{ row }">
- <el-input v-if="!mingxibaocun" size="small" v-model="row.price" style="width: 100%"></el-input>
- <span v-else>{{ row.price }}</span>
- </template>
- <template slot="dot" slot-scope="{ row }">
- <el-select v-if="!mingxibaocun && row.whether=='1'" v-model="row.dot" allow-create filterable default-first-option @focus="picihaolistfun(row.goodsId)">
- <el-option v-for="(item, index) in picihaolist" :key="index" :label="item.dot"
- :value="item.dot"></el-option>
- </el-select>
- <span v-else>{{ row.dot }}</span>
- </template>
- <template slot="subTotalMoney" slot-scope="{ row }">{{row.goodsNum * row.price}}</template>
- <template slot="remarks" slot-scope="{ row }">
- <el-input v-if="!mingxibaocun" size="small" v-model="row.remarks" style="width: 100%"></el-input>
- <span v-else>{{ row.remarks }}</span>
- </template>
- <!-- <template slot-scope="{scope,row}" slot="goodsNum">
- <el-input size="small" v-model="formContacts.goodsNum" style="width: 100%">
- <template slot="inventory">{{ inventory }}吨</template>
- </el-input>
- </template> -->
- <!-- <template slot="goodsId" slot-scope="{ row, index }">
- <span style="display:flex">
- <el-select v-model="row.goodsId" placeholder="请选择" size="small" filterable
- style="width:60%" >
- <el-option v-for="item in goodsIdoptions" :key="item.id" :label="item.cname"
- :value="item.id">
- </el-option>
- </el-select>
- <el-button icon="el-icon-search" size="small" @click="rePick(row, index)"></el-button>
- </span>
- </template> -->
- <template slot-scope="{type,size,row,index,disabled}" slot="menu">
- <el-button v-if="mingxibaocun" :size="size" :disabled="disabled || isAdd" :type="type"
- :icon="row.$cellEdit ? 'el-icon-plus' : 'el-icon-edit'" @click="hangeditBtn(row, index)">编辑
- </el-button>
- <el-button v-else :size="size" :disabled="disabled || isAdd" :type="type"
- :icon="row.$cellEdit ? 'el-icon-plus' : 'el-icon-edit'" @click="hangbaocun(row, index)">保存
- </el-button>
- <el-button icon="el-icon-delete" :size="size" :disabled="disabled || isDisabled"
- :type="type" @click="rowDelBox(row, index, 'orderItemsList')">删除
- </el-button>
- </template>
- </avue-crud>
- </el-tab-pane>
- <el-tab-pane label="付款明细" name="payment_details">
- <avue-crud :option="optionPaymentDetails" v-model="formContacts" ref="payment_details"
- :data="dataList" @row-save="rowSave" @row-update="rowUpdate"
- @resetColumn="resetColumnTwo('payment_details', 'optionPaymentDetails', 'optionPaymentDetailsBack', 269.2)"
- @saveColumn="saveColumnTwo('payment_details', 'optionPaymentDetails', 'optionPaymentDetailsBack', 269.2)">
- <!-- <template slot-scope="{type,size,row,index,disabled}" slot="menu">
- <el-button :size="size" :disabled="disabled" :type="type"
- :icon="row.$cellEdit ? 'el-icon-plus' : 'el-icon-edit'"
- @click="$refs.formContacts.rowCell(row, index)">{{ row.$cellEdit ? '确认' : '修改' }}
- </el-button>
- <el-button icon="el-icon-delete" :size="size" :disabled="disabled" :type="type"
- @click="rowDelBox(row, index, 'paymentRecordsList')">删除
- </el-button>
- </template> -->
- </avue-crud>
- </el-tab-pane>
- <el-tab-pane label="入库记录" name="outbound_records">
- <avue-crud :option="optionOutboundRecords" v-model="formContacts" ref="outbound_records"
- :data="form.outboundRecordsList" @row-save="rowSave" @row-update="rowUpdate"
- @resetColumn="resetColumnTwo('outbound_records', 'optionOutboundRecords', 'optionOutboundRecordsBack', 269.3)"
- @saveColumn="saveColumnTwo('outbound_records', 'optionOutboundRecords', 'optionOutboundRecordsBack', 269.3)">
- <!-- <template slot-scope="{type,size,row,index,disabled}" slot="menu">
- <el-button :size="size" :disabled="disabled" :type="type"
- :icon="row.$cellEdit ? 'el-icon-plus' : 'el-icon-edit'"
- @click="$refs.formContacts.rowCell(row, index)">{{ row.$cellEdit ? '确认' : '修改' }}
- </el-button>
- <el-button icon="el-icon-delete" :size="size" :disabled="disabled" :type="type"
- @click="rowDelBox(row, index)">删除
- </el-button>
- </template> -->
- </avue-crud>
- </el-tab-pane>
- </el-tabs>
- </trade-card>
- <report-dialog :switchDialog="switchDialog" reportName="轮胎商城-采购订单" :reportId="form.id"
- @onClose="onClose()"></report-dialog>
- <el-dialog append-to-body title="审批" class="el-dialogDeep" :visible.sync="checkDialog" width="50%"
- :close-on-click-modal="false" :destroy-on-close="true" :close-on-press-escape="false" v-dialog-drag>
- <check :checkData="checkData" :checkDetail="true" :idList="[]" @operationType="operationType"
- @choceCheckFun="choceCheckFun">
- </check>
- </el-dialog>
- <el-dialog append-to-body title="审批进度" class="el-dialogDeep" :visible.sync="checkScheduleDialog" width="40%"
- :close-on-click-modal="false" :destroy-on-close="true" :close-on-press-escape="false" v-dialog-drag>
- <check-schedule :checkId="checkId" :batchNo="batchNo" @choceScheduleFun="choceScheduleFun"></check-schedule>
- </el-dialog>
- <el-dialog title="导入明细" append-to-body :visible.sync="excelBox" v-if="excelBox" width="555px"
- :close-on-click-modal="false" v-dialog-drag>
- <avue-form :option="excelOption" v-model="excelForm" table-loading="excelLoading" :upload-before="uploadBefore"
- :upload-after="uploadAfter">
- <template slot="excelTemplate">
- <el-button type="primary" @click="derivation">
- 点击下载<i class="el-icon-download el-icon--right"></i>
- </el-button>
- </template>
- </avue-form>
- <p style="text-align: center;color: #DC0505">
- 温馨提示 第一次导入时请先下载模板
- </p>
- </el-dialog>
- </div>
- <el-dialog title="选择轮胎" append-to-body class="el-dialogDeep" :visible.sync="dialogVisible" width="80%"
- :close-on-click-modal="false" :destroy-on-close="true" :close-on-press-escape="false" @close="closeGoods">
- <el-row :style="{ height: rowHeight }">
- <el-col :span="5" style="height: 100%;overflow-y: auto">
- <div>
- <el-scrollbar>
- <basic-container>
- <avue-tree :option="treeOption" :data="treeDataGoods" @node-click="nodeClick" />
- </basic-container>
- </el-scrollbar>
- </div>
- </el-col>
- <el-col :span="19">
- <basic-container>
- <avue-crud :option="optionTwo" :table-loading="loading" :data="goodsListShow" ref="crud"
- @refresh-change="refreshChange" @selection-change="selectionChange" @search-change="goodsSearch"
- :page.sync="page" @on-load="onLoadfun"
- @resetColumn="resetCrud" @saveColumn="saveCrud" >
- <template slot="menuLeft">
- <el-tabs v-model="activeNameTabs" @tab-click="tabHandle">
- <el-tab-pane label="查询结果" name="searchList" />
- <el-tab-pane label="已选定数据" name="importStaging" />
- </el-tabs>
- </template>
- <template slot="goodsNum" slot-scope="{row}">
- <el-input-number v-model="row.goodsNum" size="small" :controls="false" :precision="0"
- @input="amountChange($event,row)" style="width: 100%" />
- </template>
- <template slot="dot" slot-scope="{row}">
- <el-select v-if="row.whether=='1'" v-model="row.dot" allow-create filterable default-first-option @focus="picihaolistfun(row.id)">
- <el-option v-for="(item, index) in picihaolist" :key="index" :label="item.dot"
- :value="item.dot"></el-option>
- </el-select>
- <span v-else>{{ row.dot }}</span>
- </template>
- <template slot="price" slot-scope="{row}">
- <el-input-number v-model="row.price" size="small" :controls="false"
- style="width: 100%" />
- <!--<span v-else>{{ row.price }}</span>-->
- </template>
- <template slot-scope="scope" slot="menu">
- <el-button type="text" icon="el-icon-edit" size="small"
- @click.stop="importStagList(scope.row, scope.index)" v-if="activeNameTabs == 'searchList'"
- :disabled="goodsListSave.findIndex(item => item.id == scope.row.id) !== -1">选择
- </el-button>
- <el-button type="text" icon="el-icon-delete" size="small"
- @click.stop="removeStagList(scope.row, scope.index)" v-else>移除
- </el-button>
- </template>
- </avue-crud>
- </basic-container>
- </el-col>
- </el-row>
- <span slot="footer" class="dialog-footer">
- <el-button @click="dialogVisible = false" :loading="saveLoading">取 消</el-button>
- <el-button type="primary" @click="importGoods" v-if="commodityData !== true" :loading="saveLoading">导入</el-button>
- <!--<el-button type="primary" @click="importChoice" v-if="commodityData === true" :loading="saveLoading"-->
- <!-- :disabled="tableData.length !== 1">导入</el-button>-->
- </span>
- </el-dialog>
- </div>
- </template>
- <script>
- import { getDetails as getCustom } from "@/api/tirePartsMall/basicData/customerInformation"
- import { dateFormat } from "@/util/date";
- import { getToken } from "@/util/auth";
- import {
- getDetails,
- submit,
- generateShipTask,
- tradingBox,
- delOrderItem,
- checkOrder,
- confirmRefund,
- goodsListXs,
- inboundTask,
- checkOrderCG,
- revokeCheckOrderCG,
- revokeInboundTask,
- goodsListAll,
- shortcutWarehousing
- } from "@/api/tirePartsMall/salesManagement/saleOrder";
- import { dotList, goodsDetail } from "@/api/tirePartsMall/purchasingManagement/warehouseEntryOrder";
- import reportDialog from "@/components/report-dialog/main";
- import checkSchedule from "@/components/checkL/checkSchedule";
- import check from "@/components/checkL/check";
- import {getCorpType, getList} from "@/api/tirePartsMall/basicData/commodityInformation"
- import TicketDistribution from "../../../oceanShipping/maritimeExport/components/ticketDistribution.vue";
- import M from "minimatch";
- import da from "element-ui/src/locale/lang/da";
- import { number } from "echarts";
- import {getDeptLazyTreeTwo} from "@/api/basicData/basicFeesDesc";
- import commodity from "../../configuration/commodity.json";
- export default {
- name: "detailsPage",
- data() {
- return {
- // 编辑还是保存
- mingxibaocun:true,
- // 批次号请求到的数据
- picihaolist:[],
- // 添加轮胎弹窗
- dialogVisible:false,
- // 弹窗高度
- rowHeight: '',
- // 左侧选择搜索
- treeDataGoods: [],
- treeDeptId: '',
- page: {
- pageSize: 10,
- currentPage: 1,
- total: 0,
- pageSizes: [10, 50, 100, 300, 500]
- },
- pageList: {
- pageSize: 10,
- currentPage: 1,
- total: 0
- },
- // 左侧选择
- treeOption:{
- addBtn: false,
- menu: false,
- size: "small",
- props: {
- labelText: "标题",
- label: "title",
- value: "value",
- }
- },
- // 表格需要的配置
- optionTwo: commodity,
- loading: false,
- // 商品列表数据合计
- goodsListShow: [],
- // 商品列表暂存
- goodsListSave: [],
- saveLoading: false,
- commodityData: false,
- surplusRouteQuantityOption: [],
- tableData: [],
- // tabs切换
- activeNameTabs:'searchList',
- data:[],
- inventory: 0,
- isStatus: 1,
- excelBox:false,
- // 轮胎名称
- goodsIdoptions: [],
- dataList: [],
- dicUrlWithCustomId: '',
- sharedCompanyId: 0,
- isAddBtn: true,
- viewDisabled: false, // 请核和大审批按钮是否禁用
- isApplySettlement: false, // 请核数据按钮是否禁用
- isRevocationRequest: true, // 撤销审核
- isExamineBtn: true, // 审批
- isAdd: false,
- editButton: true, // 编辑按钮和保存按钮的显示隐藏
- isSaveBtn: false, // 保存的禁用
- isDisabledTask: false, // 生成,撤销任务按钮是否禁用
- buttonText: '生成任务',
- buttonColor: 'success', // 初始颜色为success
- isContacts: false, // 基础信息插槽禁用
- goods: [],
- isDisabled: false,
- //地址
- recAddressOption: [],
- contactsOption: [],
- checkData: {},
- checkScheduleDialog: false,
- isConfirmRefundBtn: true,
- checkDialog: false,
- checkId: '',
- batchNo: '',
- switchDialog: false,
- activeName: "sale_detail",
- disabled: false,
- key: 0,
- excelOption: {
- submitBtn: false,
- emptyBtn: false,
- column: [
- {
- label: "模板下载",
- prop: "excelTemplate",
- formslot: true,
- span: 24
- },
- {
- label: "导入明细",
- prop: "excelFile",
- type: "upload",
- drag: true,
- loadText: "上传中,请稍等",
- accept: '.xls,.xlsx',
- span: 24,
- propsHttp: {
- res: "data"
- },
- tip: "请上传 .xls,.xlsx 标准格式文件",
- action: "/api/blade-sales-part/ship/import-item"
- }
- ]
- },
- form: {
- orderItemsList: [],
- paymentRecordsList: [],
- outboundRecordsList: []
- },
- optionForm: {
- menuBtn: false,
- span: 8,
- disabled: false,
- column: [{
- label: '供应商',
- prop: "customerId",
- disabled: false,
- remote: true,
- type: 'select',
- props: {
- label: 'cname',
- value: 'id'
- },
- cascader: ['recAddress'],
- click: () => {
- this.$refs.form.dicInit()
- },
- change: (data) => {
- if (!this.onLoad.id) {
- // this.$set(this.optionContactsBack, "addBtn", true)
- // this['optionContacts'] = this['optionContactsBack'];
- // this.delColumnData(this.getColumnName('269.1'), this['optionContactsBack']);
- }
- if (this.$refs.form.DIC.customerId || !this.onLoad.id) {
- getCustom({ id: data.value }).then(res => {
- this.dicUrlWithCustomId = res.data.data.id ? res.data.data.id : ''
- // this.form.storageId ? this.form.storageId : res.data.data.deliveryWarehouseId
- // this.form.storageId = res.data.data.deliveryWarehouseId
- this.form.storageId = this.form.storageId ? this.form.storageId : res.data.data.deliveryWarehouseId
- this.form.contacts = res.data.data.corpsAttnList[0].cname
- this.form.phone = res.data.data.corpsAttnList[0].tel
- //联系人
- this.contactsOption = res.data.data.corpsAttnList
- //地址
- this.recAddressOption = res.data.data.corpsAddrList
- console.log('contactsOption', this.contactsOption);
- this.form.recAddress = res.data.data.corpsAddrList[0].belongtoarea + res.data.data.corpsAddrList[0].detailedAddress
- })
- }
- // if (this.$refs.form.DIC.customerId || data.value) {
- // for (let item of this.$refs.form.DIC.customerId) {
- // if (item.id == data.value) {
- // console.log(data);
- // console.log(this.$refs.form);
- // console.log(item);
- // // 后端返回数据暂无联系人、地址等数据,无法下拉默认
- // this.form.phone = item.tel
- // }
- // }
- // }
- },
- dicUrl: '/api/blade-sales-part/corpsDesc/listAll?cname={{key}}&corpType=GYS&enableOrNot=1',
- rules: [{
- required: true,
- message: " ",
- trigger: "blur"
- }]
- }, {
- label: '仓库',
- prop: "storageId",
- type: 'select',
- disabled: false,
- // placeholder: '仓库为空即为异地销售',
- props: {
- label: 'cname',
- value: 'id'
- },
- dicUrl: '/api/blade-sales-part/storageDesc/listAll',
- rules: [{
- required: true,
- message: " ",
- trigger: "blur"
- }]
- },
- // {
- // label: '来源单号',
- // prop: "srcOrdNo",
- // disabled: true
- // }, {
- // label: '业务来源',
- // prop: "businessSource",
- // disabled: true
- // },
- {
- label: '业务日期',
- prop: "businesDate",
- searchProp:"businesDateList",
- disabled: false,
- type: "datetime",
- value: dateFormat(new Date(), 'yyyy-MM-dd'),
- format: "yyyy-MM-dd",
- valueFormat: "yyyy-MM-dd",
- rules: [
- {
- required: true,
- message: "",
- trigger: "blur"
- }
- ]
- },
- {
- label: '联系人',
- type: "select",
- prop: "contacts",
- disabled: false,
- allowCreate:true,
- filterable:true,
- props: {
- label: 'address',
- value: 'id'
- },
- dicUrl: '/api/blade-sales-part/corpsAddr/corpIdByAddr?pid={{key}}'
- }, {
- label: '电话',
- disabled: false,
- prop: "phone",
- }, {
- label: '地址',
- prop: "recAddress",
- type: 'select',
- allowCreate:true,
- filterable: true,
- disabled: false,
- props: {
- label: 'address',
- value: 'address'
- },
- dicUrl: '/api/blade-sales-part/corpsAddr/corpIdByAddr?pid={{key}}'
- },
- // {
- // label: '配送方式',
- // type: 'select',
- // prop: "shipType",
- // disabled: false,
- // dicUrl: "/api/blade-system/dict-biz/dictionary?code=deliveryMethod",
- // props: {
- // label: "dictValue",
- // value: "dictValue"
- // },
- // value: '物流'
- // }, {
- // label: '物流公司',
- // disabled: false,
- // prop: "logisticsCorpName"
- // },
- // {
- // label: '成本',
- // prop: "cost",
- // display: true,
- // disabled: true
- // }, {
- // label: '毛利',
- // prop: "grossProfit",
- // disabled: true
- // },
- // {
- // label: '采购金额',
- // prop: "salesAmount",
- // disabled: true
- // },
- // {
- // label: '运费',
- // prop: "freight",
- // disabled: true
- // },
- {
- label: '应付类别',
- prop: "receivableType",
- type: "select",
- disabled: false,
- dicUrl: "/api/blade-system/dict-biz/dictionary?code=receivableType",
- props: {
- label: "dictValue",
- value: "dictValue"
- },
- value: '网络支付'
- },
- {
- label: '总金额',
- prop: "totalMoney",
- disabled: true
- },
- {
- label: '已付金额',
- prop: "paymentAmountTl",
- disabled: true
- },
- {
- label: '单据编号',
- prop: "ordNo",
- disabled: true
- },
- {
- label: '备注',
- prop: "remarks",
- type: 'textarea',
- disabled: false,
- span: 16,
- minRows: 1
- }]
- },
- formContacts: {},
- optionContacts: {},
- optionContactsBack: {
- disabled: false,
- border: true,
- align: 'center',
- index: true,
- showSummary: true,
- addBtnText: "添加轮胎",
- updateBtnText: '保存',
- refreshBtn: false,
- dialogDrag: true,
- addBtn: false,
- span: 8,
- height: 500,
- // 添加
- addRowBtn: false,
- // 保存按钮
- editBtn: false,
- // 航编辑开启
- cellBtn:true,
- rowKey:'ids',
- delBtn: false,
- menuWidth: 140,
- dialogTop: 25,
- dialogWidth: "80%",
- summaryText: "合计",
- showSummary: true,
- sumColumnList: [{
- name: "goodsNum",
- type: "sum"
- }, {
- name: "price",
- type: "sum",
- decimals: 2
- }, {
- name: "sendNum",
- type: "sum",
- decimals: 2
- }, {
- name: "subTotalMoney",
- type: "sum",
- decimals: 2
- }],
- column: [{
- label: '轮胎名称',
- prop: 'goodsId',
- width: 200,
- disabled: false,
- remote: true,
- hide:true,
- overHidden: true,
- type: 'select',
- // dicData: [],
- props: {
- label: 'cname',
- value: 'id'
- },
- // dicUrl: '/api/blade-sales-part/goodsDesc/goodsListAll?cname={{key}}'
- dicUrl: "/api/blade-sales-part/goodsDesc/goodsListAll?cname={{key}}&enableOrNot=1"
- // dicUrl: "/api/blade-sales-part/goodsDesc/goodsListXs?cname={{key}}"
- },{
- label: '轮胎名称',
- prop: 'goodsName',
- width: 200,
- disabled: false,
- remote: true,
- overHidden: true,
- }, {
- label: '数量',
- prop: 'goodsNum',
- overHidden: true,
- disabled: false,
- cell:true,
- width: 100,
- rules: [{
- required: true,
- message: " ",
- trigger: "blur"
- }, {
- validator: (rule, value, callback) => {
- console.log(this.formContacts.inventory);
- if (value < 0) {
- callback(new Error("数量不能小于0"));
- } else {
- callback();
- }
- },
- trigger: "blur"
- }]
- },
- {
- label: '价格',
- prop: 'price',
- overHidden: true,
- width: 100,
- disabled: false,
- cell:true,
- rules: [{
- required: true,
- message: " ",
- trigger: "blur"
- }, {
- validator: (rule, value, callback) => {
- if (value < 0) {
- callback(new Error("价格不能小于0"));
- } else {
- callback();
- }
- },
- trigger: "blur"
- }]
- },
- {
- label: '库存',
- prop: 'inventory',
- overHidden: true,
- hide: true,
- width: 100
- }, {
- label: '批次号',
- prop: 'dot',
- cell:true,
- width:120,
- type: "select",
- disabled: true,
- allowCreate: true,
- filterable: true,
- dicData: [],
- props: {
- label: "dot",
- value: "dot"
- },
- dicUrl: "/api/blade-sales-part/stockDesc/dotList",
- overHidden: true,
- },{
- label: '小计',
- prop: 'subTotalMoney',
- overHidden: true,
- width: 100,
- disabled: true,
- editDisplay: false,
- addDisplay: false
- }, {
- label: '轮胎编码',
- prop: 'goodsNo',
- overHidden: true,
- disabled: false,
- width: 100
- },
- {
- label: '品牌',
- prop: 'brandName',
- disabled: false,
- width: 100,
- overHidden: true,
- },
- {
- label: '规格型号',
- prop: 'propertyName',
- overHidden: true,
- disabled: false,
- width: 100
- }, {
- label: '花纹',
- prop: 'pattern',
- overHidden: true,
- disabled: false,
- width: 100
- }, {
- label: '轮胎描述',
- prop: 'goodsDescription',
- disabled: false,
- overHidden: true,
- width: 100
- },
- {
- label: '单位',
- prop: 'units',
- type: "select",
- disabled: false,
- props: {
- label: "dictValue",
- value: "dictValue"
- },
- dicUrl: "/api/blade-system/dict-biz/dictionary?code=unit",
- overHidden: true,
- width: 100
- },
- {
- label: '收货数量',
- prop: 'sendNum',
- disabled: false,
- overHidden: true,
- width: 100,
- disabled: true,
- editDisplay: false,
- addDisplay: false
- },
- // {
- // label: '利润',
- // prop: 'profit',
- // overHidden: true,
- // width: 100
- // },
- // {
- // label: '返利',
- // prop: 'thisAmount',
- // overHidden: true,
- // width: 100
- // },
- // {
- // label: '成本',
- // prop: 'costprie',
- // overHidden: true,
- // width: 100,
- // disabled: true,
- // editDisplay: false,
- // addDisplay: false
- // },
- // {
- // label: '毛利',
- // prop: 'grossProfit',
- // overHidden: true,
- // width: 100,
- // disabled: true,
- // editDisplay: false,
- // addDisplay: false
- // },
- {
- label: '备注',
- prop: "remarks",
- overHidden: true,
- width: 100,
- disabled: false,
- }
- ]
- },
- optionPaymentDetails: {},
- optionPaymentDetailsBack: {
- align: 'center',
- index: true,
- addBtnText: "录入明细",
- menu: false,
- refreshBtn: false,
- dialogDrag: true,
- addBtn: false,
- span: 8,
- height: 600,
- addRowBtn: false,
- editBtn: false,
- delBtn: false,
- menuWidth: 140,
- dialogTop: 25,
- dialogWidth: "80%",
- column: [{
- label: '支付编号',
- prop: 'serialNumber'
- }, {
- label: '金额',
- prop: 'amount'
- }, {
- label: '类型',
- prop: 'type'
- }, {
- label: '支付时间',
- prop: 'createTime'
- }]
- },
- optionOutboundRecords: {},
- optionOutboundRecordsBack: {
- align: 'center',
- index: true,
- menu: false,
- addBtnText: "录入明细",
- refreshBtn: false,
- dialogDrag: true,
- addBtn: false,
- span: 8,
- height: 600,
- addRowBtn: false,
- editBtn: false,
- delBtn: false,
- // menuWidth: 140,
- dialogTop: 25,
- dialogWidth: "80%",
- column: [{
- label: '入库单号',
- prop: 'billno'
- },
- // {
- // label: '来源单号',
- // prop: 'ordNo'
- // },
- {
- label: '数量',
- prop: 'goodsTotalNum'
- }, {
- label: '实际数量',
- prop: 'sendTotalNum'
- }, {
- label: '业务类型',
- prop: 'bizTypeName'
- }, {
- label: '状态',
- prop: 'statusName'
- }, {
- label: '业务时间',
- prop: 'createTime'
- }]
- }
- }
- },
- components: { reportDialog, check, checkSchedule },
- props: {
- onLoad: Object,
- detailData: Object
- },
- async created() {
- this.findObject(this.optionContactsBack.column, "goodsId").click = ({ value, column }) => {
- this.$refs.formContacts.dicInit()
- }
- this.findObject(this.optionContactsBack.column, "goodsId").change = ({ value, column }) => {
- if (this.formContacts.goodsId !== value) {
- goodsDetail({ id: value, customId: this.dicUrlWithCustomId, stock: this.form.storageId ? this.form.storageId : '' }).then(res => {
- this.goods = res.data.data
- this.formContacts.goodsNo = res.data.data.code
- this.formContacts.brandId = res.data.data.brandId
- this.formContacts.inventory = res.data.data.inventory
- // this.formContacts.brandId = res.data.data.brandName
- // this.formContacts.brandName = res.data.data.brandId
- this.formContacts.propertyName = res.data.data.specificationAndModel
- this.formContacts.pattern = res.data.data.brandItem
- this.formContacts.goodsDescription = res.data.data.goodsDescription
- this.formContacts.units = res.data.data.unit
- this.formContacts.price = res.data.data.price
- //
- this.formContacts.sharedCompanyId = res.data.data.sharedCompanyId
- console.log(res.data.data.sharedCompanyId);
- console.log(res.data.data.sharedCompanyName);
- this.form.sharedCompanyId = res.data.data.sharedCompanyId
- this.form.sharedCompanyName = res.data.data.sharedCompanyName
- this.sharedCompanyId = res.data.data.sharedCompanyId
- console.log(res.data.data.sharedCompanyId);
- console.log(this.form.orderItemsList);
- for (let i = 0; i < this.form.orderItemsList.length; i++) {
- console.log(Number(this.form.orderItemsList[i].sharedCompanyId));
- if (Number(this.form.orderItemsList[i].sharedCompanyId) != Number(res.data.data.sharedCompanyId)) {
- this.isStatus = 0
- }
- }
- if (res.data.data.whether == 0) {
- this.findObject(this.optionContactsBack.column, "dot").disabled = true
- } else {
- this.findObject(this.optionContactsBack.column, "dot").disabled = false
- dotList({
- storageId: this.form.storageId,
- goodsId: this.formContacts.goodsId
- }).then(res => {
- this.findObject(this.optionContactsBack.column, "dot").dicData = res.data.data
- })
- }
- // this.formContacts.goodsId = res.data.data.cname
- // this.formContacts.goodsName = res.data.data.id
- })
- }
- }
- this.optionContacts = await this.getColumnData(this.getColumnName(269.1), this.optionContactsBack);
- this.findObject(this.optionContacts.column, "goodsId").change = ({ value, column }) => {
- if (this.formContacts.goodsId !== value) {
- goodsDetail({ id: value, customId: this.dicUrlWithCustomId, stock: this.form.storageId ? this.form.storageId : '' }).then(res => {
- this.goods = res.data.data
- this.formContacts.goodsNo = res.data.data.code
- this.formContacts.brandId = res.data.data.brandId
- this.formContacts.inventory = res.data.data.inventory
- // this.formContacts.brandId = res.data.data.brandName
- // this.formContacts.brandName = res.data.data.brandId
- this.formContacts.propertyName = res.data.data.specificationAndModel
- this.formContacts.pattern = res.data.data.brandItem
- this.formContacts.goodsDescription = res.data.data.goodsDescription
- this.formContacts.units = res.data.data.unit
- this.sharedCompanyId = res.data.data.sharedCompanyId
- this.formContacts.sharedCompanyId = res.data.data.sharedCompanyId
- //
- this.form.sharedCompanyId = res.data.data.sharedCompanyId
- this.form.sharedCompanyName = res.data.data.sharedCompanyName
- for (let i = 0; i < this.form.orderItemsList.length; i++) {
- if (this.form.orderItemsList[i].sharedCompanyId != res.data.data.sharedCompanyId) {
- this.isStatus = 0
- }
- }
- if (res.data.data.whether == 0) {
- this.findObject(this.optionContacts.column, "dot").disabled = true
- } else {
- this.findObject(this.optionContacts.column, "dot").disabled = false
- dotList({
- storageId: this.form.storageId,
- goodsId: this.formContacts.goodsId
- }).then(res => {
- this.findObject(this.optionContacts.column, "dot").dicData = res.data.data
- })
- }
- // this.formContacts.goodsId = res.data.data.cname
- // this.formContacts.goodsName = res.data.data.id
- })
- }
- }
- this.optionPaymentDetails = await this.getColumnData(this.getColumnName(269.2), this.optionPaymentDetailsBack);
- this.optionOutboundRecords = await this.getColumnData(this.getColumnName(269.3), this.optionOutboundRecordsBack);
- this.key++
- if (this.onLoad.id && this.detailData.id) {
- this.$set(this.optionForm, 'disabled', true)
- this.$set(this.optionContactsBack, 'disabled', true)
- this.isContacts = true
- this.isDisabled = true
- //添加删除按钮禁用
- this.isAdd = true
- this.refresh(this.onLoad.id, true)
- } else if (this.onLoad.id) {
- this.refresh(this.onLoad.id, true)
- }
- if (!this.form.id) {
- this.editButton = false // 第一次录入显示保存按钮
- this.optionContactsBack.column.forEach(its => {
- if (its.prop == 'goodsId' || its.prop == 'goodsNum' || its.prop == 'price' || its.prop == 'dot' || its.prop == 'remarks') {
- its.disabled = false
- } else {
- its.disabled = true
- }
- })
- this.isDisabledTask = true;
- // this.$set(this.optionContactsBack, "addBtn", false)
- this['optionContacts'] = this['optionContactsBack'];
- this.delColumnData(this.getColumnName('269.1'), this['optionContactsBack']);
- }
- if (!this.detailData.id) {
- this.isAddBtn = false
- this.isDisabledTask = false;
- this.form.businessSource = '内部销售'
- }
- if (this.detailData.check) {
- console.log('this.detailData.check', this.detailData.check);
- this.isExamineBtn = false
- // this.batchNo = this.detailData.check.batchNo
- }
- if (this.detailData.id) {
- this.getDetailsfun()
- }
- },
- watch: {
- 'form.sharedCompanyId'(newSharedCompanyId, oldSharedCompanyId) {
- console.log(newSharedCompanyId, oldSharedCompanyId);
- if (newSharedCompanyId != oldSharedCompanyId) {
- console.log('不能添加');
- }
- console.log(this.sharedCompanyId);
- },
- $route(to, from) {
- if (this.onLoad.id && this.detailData.id) {
- this.$set(this.optionForm, 'disabled', true)
- this.$set(this.optionContactsBack, 'disabled', true)
- this.isContacts = true
- this.isDisabled = true
- this.isAdd = true
- this.refresh(this.onLoad.id, true)
- } else if (this.onLoad.id) {
- console.log(2);
- this.refresh(this.onLoad.id, true)
- }
- // if (!this.form.id) {
- // console.log(3);
- // // this.$set(this.optionContactsBack, "addBtn", false)
- // this['optionContacts'] = this['optionContactsBack'];
- // this.delColumnData(this.getColumnName('269.1'), this['optionContactsBack']);
- // }
- // if (!this.detailData.id) {
- // this.form.businessSource = '内部销售'
- // }
- if (this.detailData.status == 1) {
- this.isExamineBtn = false;
- }
- // if (to.name == '销售订单') {
- // console.log('销售订单');
- // this.isExamineBtn = false;
- // }
- }
- },
- mounted() {
- this.$nextTick(() => {
- // 监听浏览器高度变化,改变表格高度
- window.onresize = () => {
- this.rowHeight = (window.innerHeight - 130) + 'px'
- }
- })
- },
- methods: {
- // 一键入库
- oneClickStorage(){
- this.$confirm("是否要一件入库?", "提示", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- }).then(()=>{
- const loading = this.$loading({
- lock: true,
- text: '加载中',
- spinner: 'el-icon-loading',
- background: 'rgba(255,255,255,0.7)'
- });
- shortcutWarehousing(this.form).then(res=>{
- this.$message.success("保存成功");
- this.refresh(res.data.data.id)
- loading.close();
- }).catch(()=>{
- loading.close();
- })
- })
- },
- // 获取明细信息
- getDetailsfun(){
- getDetails({
- id:this.detailData.id
- }).then(res=>{
- this.form = res.data.data
- this.form.orderItemsList = res.data.data.orderItemsList
- this.editButton = true //显示编辑按钮
- })
- },
- // 获取左侧筛选
- getAllWorkDicts(){
- getCorpType({ corpType: 'SP' }).then(res => {
- this.treeDataGoods = res.data.data;
- });
- },
- //导入页左商品类型查询
- nodeClick(data) {
- this.treeDeptId = data.id;
- this.page.currentPage = 1;
- this.onLoadfun(this.page, {goodsTypeId:this.treeDeptId});
- },
- closeGoods() {
- this.treeDataGoods = [];
- this.treeDeptId = "";
- this.activeNameTabs = "searchList";
- },
- //刷新触发
- refreshChange() {
- this.treeDeptId = ''
- this.page.currentPage = 1;
- this.onLoadfun(this.page);
- },
- // 这个方法是解决 this.onLoad is not a function 的问题
- onaloadfun(page, params = { artsVision: this.form.belongToCorpId }) {
- this.loading = true;
- getList({
- ...params,
- current: page.currentPage,
- size: page.pageSize
- }).then(res=>{
- console.log(res,1213)
- const data = res.data.data;
- this.page.total = data.total;
- this.pageList.total = data.total
- this.data = data.records;
- this.goodsListShow = data.records;
- this.loading = false;
- })
- // getList(page.currentPage, page.pageSize, Object.assign(params, this.query), this.treeDeptId, null).then(res => {
- // const data = res.data.data;
- // this.page.total = data.total;
- // this.pageList.total = data.total
- // this.data = data.records;
- // this.goodsListShow = data.records;
- // this.loading = false;
- // });
- },
- //选中触发
- selectionChange(list) {
- this.tableData = list
- },
- // 点击搜索触发
- goodsSearch(params, done) {
- this.treeDeptId = ''
- params = {
- ...params,
- artsVision: this.form.belongToCorpId
- }
- this.onLoadfun(this.page, params);
- done()
- },
- // 标签页切换
- tabHandle(data) {
- if (data.name == 'searchList') {
- this.goodsListShow = this.data;
- this.page.total = this.pageList.total
- } else if (data.name == 'importStaging') {
- this.goodsListShow = this.goodsListSave;
- this.page.total = 0
- }
- },
- // 商品信息价格计算
- amountChange(value,row) {
- if (value > 0) {
- this.$refs.crud.toggleRowSelection(row,true);
- }else {
- this.$refs.crud.toggleRowSelection(row,false);
- }
- // 价格
- // if (!row.price) {
- // row.price = 0;
- // }
- },
- importStagList(row, index, type) {
- this.goodsListSave.push(row);
- },
- removeStagList(row, index, type) {
- this.goodsListSave.splice(row.$index, 1)
- },
- //确认导入触发
- async importGoods() {
- this.surplusRouteQuantityOption.push({ storageQuantity: '0' });
- console.log(this.goodsListSave,'导入按钮')
- console.log(this.surplusRouteQuantityOption,'导入按钮2')
- console.log(this.tableData,'导入按钮3')
- if (this.goodsListSave.length > 0) {
- this.goodsListSaveHandle()
- } else {
- if (this.tableData.length > 0) {
- this.tableDataHandle()
- }
- }
- },
- // 导入按钮事件
- tableDataHandle(){
- // 循环获取库存数量
- for(let item of this.tableData) {
- console.log(item,'循环导入')
- let page = {}
- if (this.form.storageId) {
- page.storageId = this.form.storageId
- }
- page.goodsId = item.id
- dotList(page).then(res=>{
- console.log(res.data,'获取到的数据')
- let obj = {}
- if(res.data.data.length>0){
- obj.inventory = res.data.data[0].balanceQuantity
- if (item.dot) {
- obj.dot = item.dot
- }else {
- obj.dot = ''
- }
- }
- this.form.orderItemsList.push({
- ...obj,
- price:item.price,
- goodsId:item.id,
- goodsName:item.cname,
- dot:item.dot,
- brandName:item.brandName,
- brandId:item.brandId,
- goodsNo:item.code,
- // propertyName:item.typeno,
- // 规格型号
- propertyName:item.specificationAndModel,
- // 花纹
- pattern:item.brandItem,
- // 轮胎描述
- goodsDescription:item.goodsDescription,
- goodsNum:item.goodsNum,
- units:item.unit,
- // sendNum:res.data.data[0],
- // 小计
- subTotalMoney:item.goodsNum * item.price,
- // 备注
- remarks:item.remarks,
- // 判断批次号是否可以编辑
- whether:item.whether,
- // 批次号的状态
- dotedittype:false,
- // 价格数量
- goodsNumtype:false,
- // 价格
- pricetype:false,
- // 是否是编辑状态
- mingxibaocun:true
- })
- })
- }
- this.dialogVisible = false
- },
- // 导入
- goodsListSaveHandle(){
- this.tableData = this.goodsListSave
- this.tableDataHandle()
- },
- //导入轮胎弹窗列表查询
- onLoadfun(page, params = { artsVision: this.form.belongToCorpId }) {
- this.loading = true;
- getList({
- ...params,
- current: page.currentPage,
- size: page.pageSize
- }).then(res=>{
- const data = res.data.data;
- this.page.total = data.total;
- this.pageList.total = data.total
- this.data = data.records;
- this.goodsListShow = data.records;
- // 获取单价数据
- for(let item of this.goodsListShow) {
- let page = {}
- item.goodsNum = item.goodsNum?item.goodsNum:0
- if (this.form.storageId) {
- page.storageId = this.form.storageId
- }
- page.goodsId = item.id
- if (this.form.storageId) {
- dotList(page).then(res=>{
- item.price = res.data.data[0].inventoryCostPrice?res.data.data[0].inventoryCostPrice:0
- })
- }
- }
- this.loading = false;
- })
- },
- // 采购明细行编辑
- hangeditBtn(row,index){
- this.picihaolistfun(row.id)
- row.dotedittype = true
- // 价格数量
- row.goodsNumtype = true
- row.pricetype = true
- // 编辑和保存状态切换
- this.mingxibaocun = false
- },
- // 保存按钮
- hangbaocun(row) {
- row.dotedittype = false
- row.goodsNumtype = false
- row.pricetype = false
- this.mingxibaocun = true
- },
- // 批次号获取数据
- picihaolistfun(goodsId){
- dotList({
- storageId:this.form.storageId,
- goodsId: goodsId
- }).then(res=>{
- this.picihaolist = res.data.data
- })
- },
- // 编辑
- editBtn(row, index) {
- this.confirmEditing()
- this.$refs.formContacts.dicInit()
- dotList({
- storageId: this.form.storageId,
- goodsId: this.formContacts.goodsId
- }).then(res => {
- this.findObject(this.optionContactsBack.column, "dot").dicData = res.data.data
- })
- },
- //表头编辑
- confirmEditing() {
- this.editButton = false // 让保存按钮出来
- this.viewDisabled = true // 请核审批禁用
- goodsListXs(this.dicUrlWithCustomId, this.form.storageId ? this.form.storageId : '').then(res => {
- this.findObject(this.optionContactsBack.column, "goodsId").dicData = res.data.data
- })
- if (this.form.status == '已收货') {
- this.viewDisabled = false
- return
- }
- if (this.form.status == '审核中') {
- this.$set(this.optionForm, 'disabled', false)
- this.findObject(this.optionForm.column, "customerId").disabled = true
- this.findObject(this.optionForm.column, "storageId").disabled = true
- this.findObject(this.optionForm.column, "businesDate").disabled = true
- this.findObject(this.optionForm.column, "phone").disabled = true
- this.findObject(this.optionForm.column, "receivableType").disabled = true
- this.isRevocationRequest = false // 撤销请核按钮放开
- this.viewDisabled = false // 请核审批大按钮可点击
- return
- }
- this.isAddBtn = false
- if (this.form.status == '已收货') {
- return
- }
- if (this.form.status == '已取消' || this.form.status == '退款请核') {
- this.isAddBtn = true
- }
- if (this.form.status == '待发货') {
- this.isAddBtn = true
- this.isDisabledTask = false
- }
- this.optionContactsBack.column.forEach(its => {
- if (its.prop == 'goodsId' || its.prop == 'goodsNum' || its.prop == 'price' || its.prop == 'dot' || its.prop == 'remarks') {
- its.disabled = false
- } else {
- its.disabled = true
- }
- })
- // this.$set(this.optionForm, 'disabled', false)
- // this.$set(this.optionContactsBack, 'disabled', false)
- this.isDisabled = false
- this.isAdd = false
- const loading = this.$loading({
- lock: true,
- text: '加载中',
- spinner: 'el-icon-loading',
- background: 'rgba(255,255,255,0.7)'
- });
- if (this.form.status == '待收货' || this.form.status == '已收货') {
- const loading = this.$loading({
- lock: true,
- text: '加载中',
- spinner: 'el-icon-loading',
- background: 'rgba(255,255,255,0.7)'
- });
- this.optionForm.column.forEach(its => {
- if (its.prop != 'remarks') {
- its.disabled = true
- } else {
- its.disabled = false
- }
- })
- this.optionContactsBack.column.forEach(its => {
- if (its.prop != 'remarks') {
- its.disabled = true
- } else {
- its.disabled = false
- }
- })
- loading.close()
- } else if (this.form.status == '录入') {
- this.isDisabledTask = false;
- this.viewDisabled = false;
- this.$set(this.optionForm, 'disabled', false)
- this.$set(this.optionContactsBack, 'disabled', false)
- this.isContacts = false
- //删除按钮
- this.isDisabled = false
- loading.close()
- } else if (this.form.status == '待确认') {
- this.isDisabledTask = false;
- this.isAddBtn = false;
- this.isAdd = false;
- this.isDisabled = false
- this.viewDisabled = false;
- // this.isDisabled = true
- loading.close()
- }
- if (this.form.status == '待收货') {
- this.isDisabledTask = false;
- this.viewDisabled = false;
- }
- this.form.outboundRecordsList.forEach(item => {
- if (item.statusName == '待出库') {
- this.isDisabledTask = true
- }
- })
- if (this.form.checkStatus == '审核完成') {
- this.$set(this.optionForm, 'disabled', false)
- this.$set(this.optionContactsBack, 'disabled', true)
- this.findObject(this.optionForm.column, "customerId").disabled = true
- this.findObject(this.optionForm.column, "storageId").disabled = true
- this.findObject(this.optionForm.column, "businesDate").disabled = true
- this.findObject(this.optionForm.column, "phone").disabled = true
- this.findObject(this.optionForm.column, "receivableType").disabled = true
- this.isContacts = true
- this.isDisabled = true
- //添加删除按钮禁用
- this.isAdd = true
- this.isAddBtn = true
- }
- loading.close()
- },
- generateOutbound() {
- if (!this.form.id) {
- this.$message.error('请先保存')
- } else {
- if (this.buttonText === '生成任务') {
- //生成任务逻辑
- if (this.form.orderItemsList.length <= 0) {
- this.$message.error('请录入明细');
- } else {
- this.$set(this.optionForm, 'disabled', true)
- this.$set(this.optionContactsBack, 'disabled', true)
- this.$refs["form"].validate((valid, done) => {
- if (valid) {
- this.$refs["form"].validate((valid, done) => {
- done();
- if (valid) {
- const loading = this.$loading({
- lock: true,
- text: '加载中',
- spinner: 'el-icon-loading',
- background: 'rgba(255,255,255,0.7)'
- });
- inboundTask({
- bsType: "CG",
- ...this.form
- }).then(res => {
- this.refresh(res.data.data.id)
- // this.isDisabledTask = false
- this.editButton = true
- this.isDisabledTask = true
- // 将按钮文本更改为"撤销任务"
- this.buttonText = '撤销任务';
- // 将按钮颜色更改为对应的颜色
- this.buttonColor = 'warning'; // 比如改为warning
- this.refresh(res.data.data.id, true)
- this.isContacts = true
- this.isAdd = true
- this.isDisabled = true
- // this.findObject(this.optionForm,'disabled') = true
- // this.findObject(this.optionContactsBack,'disabled') = true
- this.$message.success("生成入库任务成功");
- this.isApplySettlement = false
- loading.close();
- // generateShipTask(this.form).then(res => {
- // console.log(res.data);
- // // 将按钮文本更改为"撤销任务"
- // this.buttonText = '撤销任务';
- // // 将按钮颜色更改为对应的颜色
- // this.buttonColor = 'warning'; // 比如改为warning
- // this.refresh(res.data.data.id, true)
- // this.isContacts = true
- // this.isAdd = true
- // this.isDisabled = true
- // // this.findObject(this.optionForm,'disabled') = true
- // // this.findObject(this.optionContactsBack,'disabled') = true
- // this.$message.success("生成入库任务成功");
- // this.isApplySettlement = false
- // loading.close();
- //
- // }).finally(() => {
- // loading.close();
- // });
- }).finally(() => {
- loading.close();
- });
- } else {
- return false;
- }
- });
- done();
- } else {
- this.$message.error('请选择仓库')
- }
- })
- }
- } else {
- this.$refs["form"].validate((valid, done) => {
- console.log(valid);
- if (valid) {
- const loading = this.$loading({
- lock: true,
- text: '加载中',
- spinner: 'el-icon-loading',
- background: 'rgba(255,255,255,0.7)'
- });
- revokeInboundTask(this.form).then(res => {
- this.isDisabledTask = true
- this.editButton = true
- // 将按钮文本更改为"生成任务"
- this.buttonText = '生成任务';
- // 将按钮颜色还原为success
- this.buttonColor = 'success';
- this.$message.success("撤销入库成功");
- this.refresh(res.data.data.id)
- this.isApplySettlement = false
- loading.close();
- }).catch((err) => {
- console.log(err);
- if (err instanceof TooManyResultsException) {
- // 不显示错误消息
- return;
- }
- // 显示其他错误消息
- this.$message.error('发生错误,请稍后重试');
- }).finally(() => {
- loading.close();
- });
- done();
- }
- })
- }
- }
- },
- //联系人change
- contactsChange(e) {
- console.log(e);
- console.log(this.contactsOption);
- // 假设this.contactsOption是你的数组对象
- let matchedContact = this.contactsOption.find(item => item.contacts == e);
- // 判断是否找到匹配的对象
- this.$set(this.form, 'phone', matchedContact.tel)
- // this.$set(this.form, 'recAddress', matchedContact.belongtoarea + matchedContact.detailedAddress)
- },
- //修改提交触发
- editCustomer() {
- this.$refs["form"].validate((valid, done) => {
- done();
- let picihao = false
- if (valid) {
- for(let i in this.form.orderItemsList) {
- console.log(this.form.orderItemsList[i],1800)
- this.form.orderItemsList[i].subTotalMoney = this.form.orderItemsList[i].goodsNum * this.form.orderItemsList[i].price
- if (this.form.orderItemsList[i].pid) {
- }else {
- if(this.form.orderItemsList[i].whether == '1'){
- if(this.form.orderItemsList[i].dot){}else {
- this.$message.warning(`采购明细序号${Number(i)+1}的批次号不能为空`);
- picihao = true
- break;
- }
- }else {
- }
- }
- if (this.form.orderItemsList[i].goodsNum <= 0) {
- this.$message.warning(`采购明细序号${Number(i)+1}的数量不能为零`);
- picihao = true
- }
- }
- this.mingxibaocun = true
- if (picihao) {
- return
- }
- const loading = this.$loading({
- lock: true,
- text: '加载中',
- spinner: 'el-icon-loading',
- background: 'rgba(255,255,255,0.7)'
- });
- submit({
- bsType: "CG",
- ...this.form
- }).then(res => {
- this.$message.success("保存成功");
- this.refresh(res.data.data.id)
- this.isDisabledTask = false
- this.editButton = true // 让编辑按钮出来
- // this.isDisabledTask = false;
- // this.viewDisabled = false;
- this.isAddBtn = true // 表格的添加轮胎禁用
- this.$set(this.optionForm, 'disabled', true)
- this.$set(this.optionContactsBack, 'disabled', true)
- this.isContacts = true // 基础信息联系人 和地址插槽禁用
- // 表格的删除按钮禁用
- this.isDisabled = true
- this.isAdd = true // 表格的编辑和保存按钮禁用
- loading.close();
- }).finally(() => {
- loading.close();
- });
- } else {
- return false;
- }
- });
- },
- //保存
- save() {
- this.$refs["form"].validate((valid, done) => {
- done();
- if (valid) {
- const loading = this.$loading({
- lock: true,
- text: '加载中',
- spinner: 'el-icon-loading',
- background: 'rgba(255,255,255,0.7)'
- });
- inboundTask({
- bsType: "CG",
- ...this.form
- }).then(res => {
- console.log(1);
- this.refresh(res.data.data.id)
- this.isDisabledTask = false
- loading.close();
- }).finally(() => {
- loading.close();
- });
- } else {
- return false;
- }
- });
- },
- inBtn(){
- },
- //关闭弹窗表单
- beforeClose(done, type) {
- console.log(type);
- // if(row == "add"){
- // this.form.sharedCompanyId = this.form.sharedCompanyId?this.form.sharedCompanyId:''
- // this.form.sharedCompanyName = this.form.sharedCompanyName?this.form.sharedCompanyName:''
- // }
- console.log('this.form.sharedCompanyId', this.form.sharedCompanyId);
- console.log('this.form.sharedCompanyName', this.form.sharedCompanyName);
- done()
- },
- refresh(id, type) {
- const loading = this.$loading({
- lock: true,
- text: '加载中',
- spinner: 'el-icon-loading',
- background: 'rgba(255,255,255,0.7)'
- })
- goodsListAll().then(res=>{
- console.log();
- })
- getDetails({ id: id }).then(res => {
- this.form = res.data.data
- let ordForm = { srcBillNo: this.form.ordNo }
- let _this = this
- this.dataList = res.data.data.paymentRecordsList ? res.data.data.paymentRecordsList : [];
- this.$nextTick(() => {
- this.$refs.formContacts.doLayout()
- })
- // if (this.form.status !== '录入' &&
- // this.form.status !== '退款中' &&
- // this.form.status !== '已取消' &&
- // this.form.status !== '退款请核' &&
- // this.form.status !== '已退款' &&
- // this.form.status !== '待确认' &&
- // this.form.status !== '待收货') {
- // this.isApplySettlement = false;
- // }
- if (this.form.status == '审核中') {
- this.isApplySettlement = false;
- this.isRevocationRequest = false // 撤销请核能点击
- }
- // if (this.form.status == '待确认') {
- // this.isApplySettlement = true;
- // }
- // if (this.form.status === '已退款' || this.form.status === '已收货' || this.form.status === '已取消') {
- // // 禁用编辑按钮
- // console.log('按钮全部禁用');
- // this.isDisabledTask = true;
- // this.viewDisabled = true;
- // }
- // if (this.form.status === '已收货') {
- // this.isDisabledTask = true;
- // this.viewDisabled = true;
- // }
- //
- // if (this.form.status == '退款中') {
- // this.isConfirmRefundBtn = false;
- // }
- // if (this.form.status == '已取消') {
- // this.isConfirmRefundBtn = true;
- // }
- //
- if (this.form.generateTask == '已生成') {
- this.buttonText = '撤销任务';
- // this.isDisabledTask = false;
- this.buttonColor = 'warning'
- }
- // if (this.form.status == '退款请核' || this.form.status == '退款中') {
- // this.isRevocationRequest = false;
- // }
- //成本、毛利对销售角色隐藏
- this.optionForm.column.forEach(its => {
- if (JSON.parse(localStorage.getItem('saber-userInfo')).content.role_name.split(',').includes('销售')) {
- if (its.prop == 'cost' || its.prop == 'grossProfit') {
- this.$set(its, 'display', false)
- }
- }
- })
- this.form.orderItemsList.forEach((items) => {
- if (!items.subTotalMoney) {
- items.subTotalMoney = items.goodsNum * items.price
- items.grossProfit = items.subTotalMoney - items.costprie
- }
- })
- if (res.data.data.checkStatus == '审核完成') {
- console.log('审核完成');
- this.$set(this.optionForm, 'disabled', true)
- this.$set(this.optionContactsBack, 'disabled', true)
- this.isContacts = true
- this.isDisabled = true
- //添加删除按钮禁用
- this.isAdd = true
- }
- loading.close();
- }).catch(() => {
- loading.close();
- })
- },
- operationType() {
- },
- //请核关闭
- choceScheduleFun() {
- this.checkScheduleDialog = false
- },
- //关闭审核
- choceCheckFun() {
- this.refresh(this.onLoad.id)
- // this.isDisabledTask = false
- this.isExamineBtn = !this.isExamineBtn
- this.checkDialog = false;
- },
- //请核数据qing
- applySettlement(type) {
- this.$confirm("您确定请核吗?", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- }).then(() => {
- this.$refs["form"].validate((valid, done) => {
- done()
- if (valid) {
- const data = {
- id: this.form.id,
- url: '/tirePartsMall/salesManagement/purchaseOrder/index',
- pageStatus: "this.$store.getters.purchaseStatus",
- pageLabel: "采购订单",
- }
- const loading = this.$loading({
- lock: true,
- text: '加载中',
- spinner: 'el-icon-loading',
- background: 'rgba(255,255,255,0.7)'
- });
- checkOrderCG({ ...data }).then((res) => {
- this.refresh(res.data.data.id)
- this.$message.success('请核成功');
- this.isApplySettlement = !this.isApplySettlement
- loading.close();
- console.log(res);
- }).catch(() => { loading.close(); })
- }
- })
- })
- },
- //确认退款
- confirmRefundBtn() {
- this.$confirm("您确定退款吗?", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- }).then(() => {
- const loading = this.$loading({
- lock: true,
- text: '加载中',
- spinner: 'el-icon-loading',
- background: 'rgba(255,255,255,0.7)'
- });
- // this.form.orderItemsList.forEach((items) => {
- // let brandName = items.brandId
- // items.brandId = items.brandName
- // items.brandName = brandName
- // let goodsName = items.goodsId
- // items.goodsId = items.goodsName
- // items.goodsName = goodsName
- // })
- confirmRefund({ ...this.form }).then((res) => {
- loading.close()
- this.$message.success('确定退款成功');
- }).catch(() => { loading.close(); })
- })
- },
- //审批
- examineBtn() {
- this.checkData = this.$route.query.check
- this.checkDialog = true;
- },
- //撤销请核
- revocationRequest() {
- this.$confirm("您确定撤回此次申请吗?", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- }).then(() => {
- const loading = this.$loading({
- lock: true,
- text: '加载中',
- spinner: 'el-icon-loading',
- background: 'rgba(255,255,255,0.7)'
- });
- // this.form.orderItemsList.forEach((items) => {
- // if (!items.subTotalMoney) {
- // items.subTotalMoney = items.goodsNum * items.price
- // items.grossProfit = items.subTotalMoney - items.costprie
- // }
- // let brandName = items.brandId
- // items.brandId = items.brandName
- // items.brandName = brandName
- // let goodsName = items.goodsId
- // items.goodsId = items.goodsName
- // items.goodsName = goodsName
- // })
- revokeCheckOrderCG({ ...this.form }).then(res => {
- this.isRevocationRequest = !this.isRevocationRequest
- this.refresh(res.data.data.id)
- this.$message.success('撤回成功')
- loading.close();
- })
- })
- },
- rowDelBox(row, index, type) {
- this.$confirm("确定将选择数据删除?", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- }).then(() => {
- if (row.id) {
- delOrderItem({ ids: row.id }).then(res => {
- this.form.orderItemsList.splice(index, 1);
- this.$message.success("操作成功!");
- });
- } else {
- this.form[type].splice(index, 1);
- this.$message.success("操作成功!");
- }
- }
- );
- },
- rowSave(form, done, loading) {
- form.subTotalMoney = form.goodsNum * form.price
- form.goodsName = form.$goodsId
- if (this.isStatus) {
- console.log(form);
- done(form)
- } else {
- this.$message.error('请选择相同商户的轮胎')
- }
- console.log(form);
- // this.form.sharedCompanyId = res.data.data.sharedCompanyId
- // this.form.sharedCompanyName = res.data.data.sharedCompanyName
- },
- rowUpdate(form, index, done, loading) {
- this.$set(form,'goodsName',form.$goodsId)
- console.log(form);
- done(form)
- },
- // 新增轮胎
- rowAdd(row) {
- if (!this.form.customerId) {
- this.$message.error('请选择供应商')
- return
- }
- this.optionContactsBack.column.forEach(its => {
- if (its.prop == 'goodsId' || its.prop == 'goodsNum' || its.prop == 'price' || its.prop == 'dot' || its.prop == 'remarks') {
- its.disabled = false
- } else {
- its.disabled = true
- }
- })
- console.log('新增了', row);
- this.getAllWorkDicts()
- this.refreshChange()
- this.goodsListSave = []
- this.dialogVisible = true
- // this.$refs.formContacts.rowAdd()
- },
- uploadAfter(res, done, loading, column) {
- if (res instanceof Array) {
- this.form.orderItemsList = this.form.orderItemsList.concat(res)
- }
- this.excelBox = false;
- loading = false;
- done(res);
- },
- derivation() {
- window.open(
- `/api/blade-sales-part/ship/export-item?${this.website.tokenHeader
- }=${getToken()}`
- );
- },
- uploadBefore(file, done, loading) {
- done();
- loading = true;
- },
- //打印
- handlePrint() {
- this.switchDialog = !this.switchDialog;
- },
- onClose(val) {
- this.switchDialog = val;
- },
- //自定义列保存
- async saveColumnTwo(ref, option, optionBack, code) {
- /**
- * 已定义全局方法,直接使用,saveColumnData保存列数据方法,参数传值(表格名称,当前表格的option数据)
- * 已定义全局方法,直接使用,getColumnName方法用来获取枚举值,参数根据自己定义的code值获取中文名
- * 一定要执行异步操作,要等接口成功返回,才能执行下一行代码
- */
- const inSave = await this.saveColumnData(this.getColumnName(code), this[option]);
- if (inSave) {
- this.$message.success("保存成功");
- //关闭窗口
- this.$refs[ref].$refs.dialogColumn.columnBox = false;
- }
- },
- //自定义列重置
- async resetColumnTwo(ref, option, optionBack, code) {
- this[option] = this[optionBack];
- const inSave = await this.delColumnData(this.getColumnName(code), this[optionBack]);
- if (inSave) {
- this.$message.success("重置成功");
- this.$refs[ref].$refs.dialogColumn.columnBox = false;
- }
- },
- backToList(type) {
- this.$emit("backToList", type);
- },
- // 弹框的重置
- resetCrud(){
- this.$message.success("重置成功");
- },
- // 弹窗的保存
- saveCrud(){
- this.$message.success("保存成功");
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- ::v-deep .el-form-item {
- margin-bottom: 8px !important;
- }
- </style>
|