123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959 |
- <template>
- <!-- 修改销售订单 -->
- <div class="addSalePlan">
- <page-title>钢材订单修改</page-title>
- <!-- 订单基础信息 -->
- <el-form
- :inline="true"
- style="margin-top: 1rem;box-shadow: 0 2px 4px rgba(0, 0, 0, .12), 0 0 6px rgba(0, 0, 0, .04)"
- >
- <el-form-item>
- <label class="el-form-item__label" style="width: auto;">发货单位</label>
- <el-autocomplete
- class="inline-input"
- v-model="shipperName"
- :fetch-suggestions="querySearchCarrier"
- placeholder="请输入发货单位名称"
- :trigger-on-focus="false"
- @select="handleSelectCarrier"
- style="width:245px"
- >
- <template slot-scope="{ item }">
- <div class="name">{{ item.shipperName }}</div>
- </template>
- </el-autocomplete>
- </el-form-item>
- <el-form-item>
- <label class="el-form-item__label" style="width: auto;">收货单位</label>
- <el-autocomplete
- class="inline-input"
- v-model="consigneeName"
- :fetch-suggestions="querySearchConsignee"
- placeholder="请输入收货单位名称"
- :trigger-on-focus="false"
- @select="handleSelectConsignee"
- >
- <template slot-scope="{ item }">
- <div class="name">{{ item.consigneeCompanyName }}</div>
- </template>
- </el-autocomplete>
- </el-form-item>
- <el-form-item>
- <label class="el-form-item__label" style="width: auto;">是否自提</label>
- <el-select v-model="values" placeholder="请选择" style="width:60px">
- <el-option
- v-for="item in options"
- :key="item.values"
- :label="item.label"
- :value="item.values"
- >
- </el-option>
- </el-select>
- </el-form-item>
- <el-form-item>
- <label class="el-form-item__label" style="width: auto;">收款公司</label>
- <el-select v-model="values1" placeholder="请选择" style="width: 255px">
- <el-option
- v-for="item in receivingCompany"
- :key="item.values1"
- :label="item.label1"
- :value="item.values1"
- >
- </el-option>
- </el-select>
- </el-form-item>
- <el-form-item>
- <label class="el-form-item__label" style="width: auto;">业务员</label>
- <el-select v-model="saleMan" placeholder="请选择" style="width: 90px">
- <el-option
- v-for="item in saleMans"
- :key="item.value"
- :label="item.label"
- :value="item.value"
- >
- </el-option>
- </el-select>
- </el-form-item>
- <el-form-item>
- <label
- class="el-form-item__label"
- style="width: auto;margin-top: 0.3rem;"
- >摘要</label
- >
- </el-form-item>
- <el-form-item>
- <el-input
- v-model="remarks"
- placeholder="(非必填)"
- style="width: 100px"
- ></el-input>
- </el-form-item>
- </el-form>
- <!-- 车序号基础信息 -->
- <el-form :inline="true" style="margin-top: 1rem;">
- <el-form-item>
- <label class="el-form-item__label" style="width: auto;">收货地址</label>
- <el-input
- style="width: 400px"
- v-model="saleShipperAddressName"
- disabled
- >
- </el-input>
- <el-button type="primary" @click="ondrawerOut">选择</el-button>
- </el-form-item>
- <el-form-item>
- <label class="el-form-item__label" style="width: auto;"
- >可装货时间</label
- >
- <el-date-picker
- class="textinput3"
- v-model.number="saleDateOfReceipt"
- type="datetime"
- placeholder="选择日期时间"
- disabled
- >
- </el-date-picker>
- </el-form-item>
- <el-form-item>
- <label
- class="el-form-item__label"
- style="width: auto;margin-top: 0.4rem;"
- >收货客户电话</label
- >
- </el-form-item>
- <el-form-item>
- <el-input
- style="width: 150px"
- v-model="saleOrderConsigneeTel"
- placeholder="(非必填)"
- ></el-input>
- </el-form-item>
- <el-form-item>
- <label
- class="el-form-item__label"
- style="width: auto;margin-top: 0.4rem;"
- >备注</label
- >
- </el-form-item>
- <el-form-item>
- <el-input
- style="width: 180px"
- v-model="truckRemark"
- placeholder="(非必填)"
- ></el-input>
- </el-form-item>
- </el-form>
- <div class="button-box">
- <el-button type="primary" class="btn" @click="addMaterial"
- ><i class="el-icon-circle-plus-outline"></i>新增物资</el-button
- >
- </div>
- <!-- 车辆拼装物资信息table1 -->
- <div class="selectionTable from">
- <el-table
- :data="materialList"
- border
- style="width: 100%"
- highlight-current-row
- >
- <el-table-column
- v-for="(item, i) in materialTableTop"
- :key="i"
- :prop="item.prop"
- :label="item.label"
- align="center"
- show-overflow-tooltip
- >
- <!-- 插入输入框 -->
- <template slot-scope="scope">
- <template v-if="item.slot">
- <!-- 物资件数 -->
- <template v-if="item.prop == 'orderPlanWeight'">
- <el-input
- class="textinput111"
- v-model.number="scope.row.orderPlanWeight"
- placeholder="(必填)"
- ></el-input>
- </template>
- <!-- 米数 -->
- <template v-if="item.prop == 'meterNumber'">
- <el-input
- v-if="scope.row.haveMeter == 1"
- class="textinput111"
- v-model.number="scope.row.meterNumber"
- :disabled="scope.row.isDisable == 1"
- placeholder="(必填)"
- ></el-input>
- </template>
- <!-- 分装车数 -->
- <template v-if="item.prop == 'carNumber'">
- <el-input
- v-if="materialList.length == 1"
- class="textinput111"
- v-model.number="scope.row.carNumber"
- placeholder="(非必填)"
- ></el-input>
- </template>
- <!-- 是否磅重销售 -->
- <template v-if="item.prop == 'isPound'">
- <el-select
- v-model="scope.row.isPound"
- placeholder="请选择"
- style="width:65px"
- >
- <el-option
- v-for="item in options2"
- :key="item.values2"
- :label="item.label2"
- :value="item.values2"
- >
- </el-option>
- </el-select>
- </template>
- </template>
- <template v-else>
- <span>{{ scope.row[item.prop] }}</span>
- </template>
- </template>
- </el-table-column>
- <!-- 操作列 -->
- <el-table-column fixed="right" label="操作" width="100">
- <template slot-scope="scope">
- <el-button
- @click.native.prevent="
- deleteMaterialRow(scope.$index, materialList)
- "
- type="text"
- icon="el-icon-close"
- size="big"
- ></el-button>
- </template>
- </el-table-column>
- </el-table>
- </div>
- <!-- 新增物资和生成一车 -->
- <div class="button-box">
- <el-input
- style="width: 60px;margin-right: 0.3rem;border:2px solid;"
- v-model="toCxh"
- ></el-input>
- <el-button type="primary" class="btn" @click="addToCxh"
- >添加到车序号</el-button
- >
- <el-button type="primary" class="btn" @click="createACar"
- >添加到订单</el-button
- >
- </div>
- <div style="margin-left: 0.3rem;color:red">(注:一个车序号代表一辆车)</div>
- <!-- 销售订单信息table2 -->
- <div class="selectionTable from">
- <el-table
- :data="selectionList"
- border
- style="width: 100%"
- :span-method="cellMerge"
- highlight-current-row
- >
- <el-table-column
- v-for="(item, i) in tableTop"
- :key="i"
- :prop="item.prop"
- :label="item.label"
- :width="item.width"
- align="center"
- show-overflow-tooltip
- >
- <template slot="scope" v-if="item.label !== '物资名称'">
- <span>{{ item.label }}</span>
- </template>
- <template slot="scope" v-if="item.label !== '件数'">
- <span>{{ item.label }}</span>
- </template>
- <template slot="scope" v-if="item.label !== '收货地址'">
- <span>{{ item.label }}</span>
- </template>
- <!-- <template slot="scope" v-if="item.label !== '收货日期'">
- <span>{{ item.label }}</span>
- </template> -->
- <template slot="scope" v-if="item.label !== '收货姓名'">
- <span>{{ item.label }}</span>
- </template>
- <template slot="scope" v-if="item.label !== '收货方电话'">
- <span>{{ item.label }}</span>
- </template>
- <!-- 插入输入框 -->
- <template slot-scope="scope">
- <template v-if="item.slot">
- <!-- 物资名称 -->
- <template v-if="item.prop == 'materialName'">
- <el-input
- style="width: 200px"
- v-model="scope.row.materialName"
- disabled
- >
- </el-input>
- <el-button type="primary" @click="changeMaterial(scope.$index)"
- >更改</el-button
- >
- </template>
- <!-- 物资件数 -->
- <template v-if="item.prop == 'orderPlanWeight'">
- <el-input
- class="textinput"
- v-model.number="scope.row.orderPlanWeight"
- ></el-input>
- </template>
- <!-- 米数 -->
- <template v-if="item.prop == 'meterNumber'">
- <el-input
- v-if="scope.row.haveMeter == 1"
- class="textinput"
- v-model.number="scope.row.meterNumber"
- :disabled="scope.row.isDisable == 1"
- ></el-input>
- </template>
- <!-- 是否磅重销售 -->
- <template v-if="item.prop == 'isPound'">
- <el-select
- v-model="scope.row.isPound"
- placeholder="请选择"
- style="width:65px"
- >
- <el-option
- v-for="item in options2"
- :key="item.values2"
- :label="item.label2"
- :value="item.values2"
- >
- </el-option>
- </el-select>
- </template>
- <!-- 收货地址id -->
- <template
- style="width: 380px"
- v-if="item.prop == 'saleShipperAddressName'"
- >
- <el-input
- style="width: 310px"
- v-model="scope.row.saleShipperAddressName"
- disabled
- >
- </el-input>
- <el-button
- type="primary"
- @click="ondrawer(scope.row, scope.$index)"
- >选择</el-button
- >
- </template>
- <!-- 收货客户电话号码 -->
- <template v-if="item.prop == 'saleOrderConsigneeTel'">
- <el-input
- class="textinput5"
- placeholder="(必填)"
- v-model.number="scope.row.saleOrderConsigneeTel"
- @change="batchUpdateValue(scope.row, scope.$index)"
- ></el-input>
- </template>
- </template>
- <template v-else>
- <span>{{ scope.row[item.prop] }}</span>
- </template>
- </template>
- </el-table-column>
- <!-- 操作列 -->
- <el-table-column fixed="right" label="操作" width="100">
- <template slot-scope="scope">
- <el-button
- @click.native.prevent="deleteRow(scope.$index, selectionList)"
- type="text"
- icon="el-icon-close"
- size="big"
- ></el-button>
- </template>
- </el-table-column>
- </el-table>
- </div>
- <!-- 收货地址弹出框 -->
- <el-dialog title="收货地址" :visible.sync="drawer1" width="90%">
- <el-form :inline="true">
- <el-form-item>
- <label class="el-form-item__label" style="width: auto;">省</label>
- <el-select
- v-model="province"
- filterable
- placeholder="请选择"
- @change="onchangeProvince"
- >
- <el-option
- v-for="item in provinceList"
- :key="item.id"
- :label="item.addressProvince"
- :value="item.id"
- ></el-option>
- </el-select>
- </el-form-item>
- <el-form-item>
- <label class="el-form-item__label" style="width: auto;">市</label>
- <el-select
- v-model="city"
- filterable
- placeholder="请选择"
- @change="onchangeCity"
- >
- <el-option
- v-for="item in cityList"
- :key="item.id"
- :label="item.addressDistrict"
- :value="item.id"
- ></el-option>
- </el-select>
- </el-form-item>
- <el-form-item>
- <label class="el-form-item__label" style="width: auto;">县(区)</label>
- <el-select
- v-model="county"
- filterable
- placeholder="请选择"
- @change="onchangeCounty"
- >
- <el-option
- v-for="item in countyList"
- :key="item.id"
- :label="item.addressTown"
- :value="item.id"
- ></el-option>
- </el-select>
- </el-form-item>
- <el-form-item>
- <label class="el-form-item__label" style="width: auto;"
- >具体收货地址</label
- >
- <el-autocomplete
- class="inline-input"
- v-model="place"
- :fetch-suggestions="querySearch1"
- placeholder="请输入具体收货地址"
- :trigger-on-focus="false"
- @select="handleSelect1"
- >
- </el-autocomplete>
- </el-form-item>
- </el-form>
- <div slot="footer" class="button-box">
- <el-button @click="drawer1 = false">取 消</el-button>
- <el-button type="primary" @click="addAddressClick">确定</el-button>
- </div>
- </el-dialog>
- <!-- 物资选择模态框 -->
- <el-drawer
- title="选择物资信息"
- :visible.sync="table1"
- direction="rtl"
- size="90%"
- :show-close="true"
- >
- <el-form :inline="true" style="margin-top: 0.5rem;">
- <el-form-item>
- <label class="el-form-item__label" style="width: auto;"
- >物资名称/型号</label
- >
- </el-form-item>
- <el-form-item>
- <el-input
- placeholder="请输入物资名称/型号"
- v-model="materialNameText"
- clearable
- ></el-input>
- </el-form-item>
- <el-form-item>
- <label class="el-form-item__label" style="width: auto;">规格</label>
- </el-form-item>
- <el-form-item>
- <el-input
- placeholder="请输入内容"
- v-model="materialSpecificationText"
- clearable
- ><template slot="prepend">Φ</template></el-input
- >
- </el-form-item>
- <el-button
- type="primary"
- class="btn"
- @click="onclick"
- style="margin-left: 4px;"
- ><i class="el-icon-search"></i>查询</el-button
- >
- <el-button type="primary" @click="makeSureMaterial"
- ><i class="el-icon-check"></i>确定</el-button
- >
- </el-form>
- <div class="tablecls">
- <!-- 查询所有的物资 -->
- <dilTable
- v-bind.sync="option"
- @selection-change="selectionChange"
- @rowDbClick="rowDbClick"
- >
- </dilTable>
- </div>
- </el-drawer>
- <!-- 更改行物资 -->
- <el-dialog title="更改物资" :visible.sync="drawer" width="80%">
- <el-form :inline="true" style="margin-top: 0.5rem;">
- <el-form-item>
- <label class="el-form-item__label" style="width: auto;"
- >物资名称</label
- >
- </el-form-item>
- <el-form-item>
- <el-input
- placeholder="请输入内容"
- v-model="materialNameText"
- clearable
- ></el-input>
- </el-form-item>
- <el-form-item>
- <label class="el-form-item__label" style="width: auto;">规格</label>
- </el-form-item>
- <el-button
- type="primary"
- class="btn"
- @click="onclick"
- style="margin-left: 4px;"
- ><i class="el-icon-search"></i>查询</el-button
- >
- </el-form>
- <div class="tablecls">
- <!-- 查询所有的物资 -->
- <dilTable
- v-bind.sync="option1"
- @radio-change="currentRadioChange"
- :drawer="drawer"
- >
- </dilTable>
- </div>
- <div class="button-box">
- <el-button @click="closeChangeMaterial">取消更改</el-button>
- <el-button type="primary" @click="makeSureChange">确认更改</el-button>
- </div>
- </el-dialog>
- <!-- 订单确认 -->
- <el-dialog
- title="订单明细 (注*: 请仔细确认订单物资和件数后再提交)"
- :visible.sync="orderMakeSure"
- width="94%"
- >
- <el-form :inline="true" style="margin-top: 0.5rem;">
- <el-form-item>
- <label class="el-form-item__label" style="width: auto;"
- >发货单位:</label
- >
- <el-tag size="big">{{ shipperName }}</el-tag>
- </el-form-item>
- <el-form-item>
- <label class="el-form-item__label" style="width: auto;"
- >收货单位:</label
- >
- <el-tag size="big">{{ consigneeName }}</el-tag>
- </el-form-item>
- <el-form-item>
- <label class="el-form-item__label" style="width: auto;"
- >是否自提:</label
- >
- <el-tag size="big">{{ saleOrderIsselfMention }}</el-tag>
- </el-form-item>
- <el-form-item>
- <label class="el-form-item__label" style="width: auto;"
- >收款公司:</label
- >
- <el-tag size="big">{{ saleOrderReceiveCustomer }}</el-tag>
- </el-form-item>
- <el-form-item>
- <label class="el-form-item__label" style="width: auto;"
- >业务员:</label
- >
- <el-tag size="big">{{ saleManText }}</el-tag>
- </el-form-item>
- <el-form-item>
- <label class="el-form-item__label" style="width: auto;">摘要:</label>
- <el-tag size="big" v-if="remarks != null">{{ remarks }}</el-tag>
- </el-form-item>
- </el-form>
- <!-- 物资明细信息 -->
- <el-table
- :data="selectionList"
- border
- style="width: 100%;margin-top: 0.5rem;"
- :span-method="cellMerge"
- highlight-current-row
- >
- <el-table-column
- v-for="(item, i) in tableTop"
- :key="i"
- :prop="item.prop"
- :label="item.label"
- :width="item.width"
- align="center"
- show-overflow-tooltip
- >
- </el-table-column>
- </el-table>
- <div class="button-box">
- <el-button @click="orderMakeSure = false">返回编辑</el-button>
- <el-button type="primary" @click="sendRequest">提交订单</el-button>
- </div>
- </el-dialog>
- <div class="button-box">
- <el-button @click="cancel">取消</el-button>
- <el-button type="primary" @click="makeSure">确定</el-button>
- </div>
- </div>
- </template>
- <script>
- import PageTitle from "@/components/Page/Title";
- import { sjTime, isIntegerNumber } from "@/utils/sharedJsFile";
- export default {
- components: { PageTitle },
- data() {
- return {
- truckRemark: "",
- shipperName: "四川省达州钢铁集团有限责任公司",
- shipperId: 1,
- consigneeName: null,
- consigneeId: null,
- remarks: null,
- saleShipperAddressName: null,
- saleShipperAddressId: null,
- saleDateOfReceipt: null,
- saleOrderConsigneeTel: null,
- //加载
- selectLineLoading: false,
- //物资选中暂存
- materialList1: [],
- //物资信息查询内容
- materialNameText: null,
- materialSpecificationText: null,
- materialModelText: null,
- //物资选中表格
- materialList: [],
- materialTableTop: [
- {
- prop: "materialName",
- label: "物资名称",
- width: "140"
- },
- {
- prop: "meterNumber",
- label: "米数",
- slot: true
- },
- {
- prop: "Specification",
- label: "规格型号",
- width: "140"
- },
- {
- prop: "orderPlanWeight",
- label: "件数",
- slot: true
- },
- {
- prop: "carNumber",
- label: "分装车数",
- slot: true
- },
- {
- prop: "isPound",
- label: "是否磅重销售",
- slot: true
- }
- ],
- truckRemark: "",
- table1: false,
- //添加到那个车序号
- toCxh: null,
- //最大车序号数
- maxCxh: 1,
- //存放每一行记录的合并数
- spanArr: [],
- //pos是spanArr的索引
- pos: 0,
- //判断是内层还是外层点击的收货地址浏览
- inOrOut: 0,
- //地址输入框的值
- addresText: "",
- //已选中省市县
- address: null,
- //具体地址
- place: null,
- //暂存具体地址
- place1: null,
- //省市县Id
- addressId: null,
- // input: "",
- //物资表格多选
- option: {
- // 表格请求数据的地址
- requestUrl: "/api/v1/uc/getSteelMaterial?apiId=244",
- // 控制显示多选列
- selectionType: "select"
- },
- //物资表格单选
- option1: {
- // 表格请求数据的地址
- requestUrl: "/api/v1/uc/getSteelMaterial?apiId=244",
- // 控制显示单选列
- selectionType: "radio"
- },
- selectionList: [],
- selectionList1: [],
- drawer1: false,
- direction: "rtl",
- form1: {},
- value: undefined,
- frist: {
- requestUrl: "/api/v1/ams/getAddressDeliveryAddress?apiId=255",
- selectionType: "radio",
- mapList: []
- },
- //所有省
- provinceList: [],
- //选中的省
- province: "",
- //所有市
- cityList: [],
- //选中的市
- city: "",
- //所有的县(区)
- countyList: [],
- //选中的县
- county: "",
- options: [
- {
- values: "yes",
- label: "是"
- },
- {
- values: "no",
- label: "否"
- }
- ],
- values: "no",
- //是否磅重销售
- options2: [
- {
- values2: 0,
- label2: "是"
- },
- {
- values2: 1,
- label2: "否"
- }
- ],
- values2: 1,
- receivingCompany: [
- {
- values1: "dzgt",
- label1: "四川省达州钢铁集团有限责任公司"
- },
- {
- values1: "dgsm",
- label1: "四川达钢商贸有限公司"
- }
- ],
- values1: "dzgt",
- saleMan: null,
- saleManText: null,
- saleMans: [],
- tableTop: [
- {
- prop: "cxh",
- label: "车序号",
- width: "50"
- },
- {
- prop: "materialName",
- label: "物资名称",
- width: "300",
- slot: true
- },
- {
- prop: "meterNumber",
- label: "米数",
- width: "60",
- slot: true
- },
- {
- prop: "Specification",
- label: "规格型号",
- width: "140"
- },
- {
- prop: "orderPlanWeight",
- label: "件数",
- width: "60",
- slot: true
- },
- {
- prop: "isPound",
- label: "是否磅重销售",
- width: "80",
- slot: true
- },
- {
- prop: "saleShipperAddressName",
- label: "收货地址",
- width: "400",
- slot: true
- },
- {
- prop: "saleOrderConsigneeTel",
- label: "收货客户电话",
- width: "140",
- slot: true
- },
- {
- prop: "truckRemark",
- label: "备注",
- width: "140",
- slot: true
- }
- ],
- row: {},
- //打开更改改物资弹出框
- drawer: false,
- //记录为内层打开
- isOpenDrawer: 0,
- //记录修改物资单选行的位置
- indexChangeMaterial: null,
- //记录单选物资Id
- selectedMaterialId: null,
- //记录单选物资名称
- selectedMaterialName: null,
- //记录单选物资规格
- selectedMaterialSpecification: null,
- //记录单选物资型号
- selectedMaterialModel: null,
- //记录单选物资编码
- selectedMaterialCode: null,
- //订单确认
- orderMakeSure: false,
- //是否自提记录字段
- saleOrderIsselfMention: null,
- //收款公司
- saleOrderReceiveCustomer: null,
- //是否忽视收货客户电话字段
- ignoreSaleOrderConsigneeTel: 0
- };
- },
- created() {
- let loadTime1 = new Date(
- new Date(new Date().toLocaleDateString()).getTime() +
- (3600 * 1000 * 8 - 1)
- ); // 当天8点前
- let loadTime2 = new Date(
- new Date(new Date().toLocaleDateString()).getTime() +
- (3600 * 1000 * 32 - 1)
- ); // 次天8点前
- if (new Date().getTime() - loadTime1 > 0) {
- this.saleDateOfReceipt = loadTime2;
- } else {
- this.saleDateOfReceipt = loadTime1;
- }
- //获取所有的省
- this.getAllProvince();
- //获取所有的业务员
- this.getAllsaleMan();
- //获取所有的销售订单信息
- this.getAllSaleMessages();
- },
- methods: {
- rowDbClick(row) {
- this.materialList1 = [];
- this.materialList1.push(row);
- this.makeSureMaterial();
- },
- //获取所有的销售订单信息
- getAllSaleMessages() {
- this.axios
- .post(
- "/api/v1/ams/getAllSaleMessages?saleOrderId=" +
- this.$route.params.saleOrderId
- )
- .then(res => {
- //销售订单基础数据
- console.log(res);
- this.shipperName = res.data.data.shipperName;
- this.shipperId = res.data.data.shipperId;
- this.consigneeName = res.data.data.receiveName;
- this.consigneeId = res.data.data.receiveId;
- if (res.data.data.isSelfMention == "否") {
- this.values = "no";
- } else {
- this.values = "yes";
- }
- if (
- res.data.data.saleOrderReceiveCustomer ==
- "四川省达州钢铁集团有限责任公司"
- ) {
- this.values1 = "dzgt";
- } else {
- this.values1 = "dgsm";
- }
- this.salerId = res.data.data.salerId;
- this.saleMan = res.data.data.salerId;
- this.saleRemark = res.data.data.saleRemark;
- //下方车序号数据
- res.data.data.mapList.forEach(e => {
- var haveMeter;
- if (e.steelMeters) {
- haveMeter = 1;
- } else {
- haveMeter = 0;
- }
- if (e.materialName.includes("米")) {
- var addmap = {
- cxh: e.truckNo,
- materialName: e.materialName,
- Specification: e.Specification,
- materialCode: e.materialCode,
- orderPlanWeight: e.materialNumber,
- isPound: e.isPoundSale,
- saleShipperAddressId: e.shipperAddressId,
- place: e.place,
- saleShipperAddressName: e.saleShipperAddressName + e.place,
- saleDateOfReceipt: e.saleDateOfReceipt,
- saleOrderConsigneeTel: e.saleOrderConsigneeTel,
- materialId: e.materialId,
- truckRemark: e.truckRemark,
- haveMeter: haveMeter,
- meterNumber: Number(e.materialName.replace(/[^0-9]/gi, "")),
- //有米数
- haveMeter: 1,
- isDisable: 1
- };
- } else {
- var addmap = {
- cxh: e.truckNo,
- materialName: e.materialName,
- Specification: e.Specification,
- materialCode: e.materialCode,
- orderPlanWeight: e.materialNumber,
- meterNumber: e.steelMeters,
- isPound: e.isPoundSale,
- saleShipperAddressId: e.shipperAddressId,
- place: e.place,
- saleShipperAddressName: e.saleShipperAddressName + e.place,
- saleDateOfReceipt: e.saleDateOfReceipt,
- saleOrderConsigneeTel: e.saleOrderConsigneeTel,
- materialId: e.materialId,
- truckRemark: e.truckRemark,
- haveMeter: haveMeter
- };
- }
- this.selectionList.push(addmap);
- });
- //调用记录每一行的合并数的方法
- this.getSpanArr(this.selectionList);
- //确定有多少车序号
- this.spanArr.forEach(item => {
- if (item > 0) {
- //最大车序号加1
- this.maxCxh += 1;
- }
- });
- });
- },
- //获取所有的业务员数据
- getAllsaleMan() {
- this.axios.get("/api/v1/uc/getSalerList").then(res => {
- this.saleMans = res.data.data;
- });
- },
- //获取所有省数据
- getAllProvince() {
- this.axios.post("/api/v1/uc/getAllProvince").then(res => {
- this.provinceList = res.data.data;
- });
- },
- //省改变
- onchangeProvince() {
- this.axios
- .post(
- "/api/v1/uc/getDistrictByProvince?addressProvince=" + this.province
- )
- .then(res => {
- this.cityList = res.data.data;
- });
- },
- //市改变
- onchangeCity() {
- this.axios
- .post("/api/v1/uc/getTownByDistrict?addressDistrict=" + this.city)
- .then(res => {
- this.countyList = res.data.data;
- });
- },
- //县(区)改变
- onchangeCounty() {
- let mapValue = {
- addressProvince: this.province,
- addressDistrict: this.city,
- addressTown: this.county
- };
- this.axios.post("/api/v1/uc/getPlaceByAllAddress", mapValue).then(res => {
- this.addressId = res.data.data[0].addressId;
- });
- },
- //发货单位弹出层
- handleSelectCarrier(item) {
- this.shipperName = item.shipperName;
- this.shipperId = item.shipperId;
- },
- //以下是发货单位边输边查搜索
- querySearchCarrier(queryString, cb) {
- this.axios
- .post("/api/v1/uc/getRequireUnitName?index=" + queryString)
- .then(res => {
- if (res.data.code == "200") {
- var restaurantsCarrier = res.data.data;
- var results = queryString
- ? restaurantsCarrier.filter(this.createFilterCarrier(queryString))
- : restaurantsCarrier;
- // 调用 callback 返回建议列表的数据
- cb(results);
- }
- });
- },
- createFilterCarrier(queryString) {
- return restaurantsCarrier => {
- return (
- restaurantsCarrier.shipperName
- .toLowerCase()
- .indexOf(queryString.toLowerCase()) > -1
- );
- };
- },
- //以上是发货单位边输边查搜索
- //收货单位弹出层
- handleSelectConsignee(item) {
- this.consigneeName = item.consigneeCompanyName;
- this.consigneeId = item.consigneeId;
- //带出摘要
- this.axios
- .post("/api/v1/uc/getSaleArea?receiveId=" + this.consigneeId)
- .then(res => {
- this.remarks = res.data.data;
- });
- this.axios
- .post(
- "/api/v1/ams/matchingAddressRecently?receiveId=" + this.consigneeId
- )
- .then(res => {
- const place = res.data.data;
- console.log(place);
- this.saleShipperAddressName =
- place[0].addressProvince +
- place[0].addressDistrict +
- place[0].addressTown +
- place[0].place;
- this.saleShipperAddressId = place[0].shipperAddressId;
- this.place1 = place[0].place;
- this.saleMan = place[0].salerId;
- this.saleOrderConsigneeTel = place[0].saleOrderConsigneeTel;
- });
- },
- //以下是收货单位边输边查搜索
- querySearchConsignee(queryString, cb) {
- this.axios
- .post("/api/v1/uc/getConsigneeByLike?index=" + queryString)
- .then(res => {
- if (res.data.code == "200") {
- var restaurantsConsignee = res.data.data;
- var results = queryString
- ? restaurantsConsignee.filter(
- this.createFilterConsignee(queryString)
- )
- : restaurantsConsignee;
- // 调用 callback 返回建议列表的数据
- cb(results);
- }
- });
- },
- createFilterConsignee(queryString) {
- return restaurantsConsignee => {
- return (
- restaurantsConsignee.value
- .toLowerCase()
- .indexOf(queryString.toLowerCase()) > -1
- );
- };
- },
- //以上是收货单位边输边查搜索
- //新增物资
- addMaterial() {
- if (!this.shipperName) {
- this.$message.warning("发货单位未填写!");
- } else if (!this.consigneeName) {
- this.$message.warning("收货单位未填写!");
- } else if (!this.consigneeId) {
- this.$message.error("请选择一个收货单位下拉框中的选项!");
- } else if (!this.saleMan) {
- this.$message.warning("业务员未选择!");
- } else {
- this.option.requestUrl =
- "/api/v1/uc/getSteelMaterial?apiId=244&i=" + new Date();
- this.table1 = true;
- }
- },
- //返回选中的物资信息
- selectionChange(selection) {
- this.materialList1 = [];
- this.materialList1 = selection;
- },
- //确认新增物资
- makeSureMaterial() {
- //记录是理重还是磅重
- var getisPound = 1;
- this.materialList1.forEach(e => {
- if (!e.materialSpecification) {
- e.materialSpecification = "";
- }
- if (!e.materialModel) {
- e.materialModel = "";
- }
- //判断物资是否为盘螺或非定尺
- if (
- e.materialName.includes("盘螺") ||
- e.materialName.includes("乱尺") ||
- e.materialName.includes("盘元") ||
- e.materialName.includes("盘圆")
- ) {
- getisPound = 0;
- } else {
- getisPound = 1;
- }
- //若物资为带有盘螺、盘圆、盘元,默认无米数
- if (
- e.materialName.includes("盘螺") ||
- e.materialName.includes("盘圆") ||
- e.materialName.includes("盘元")
- ) {
- var addmap = {
- materialName: e.materialName,
- Specification: e.materialSpecification + e.materialModel,
- materialCode: e.materialCode,
- orderPlanWeight: null,
- meterNumber: null,
- isPound: getisPound,
- //物资Id
- materialId: e.materialId,
- //无米数
- haveMeter: 0
- };
- } else {
- if (e.materialName.includes("米")) {
- console.log(e.materialName.replace(/[^0-9]/gi, ""));
- var addmap = {
- materialName: e.materialName,
- Specification: e.materialSpecification + e.materialModel,
- materialCode: e.materialCode,
- orderPlanWeight: null,
- meterNumber: Number(e.materialName.replace(/[^0-9]/gi, "")),
- isPound: getisPound,
- //物资Id
- materialId: e.materialId,
- //有米数
- haveMeter: 1,
- isDisable: 1
- };
- } else {
- var addmap = {
- materialName: e.materialName,
- Specification: e.materialSpecification + e.materialModel,
- materialCode: e.materialCode,
- orderPlanWeight: null,
- meterNumber: null,
- isPound: getisPound,
- //物资Id
- materialId: e.materialId,
- //有米数
- haveMeter: 1
- };
- }
- }
- this.materialList.push(addmap);
- });
- this.materialList1 = [];
- this.table1 = false;
- //初始化查询数据
- (this.materialNameText = null),
- (this.materialSpecificationText = null),
- (this.materialModelText = null);
- },
- //删除物资行数据
- deleteMaterialRow(index, rows) {
- rows.splice(index, 1);
- },
- //删除一车数据
- deleteRow(index, rows) {
- //删除车序号相同的行
- if (this.spanArr[index] == 1) {
- //动态调整车序号
- rows.forEach(e => {
- if (rows[index].cxh < e.cxh) {
- e.cxh -= 1;
- }
- });
- //最大车序号减1
- this.maxCxh -= 1;
- }
- rows.splice(index, 1);
- //调用记录每一行的合并数的方法
- this.getSpanArr(this.selectionList);
- },
- //准备生成部分订单
- createACar() {
- let i = 0;
- this.materialList.forEach(e => {
- if (!/(^[1-9]\d*$)/.test(e.meterNumber) && e.meterNumber != null) {
- e.meterNumber = null;
- i++;
- }
- });
- if (i != 0) {
- i = 0;
- this.$message.error("米数请输入正整数");
- return;
- }
- this.materialList.forEach(e => {
- if (!/(^[1-9]\d*$)/.test(e.orderPlanWeight)) {
- e.orderPlanWeight = null;
- i++;
- }
- });
- if (i != 0) {
- this.$message.error("件数必填且请输入正整数");
- return;
- }
- this.materialList.forEach(e => {
- if (e.materialName.includes("定尺")) {
- if (!e.meterNumber) {
- i++;
- }
- }
- });
- if (i != 0) {
- this.$message.error("定尺必须填写米数");
- return;
- }
- if (
- !this.saleOrderConsigneeTel &&
- this.ignoreSaleOrderConsigneeTel == 0
- ) {
- this.$confirm(
- "收货客户电话未填写会导致无法接收车辆发货短信, 是否继续?",
- "提示",
- {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- }
- )
- .then(() => {
- this.ignoreSaleOrderConsigneeTel = 1;
- this.addMaterialToSaleOrder();
- })
- .catch(() => {
- this.$message.info("已取消!");
- });
- } else {
- this.addMaterialToSaleOrder();
- }
- },
- //添加物资到订单
- addMaterialToSaleOrder() {
- if (this.materialList.length == 0) {
- this.$message.warning("请至少为这一车添加一个物资!");
- } else if (!this.saleShipperAddressName && this.values == "no") {
- this.$message.warning("收货地址未填写!");
- } else if (
- this.materialList.length == 1 &&
- this.materialList[0].carNumber != null
- ) {
- var eachOrderPlanWeight =
- this.materialList[0].orderPlanWeight / this.materialList[0].carNumber;
- if (isIntegerNumber(eachOrderPlanWeight)) {
- var e = this.materialList[0];
- for (var i = 0; i < this.materialList[0].carNumber; i++) {
- var addmap = {
- cxh: this.maxCxh,
- materialName: e.materialName,
- Specification: e.Specification,
- materialCode: e.materialCode,
- orderPlanWeight: eachOrderPlanWeight,
- meterNumber: e.meterNumber,
- isPound: e.isPound,
- saleShipperAddressId: this.saleShipperAddressId,
- place: this.place1,
- saleShipperAddressName: this.saleShipperAddressName,
- saleDateOfReceipt: this.saleDateOfReceipt,
- saleOrderConsigneeTel: this.saleOrderConsigneeTel,
- materialId: e.materialId,
- haveMeter: e.haveMeter,
- isDisable: e.isDisable
- };
- this.selectionList.push(addmap);
- //最大车序号加1
- this.maxCxh += 1;
- }
- //清空materialList
- this.materialList = [];
- //调用记录每一行的合并数的方法
- this.getSpanArr(this.selectionList);
- } else {
- this.$message.warning("分配件数不是整数!");
- }
- } else {
- this.materialList.forEach(e => {
- var addmap = {
- cxh: this.maxCxh,
- materialName: e.materialName,
- Specification: e.Specification,
- materialCode: e.materialCode,
- orderPlanWeight: e.orderPlanWeight,
- meterNumber: e.meterNumber,
- isPound: e.isPound,
- saleShipperAddressId: this.saleShipperAddressId,
- place: this.place1,
- saleShipperAddressName: this.saleShipperAddressName,
- saleDateOfReceipt: this.saleDateOfReceipt,
- saleOrderConsigneeTel: this.saleOrderConsigneeTel,
- materialId: e.materialId,
- haveMeter: e.haveMeter,
- isDisable: e.isDisable
- };
- this.selectionList.push(addmap);
- });
- //清空materialList
- this.materialList = [];
- //最大车序号加1
- this.maxCxh += 1;
- //调用记录每一行的合并数的方法
- this.getSpanArr(this.selectionList);
- }
- },
- // 添加物资到某个车序号
- addToCxh() {
- console.log("wkk");
- if (!this.toCxh) {
- this.$message.warning("请先在左侧输入要添加物资的车序号!");
- } else {
- this.addMaterialToCxh(this.toCxh);
- }
- },
- //添加物资到某个车序号
- addMaterialToCxh(toCxh) {
- let i = 0;
- this.materialList.forEach(e => {
- if (!/(^[1-9]\d*$)/.test(e.meterNumber) && e.meterNumber != null) {
- e.meterNumber = null;
- i++;
- }
- });
- if (i != 0) {
- i = 0;
- this.$message.error("米数请输入正整数");
- return;
- }
- this.materialList.forEach(e => {
- if (!/(^[1-9]\d*$)/.test(e.orderPlanWeight)) {
- e.orderPlanWeight = null;
- i++;
- }
- });
- if (i != 0) {
- this.$message.error("件数必填且请输入正整数");
- return;
- }
- this.materialList.forEach(e => {
- if (e.materialName.includes("定尺")) {
- if (!e.meterNumber) {
- i++;
- }
- }
- });
- if (i != 0) {
- this.$message.error("定尺必须填写米数");
- return;
- }
- if (this.materialList.length == 0) {
- this.$message.warning("请至少为这车序号添加一个物资!");
- } else {
- //保存当前车序号数据
- var arr = this.selectionList;
- //清空原车序号数据
- this.selectionList = [];
- //记录是否已经执行了新增物资插入操作
- var alreadyAdd = 0;
- //获取新增物资应当插入的位置并插入
- arr.forEach((item, index) => {
- if (item.cxh <= toCxh) {
- //插入到新增物资之前
- this.selectionList.push(item);
- } else {
- //插入新增物资
- if (alreadyAdd == 0) {
- this.materialList.forEach(e => {
- var addmap = {
- cxh: this.selectionList[index - 1].cxh,
- materialName: e.materialName,
- Specification: e.Specification,
- materialCode: e.materialCode,
- orderPlanWeight: e.orderPlanWeight,
- meterNumber: e.meterNumber,
- isPound: e.isPound,
- saleShipperAddressId: this.selectionList[index - 1]
- .saleShipperAddressId,
- place: this.selectionList[index - 1].place,
- saleShipperAddressName: this.selectionList[index - 1]
- .saleShipperAddressName,
- saleDateOfReceipt: this.selectionList[index - 1]
- .saleDateOfReceipt,
- saleOrderConsigneeTel: this.selectionList[index - 1]
- .saleOrderConsigneeTel,
- materialId: e.materialId,
- haveMeter: e.haveMeter,
- isDisable: e.isDisable
- };
- this.selectionList.push(addmap);
- });
- //清空materialList
- this.materialList = [];
- //设定为已经执行了车序号物资新增操作
- alreadyAdd = 1;
- }
- //插入到新增物资之后
- this.selectionList.push(item);
- }
- });
- //若添加的车序号为最后一个车序号
- if (alreadyAdd == 0) {
- //插入新增物资
- console.log("1345wjj");
- this.materialList.forEach(e => {
- var addmap = {
- cxh: arr[this.selectionList.length - 1].cxh,
- materialName: e.materialName,
- Specification: e.Specification,
- materialCode: e.materialCode,
- orderPlanWeight: e.orderPlanWeight,
- meterNumber: e.meterNumber,
- isPound: e.isPound,
- saleShipperAddressId:
- arr[this.selectionList.length - 1].saleShipperAddressId,
- place: arr[this.selectionList.length - 1].place,
- saleShipperAddressName:
- arr[this.selectionList.length - 1].saleShipperAddressName,
- saleDateOfReceipt:
- arr[this.selectionList.length - 1].saleDateOfReceipt,
- saleOrderConsigneeTel:
- arr[this.selectionList.length - 1].saleOrderConsigneeTel,
- materialId: e.materialId,
- haveMeter: e.haveMeter,
- isDisable: e.isDisable
- };
- this.selectionList.push(addmap);
- });
- //清空materialList
- this.materialList = [];
- }
- //调用记录每一行的合并数的方法
- this.getSpanArr(this.selectionList);
- }
- },
- //更改行物资
- changeMaterial(index) {
- this.option1.requestUrl =
- "/api/v1/uc/getSteelMaterial?apiId=244&i=" + new Date();
- this.drawer = true;
- this.isOpenDrawer = 1;
- this.indexChangeMaterial = index;
- },
- //关闭更改行物资
- closeChangeMaterial() {
- this.drawer = false;
- this.isOpenDrawer = 0;
- this.$message.info("取消更改!");
- },
- //单选一行物资
- currentRadioChange(row) {
- this.selectedMaterialId = row.materialId;
- this.selectedMaterialName = row.materialName;
- this.selectedMaterialSpecification = row.materialSpecification;
- this.selectedMaterialModel = row.materialModel;
- this.selectedMaterialCode = row.materialCode;
- },
- //确认物资修改
- makeSureChange() {
- if (!this.selectedMaterialId) {
- this.$message.warning("请先选择一个物资!");
- } else {
- if (!this.selectedMaterialSpecification) {
- this.selectedMaterialSpecification = "";
- }
- if (!this.selectedMaterialModel) {
- this.selectedMaterialModel = "";
- }
- //记录是理重还是磅重
- var getisPound = 1;
- //判断物资是否为盘螺或非定尺
- if (
- this.selectedMaterialName.includes("盘螺") ||
- this.selectedMaterialName.includes("乱尺") ||
- this.selectedMaterialName.includes("盘元") ||
- this.selectedMaterialName.includes("盘圆")
- ) {
- getisPound = 0;
- } else {
- getisPound = 1;
- }
- this.selectionList[
- this.indexChangeMaterial
- ].materialId = this.selectedMaterialId;
- this.selectionList[
- this.indexChangeMaterial
- ].materialName = this.selectedMaterialName;
- this.selectionList[this.indexChangeMaterial].Specification =
- this.selectedMaterialSpecification + this.selectedMaterialModel;
- this.selectionList[
- this.indexChangeMaterial
- ].materialCode = this.selectedMaterialModel;
- this.selectionList[this.indexChangeMaterial].isPound = getisPound;
- //确定更改的物资有无米数
- if (
- this.selectedMaterialName.includes("盘螺") ||
- this.selectedMaterialName.includes("盘圆") ||
- this.selectedMaterialName.includes("盘元")
- ) {
- this.selectionList[this.indexChangeMaterial].haveMeter = 0;
- this.selectionList[this.indexChangeMaterial].meterNumber = null;
- } else {
- this.selectionList[this.indexChangeMaterial].haveMeter = 1;
- }
- //重新初始化
- this.indexChangeMaterial = null;
- this.selectedMaterialId = null;
- this.selectedMaterialName = null;
- this.selectedMaterialSpecification = null;
- this.selectedMaterialModel = null;
- this.selectedMaterialCode = null;
- //关闭弹出框
- this.drawer = false;
- this.isOpenDrawer = 0;
- //初始化查询数据
- (this.materialNameText = null),
- (this.materialSpecificationText = null),
- (this.materialModelText = null);
- this.$message.success("成功更改!");
- }
- },
- //记录每一行的合并数
- getSpanArr(data) {
- //每次调用方法初始化
- this.spanArr = [];
- for (var i = 0; i < data.length; i++) {
- if (i === 0) {
- this.spanArr.push(1);
- this.pos = 0;
- } else {
- // 判断当前元素与上一个元素是否相同
- if (data[i].cxh === data[i - 1].cxh) {
- this.spanArr[this.pos] += 1;
- this.spanArr.push(0);
- } else {
- this.spanArr.push(1);
- this.pos = i;
- }
- }
- }
- },
- //根据条件合并行
- cellMerge({ row, column, rowIndex, columnIndex }) {
- if (columnIndex === 0) {
- const _row = this.spanArr[rowIndex];
- const _col = _row > 0 ? 1 : 0;
- return {
- rowspan: _row,
- colspan: _col
- };
- }
- if (columnIndex === 6) {
- const _row = this.spanArr[rowIndex];
- const _col = _row > 0 ? 1 : 0;
- return {
- rowspan: _row,
- colspan: _col
- };
- }
- if (columnIndex === 7) {
- const _row = this.spanArr[rowIndex];
- const _col = _row > 0 ? 1 : 0;
- return {
- rowspan: _row,
- colspan: _col
- };
- }
- },
- //点击外层收货地址浏览事件
- ondrawerOut() {
- if (this.inOrOut % 2 == 0) {
- this.inOrOut += 1;
- }
- this.frist.requestUrl =
- "/api/v1/ams/getAddressDeliveryAddress?apiId=255&i=" + new Date();
- this.drawer1 = true;
- },
- //点击内层收货地址浏览事件
- ondrawer(row, index) {
- if (this.inOrOut % 2 == 1) {
- this.inOrOut += 1;
- }
- this.row = row;
- this.row.index = index;
- this.frist.requestUrl =
- "/api/v1/ams/getAddressDeliveryAddress?apiId=255&i=" + new Date();
- this.drawer1 = true;
- },
- //查询全国省市县
- selectAddresClick() {
- if (this.addresText) {
- this.frist.requestUrl =
- "/api/v1/ams/getAddressDeliveryAddress?apiId=255&con=" +
- this.addresText;
- } else {
- this.frist.requestUrl =
- "/api/v1/ams/getAddressDeliveryAddress?apiId=255&i=" + new Date();
- }
- },
- //收货地址弹出层
- handleSelect1(item) {
- console.log("获取所有下拉值!");
- },
- //以下是收货地址边输边查搜索
- querySearch1(queryString, cb) {
- this.axios
- .post(
- "/api/v1/ams/getRealAddressByLike?addressId=" +
- this.addressId +
- "&index=" +
- queryString
- )
- .then(res => {
- if (res.data.code == "200") {
- var restaurants = res.data.data;
- var results = queryString
- ? restaurants.filter(this.createFilter1(queryString))
- : restaurants;
- // 调用 callback 返回建议列表的数据
- cb(results);
- }
- });
- },
- createFilter1(queryString) {
- return restaurants => {
- return (
- restaurants.value.toLowerCase().indexOf(queryString.toLowerCase()) >
- -1
- );
- };
- },
- //以上是收货地址边输边查搜索
- //监听收货地址模态框点击事件
- currentRadioChange1(radioList) {
- this.addressId = radioList.addressId;
- this.address = radioList.address;
- },
- //确定收货地址事件
- addAddressClick() {
- if (this.inOrOut % 2 == 0) {
- for (
- var i = this.row.index;
- i < this.spanArr[this.row.index] + this.row.index;
- i++
- ) {
- this.selectionList[i].saleShipperAddressId = this.addressId;
- this.selectionList[i].place = this.place;
- this.selectionList[i].saleShipperAddressName =
- this.province + this.city + this.county + this.place;
- }
- this.drawer1 = false;
- } else {
- this.saleShipperAddressId = this.addressId;
- this.saleShipperAddressName =
- this.province + this.city + this.county + this.place;
- this.drawer1 = false;
- }
- //初始化
- this.addressId = null;
- this.province = null;
- this.cityList = [];
- this.city = null;
- this.countyList = [];
- this.county = null;
- //暂存具体地址
- this.place1 = this.place;
- this.place = null;
- this.addresText = null;
- },
- //批量修改内层值
- batchUpdateValue(row, index) {
- for (var i = index; i < this.spanArr[index] + index; i++) {
- this.selectionList[i].saleOrderConsigneeTel = row.saleOrderConsigneeTel;
- }
- },
- //物资模态框查询
- onclick() {
- if (this.isOpenDrawer == 0) {
- this.option.requestUrl =
- "/api/v1/uc/getSteelMaterial?apiId=244&materialNameText=" +
- this.materialNameText +
- "&materialSpecificationText=" +
- this.materialSpecificationText +
- "&materialModelText=" +
- this.materialModelText;
- } else {
- this.option1.requestUrl =
- "/api/v1/uc/getSteelMaterial?apiId=244&materialNameText=" +
- this.materialNameText +
- "&materialSpecificationText=" +
- this.materialSpecificationText +
- "&materialModelText=" +
- this.materialModelText;
- }
- },
- // 确定
- makeSure() {
- if (this.selectionList.length == 0) {
- this.$message.warning("请先填写具体信息");
- return;
- }
- let i = 0;
- this.selectionList.forEach(e => {
- if (!/(^[1-9]\d*$)/.test(e.meterNumber) && e.meterNumber != null) {
- e.meterNumber = null;
- i++;
- }
- });
- if (i != 0) {
- i = 0;
- this.$message.error("米数请输入正整数");
- return;
- }
- this.selectionList.forEach(e => {
- if (!/(^[1-9]\d*$)/.test(e.orderPlanWeight)) {
- e.orderPlanWeight = null;
- i++;
- }
- });
- if (i != 0) {
- this.$message.error("件数必填且请输入正整数");
- return;
- }
- this.selectionList.forEach(e => {
- if (e.materialName.includes("定尺")) {
- if (!e.meterNumber) {
- i++;
- }
- }
- });
- if (i != 0) {
- this.$message.error("定尺必须填写米数");
- return;
- }
- //获取是否自提字段
- this.options.forEach(e => {
- if (this.values == e.values) {
- this.saleOrderIsselfMention = e.label;
- }
- });
- //获取收款公司字段
- this.receivingCompany.forEach(f => {
- if (this.values1 == f.values1) {
- this.saleOrderReceiveCustomer = f.label1;
- }
- });
- //获取业务员姓名
- this.saleMans.forEach(g => {
- if (this.saleMan == g.value) {
- this.saleManText = g.label;
- }
- });
- this.orderMakeSure = true;
- },
- //发送请求
- sendRequest() {
- //先调删除订单接口
- this.axios
- .post(
- "/api/v1/ams/deleteSaleOrderById?saleOrderId=" +
- this.$route.params.saleOrderId
- )
- .then(res => {
- if (res.data.code == "200") {
- this.orderMakeSure = false;
- //是否还有件数未填写
- var orderPlanWeightAllFill = 0;
- //初始化maplist
- var mapList = [];
- this.selectionList.forEach(item => {
- if (!item.orderPlanWeight) {
- orderPlanWeightAllFill++;
- }
- //初始化mapItem
- var mapItem = {
- //车序号
- truckNo: 0,
- //省市县id
- shipperAddressId: 0,
- //具体地址
- place: null,
- //截止日期
- saleDateOfReceipt: null,
- //收货方电话
- saleOrderConsigneeTel: "",
- //车序号物资ID
- materialId: 0,
- //物资件数
- materialNumber: 0,
- //米数
- steelMeters: 0,
- //是否磅重销售
- isPoundSale: 0
- };
- mapItem.truckNo = item.cxh;
- mapItem.shipperAddressId = item.saleShipperAddressId;
- mapItem.place = item.place;
- mapItem.saleDateOfReceipt = sjTime(item.saleDateOfReceipt);
- mapItem.saleOrderConsigneeTel = item.saleOrderConsigneeTel;
- mapItem.materialId = item.materialId;
- mapItem.materialNumber = item.orderPlanWeight;
- mapItem.steelMeters = item.meterNumber;
- mapItem.isPoundSale = item.isPound;
- mapList.push(mapItem);
- });
- let mapValue = {
- shipperId: this.shipperId,
- receiveId: this.consigneeId,
- isSelfMention: this.saleOrderIsselfMention,
- saleOrderReceiveCustomer: this.saleOrderReceiveCustomer,
- salerId: this.saleMan,
- saleRemark: this.remarks,
- mapList: mapList
- };
- //所有列件数都填写
- if (orderPlanWeightAllFill == 0) {
- this.axios
- .post("/api/v1/ams/addSteelSaleOrder", mapValue)
- .then(res => {
- if (res.data.code == "200") {
- this.$router.go(-1);
- }
- this.$message.success("修改订单成功!");
- });
- } else {
- this.$message.error("还有物资件数未填写!");
- }
- } else {
- this.$message.error("修改订单失败,请联系管理员!");
- }
- });
- },
- // 取消
- cancel() {
- this.$router.go(-1);
- },
- //关闭事件
- handleClose(done) {
- this.$confirm("确认关闭?")
- .then(_ => {
- done();
- })
- .catch(_ => {});
- },
- CloseClick() {}
- }
- };
- </script>
- <style lang="scss" scoped>
- .addSalePlan {
- width: 100%;
- }
- .el-drawer__body {
- overflow: auto;
- }
- .el-drawer__container ::-webkit-scrollbar {
- display: none;
- }
- .form-box,
- .from {
- display: flex;
- align-items: center;
- justify-content: center;
- margin-top: 5px;
- margin-bottom: 20px;
- }
- .button-box {
- display: flex;
- text-align: center;
- align-items: center;
- justify-content: center;
- margin-top: 0.3125rem;
- margin-bottom: 1.25rem;
- }
- .select {
- margin-left: -10rem;
- }
- .demo-form-inline {
- margin-left: 2rem;
- }
- .table_form {
- margin-left: -16rem;
- }
- .textinput111 {
- width: 83px;
- }
- .textinput {
- width: 50px;
- }
- .textinput1 {
- width: 50px;
- text-align: center;
- size: small;
- }
- .textinput2 {
- width: 50px;
- margin-right: 30px;
- }
- .textinput3 {
- width: 190px;
- }
- .textinput4 {
- width: 60px;
- }
- .textinput5 {
- width: 120px;
- }
- </style>
|