123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274 |
- <template>
- <div id="addOder">
- <el-card style="position: relative">
- <span>基本信息</span>
- <el-form :model="basicForm" :rules="basicRules" :show-message="false" ref="basic" label-width="auto">
- <el-row :gutter="10">
- <el-col :span="1.5">
- <el-form-item label="单据号">
- <el-input clearable disabled v-model="basicForm.code" size="mini" style="width: 200px"/>
- </el-form-item>
- </el-col>
- <el-col :span="1.5">
- <el-form-item label="单据日期">
- <el-date-picker clearable :disabled="sonDisable" v-model="basicForm.billDate" size="mini" type="date"
- value-format="yyyy-MM-dd"
- style="width: 200px"
- >
- </el-date-picker>
- </el-form-item>
- </el-col>
- <el-col :span="1.5">
- <el-form-item label="订单类型" prop="billType">
- <el-select clearable v-model="basicForm.billType" :disabled="sonDisable" size="mini" style="width: 200px">
- <el-option v-for="dict in dict.type.sys_allot_billtype" :key="dict.value" :label="dict.label" :value="dict.value">
- </el-option>
- </el-select>
- </el-form-item>
- </el-col>
- <el-col :span="1.5">
- <el-form-item label="调拨方式">
- <el-select clearable disabled v-model="basicForm.allotType" size="mini" style="width: 200px">
- <el-option v-for="dict in dict.type.sys_to_type" :key="dict.value" :label="dict.label" :value="dict.value">
- </el-option>
- </el-select>
- </el-form-item>
- </el-col>
- <el-col :span="1.5">
- <el-form-item label="单据状态">
- <el-select disabled v-model="basicForm.status"
- size="mini"
- style="width: 200px"
- >
- <el-option v-for="dict in dict.type.sys_status" :key="dict.value" :label="dict.label" :value="dict.value">
- </el-option>
- </el-select>
- </el-form-item>
- </el-col>
- <el-col :span="1.5">
- <el-form-item label="币种">
- <el-select clearable :disabled="sonDisable"
- size="mini"
- v-model="basicForm.currency"
- @focus="chooseRefer('CURRENCY_PARAM', true, '币种')"
- style="width: 200px"
- >
- <el-option v-for="item in currencyOptions" :key="item.id" :label="item.name" :value="item.id"/>
- </el-select>
- </el-form-item>
- </el-col>
- <el-col :span="1.5">
- <el-form-item label="总数量">
- <el-input disabled v-model="basicForm.qty" type="number" min="0" size="mini" style="width: 200px"/>
- </el-form-item>
- </el-col>
- <el-col :span="1.5">
- <el-form-item label="结算路径">
- <el-input clearable :disabled="sonDisable" v-model="basicForm.accountPath" size="mini" style="width: 200px"/>
- </el-form-item>
- </el-col>
- <el-col :span="1.5">
- <el-form-item label="折本汇率">
- <el-input-number
- v-model="basicForm.rate" size="mini" disabled :precision="2" :step="0.1" :max="10" style="width: 200px"></el-input-number>
- </el-form-item>
- </el-col>
- <el-col :span="1.5">
- <el-form-item label="客户">
- <DrPopoverSelectV2
- size="mini"
- v-model="basicForm.customerName"
- valueKey= "name"
- referName="CUSTOMER_PARAM"
- :dataMapping="{
- customer: 'id',
- customerName: 'name',
- }"
- :source.sync="basicForm"
- >
- </DrPopoverSelectV2>
- <!-- <el-select clearable :disabled="sonDisable"
- size="mini"
- v-model="basicForm.customer"
- @clear="clean('客户')"
- @focus="chooseRefer('CUSTOMER_PARAM', true, '客户')"
- style="width: 200px"
- >
- <el-option v-for="item in customerOptions" :key="item.id" :label="item.name" :value="item.id"/>
- </el-select> -->
- </el-form-item>
- </el-col>
- <el-col :span="1.5">
- <el-form-item label="物流项目组">
- <el-select clearable :disabled="sonDisable" v-model="basicForm.materialProject"
- size="mini"
- style="width: 200px"
- >
- <el-option v-for="dict in dict.type.sys_project_group" :key="dict.value" :label="dict.label" :value="dict.value">
- </el-option>
- </el-select>
- </el-form-item>
- </el-col>
- <el-col :span="1.5">
- <el-form-item label="利润中心">
- <el-select clearable :disabled="sonDisable"
- size="mini"
- v-model="basicForm.liacenter"
- @clear="clean('利润中心')"
- @focus="chooseTreeRefer('LIACENTER_PARAM', false, '利润中心')"
- style="width: 200px"
- >
- <el-option v-for="item in liacenterOptions" :key="item.id" :label="item.name" :value="item.id"/>
- </el-select>
- </el-form-item>
- </el-col>
- <el-col :span="1.5">
- <el-form-item label="在途归属">
- <el-input clearable disabled v-model="basicForm.onRouteAffilliation" size="mini" style="width: 200px"/>
- </el-form-item>
- </el-col>
- <el-col :span="1.5">
- <el-form-item label="备注">
- <el-input
- v-model="basicForm.remark"
- size="mini"
- :disabled="sonDisable"
- clearable
- style="width: 200px"
- />
- </el-form-item>
- </el-col>
- </el-row>
- <el-row :gutter="10">
- <el-col :span="1.5">
- <el-form-item label="调出库存组织" prop="deliveryInventoryOrg">
- <el-select clearable :disabled="sonDisable" size="mini" v-model="basicForm.deliveryInventoryOrg"
- @clear="clean('调出库存组织')"
- @change="controlCk('调出库存组织')"
- @focus="chooseRefer('ORG_PARAM', true, '调出库存组织')"
- style="width: 200px"
- >
- <el-option v-for="item in chuOrgOptions" :key="item.id" :label="item.name" :value="item.id"/>
- </el-select>
- </el-form-item>
- </el-col>
- <el-col :span="1.5">
- <el-form-item label="调出仓库" prop="deliveryWarehouse">
- <el-select clearable :disabled="sonDisable || isOrg"
- size="mini"
- v-model="basicForm.deliveryWarehouse"
- @clear="clean('调出仓库')"
- @change="controlDCHW"
- @focus="chooseRefer('WAREHOUSE_PARAM', true, '调出仓库', basicForm.deliveryInventoryOrg, 'N', 'N')"
- style="width: 200px"
- >
- <el-option v-for="item in chuHouseOptions" :key="item.id" :label="item.name" :value="item.id"/>
- </el-select>
- </el-form-item>
- </el-col>
- <el-col :span="1.5">
- <el-form-item label="调出部门" prop="deliveryDept">
- <el-select clearable :disabled="sonDisable || isOrg"
- size="mini"
- v-model="basicForm.deliveryDept"
- @focus="chooseRefer('DEPT_PARAM', true, '调出部门', '','','',{drpOrg:basicForm.deliveryInventoryOrg})"
- style="width: 200px"
- >
- <el-option v-for="item in deptOptions" :key="item.id" :label="item.name" :value="item.id"/>
- </el-select>
- </el-form-item>
- </el-col>
- <el-col :span="1.5">
- <el-form-item label="调出业务员">
- <el-select clearable :disabled="sonDisable"
- size="mini"
- v-model="basicForm.businessPersonal"
- @clear="clean('调出业务员')"
- @focus="chooseRefer('CONTACTS_PARAM', true, '调出业务员')"
- style="width: 200px"
- >
- <el-option v-for="item in manOptions" :key="item.id" :label="item.name" :value="item.code"/>
- </el-select>
- </el-form-item>
- </el-col>
- <el-col :span="1.5">
- <el-form-item label="调拨出库单号">
- <el-input
- v-model="basicForm.deliveryCode"
- size="mini"
- disabled
- style="width: 200px"
- />
- </el-form-item>
- </el-col>
- </el-row>
- <el-row :gutter="10">
- <el-col :span="1.5">
- <el-form-item label="调入库存组织" prop="storageInventoryOrg">
- <el-select clearable :disabled="sonDisable" size="mini" v-model="basicForm.storageInventoryOrg"
- @clear="clean('调入库存组织')"
- @change="controlCk('调入库存组织')"
- @focus="chooseRefer('ORG_PARAM', true, '调入库存组织')"
- style="width: 200px"
- >
- <el-option v-for="item in ruOrgOptions" :key="item.id" :label="item.name" :value="item.id"/>
- </el-select>
- </el-form-item>
- </el-col>
- <el-col :span="1.5">
- <el-form-item label="调入仓库" prop="storageWarehouse">
- <el-select clearable :disabled="sonDisable || isOrg"
- size="mini"
- v-model="basicForm.storageWarehouse"
- @clear="clean('调入仓库')"
- @change="controlDRHW"
- @focus="chooseRefer('WAREHOUSE_PARAM', true, '调入仓库', basicForm.storageInventoryOrg, 'N', 'N')"
- style="width: 200px"
- >
- <el-option v-for="item in ruHouseOptions" :key="item.id" :label="item.name" :value="item.id"/>
- </el-select>
- </el-form-item>
- </el-col>
- <el-col :span="1.5">
- <el-form-item label="调拨入库单号">
- <el-input
- v-model="basicForm.storageCode"
- size="mini"
- disabled
- style="width: 200px"
- />
- </el-form-item>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="1.5">
- <el-form-item label="NC单据号">
- <el-input
- v-model="basicForm.ncCode"
- size="mini"
- disabled
- style="width: 200px"
- />
- </el-form-item>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="20">
- <el-form-item label="同步NC结果">
- <el-input
- v-model="basicForm.isSendWms"
- type="textarea"
- :rows="3"
- size="mini"
- disabled
- clearable
- />
- </el-form-item>
- </el-col>
- </el-row>
- <div style='position: relative;'>
- <el-tabs style="margin-top: 10px" type="border-card">
- <el-tab-pane label="物料信息">
- <el-table
- v-loading="loading"
- :data="basicForm.materialInfo"
- fit
- border
- max-height="280"
- style="font-size: 12px"
- :row-class-name="rowClassName"
- >
- <el-table-column
- show-overflow-tooltip
- label="行号"
- align="center"
- prop="rowno"
- >
- <template slot-scope="scope">
- {{ scope.row.rowno = scope.$index + 1 + "0" }}
- </template>
- </el-table-column>
- <el-table-column
- show-overflow-tooltip
- label="采购需求单单号"
- align="center"
- prop="demandCode"
- width="150px"
- />
- <el-table-column
- show-overflow-tooltip
- label="物料编码"
- align="center"
- prop="materialCode"
- width="200px"
- :render-header="addRedStar"
- >
- <template slot-scope="scope">
- <el-form-item class="hang" :prop="'materialInfo.' + scope.$index + '.materialCode'" :show-message="false" :rules="{ required: true, message: '请选择物料', trigger: 'blur' }">
- <el-input
- clearable
- :disabled="sonDisable"
- size="mini"
- v-model="scope.row.materialCode"
- @clear="cleanMx(scope.$index, '物料编码')"
- @focus="chooseMaterial(scope.$index)"
- >
- <el-button
- size="mini"
- :disabled="sonDisable"
- slot="append"
- icon="el-icon-more"
- @click="chooseMaterial(scope.$index)"
- ></el-button>
- </el-input>
- </el-form-item>
- </template>
- </el-table-column>
- <el-table-column
- show-overflow-tooltip
- label="物料名称"
- align="center"
- prop="materialName"
- width="180px"
- />
- <el-table-column
- show-overflow-tooltip
- label="数量"
- align="center"
- prop="qty"
- width="150px"
- :render-header="addRedStar"
- >
- <template slot-scope="scope">
- <el-form-item class="hang" :prop="'materialInfo.' + scope.$index + '.qty'" :show-message="false" :rules="{ required: true, message: '请填写数量', trigger: 'blur' }">
- <el-input
- type="number"
- min="0"
- :disabled="sonDisable"
- clearable
- size="mini"
- v-model="scope.row.qty"
- @input="getSL(scope)"
- @change="changeQty()"
- />
- </el-form-item>
- </template>
- </el-table-column>
- <el-table-column
- show-overflow-tooltip
- label="调入部门"
- align="center"
- prop="storageDeptName"
- width="220px"
- :render-header="addRedStar"
- >
- <template slot-scope="scope">
- <el-form-item class="hang" :prop="'materialInfo.' + scope.$index + '.storageDeptName'" :show-message="false" :rules="{ required: true, message: '请填写调入部门', trigger: 'blur' }">
- <el-input
- clearable
- :disabled="sonDisable || isOrg"
- size="mini"
- v-model="scope.row.storageDeptName"
- @clear="cleanMx(scope.$index, '调入部门')"
- @focus="
- chooseMxBM(
- scope.$index,
- 'DEPT_PARAM',
- true,
- '调入部门',{drpOrg:basicForm.storageInventoryOrg}
- )
- "
- >
- <el-button
- size="mini"
- :disabled="sonDisable || isOrg"
- slot="append"
- icon="el-icon-more"
- @click="
- chooseMxBM(
- scope.$index,
- 'DEPT_PARAM',
- true,
- '调入部门',{drpOrg:basicForm.storageInventoryOrg}
- )
- "
- ></el-button>
- </el-input>
- </el-form-item>
- </template>
- </el-table-column>
- <!-- <el-table-column
- show-overflow-tooltip
- label="调拨日期"
- align="center"
- prop="allotDate"
- width="230px"
- :render-header="addRedStar"
- >
- <template slot-scope="scope">
- <el-form-item class="hang" :prop="'materialInfo.' + scope.$index + '.allotDate'" :show-message="false" :rules="{ required: true, message: '请填写调拨日期', trigger: 'blur' }">
- <el-date-picker
- ref="findDate"
- v-model="scope.row.allotDate"
- :disabled="sonDisable"
- type="date"
- size="mini"
- :picker-options="pickerOptionsEnd"
- value-format="yyyy-MM-dd"
- >
- </el-date-picker>
- </el-form-item>
- </template>
- </el-table-column> -->
- <el-table-column
- show-overflow-tooltip
- label="调拨出库单号"
- align="center"
- prop="deliveryCode"
- width="180px"
- />
- <el-table-column
- show-overflow-tooltip
- label="调拨入库单号"
- align="center"
- prop="storageCode"
- width="180px"
- />
- <el-table-column
- show-overflow-tooltip
- label="规格"
- align="center"
- prop="specification"
- />
- <el-table-column
- show-overflow-tooltip
- label="生产厂家/代理人"
- align="center"
- prop="manufacturer"
- width="250px"
- />
- <el-table-column
- show-overflow-tooltip
- label="产地"
- align="center"
- prop="originPlaceName"
- />
- <el-table-column
- show-overflow-tooltip
- label="型号"
- align="center"
- prop="model"
- />
- <el-table-column
- show-overflow-tooltip
- label="单位"
- align="center"
- prop="unitName"
- />
- <!-- <el-table-column show-overflow-tooltip label="调出仓库" align="center" prop="deliveryWarehouseName"/> -->
-
- <el-table-column
- show-overflow-tooltip
- label="主单位"
- align="center"
- prop="mainUnitName"
- />
- <el-table-column
- show-overflow-tooltip
- label="换算率"
- align="center"
- prop="equation"
- />
- <el-table-column
- show-overflow-tooltip
- label="主数量"
- align="center"
- prop="mainQty"
- width="150px"
- >
- <template slot-scope="scope">
- <el-form-item class="hang">
- <el-input
- type="number"
- min="0"
- :disabled="sonDisable"
- clearable
- size="mini"
- v-model="scope.row.mainQty"
- @input="getZSL(scope)"
- />
- </el-form-item>
- </template>
- </el-table-column>
- <el-table-column
- show-overflow-tooltip
- label="税率"
- align="center"
- prop="rate"
- />
- <el-table-column
- show-overflow-tooltip
- label="调出货位"
- align="center"
- prop="deliveryAllocationName"
- width="220px"
- >
- <template slot-scope="scope">
- <el-form-item class="hang">
- <el-input
- clearable
- :disabled="sonDisable || isDCCk"
- size="mini"
- v-model="scope.row.deliveryAllocationName"
- @clear="cleanMx(scope.$index, '调出货位')"
- @focus="
- chooseMxHW(
- scope.$index,
- 'ALLOCATION_PARAM',
- true,
- '调出货位',
- basicForm.deliveryWarehouse
- )
- "
- >
- <el-button
- size="mini"
- :disabled="sonDisable || isDCCk"
- slot="append"
- icon="el-icon-more"
- @click="
- chooseMxHW(
- scope.$index,
- 'ALLOCATION_PARAM',
- true,
- '调出货位',
- basicForm.deliveryWarehouse
- )
- "
- ></el-button>
- </el-input>
- </el-form-item>
- </template>
- </el-table-column>
- <el-table-column
- show-overflow-tooltip
- label="调入货位"
- align="center"
- prop="storageAllocationName"
- width="220px"
- >
- <template slot-scope="scope">
- <el-form-item class="hang">
- <el-input
- clearable
- :disabled="sonDisable || isDRCk"
- size="mini"
- v-model="scope.row.storageAllocationName"
- @clear="cleanMx(scope.$index, '调入货位')"
- @focus="
- chooseMxHW(
- scope.$index,
- 'ALLOCATION_PARAM',
- true,
- '调入货位',
- basicForm.storageWarehouse
- )
- "
- >
- <el-button
- size="mini"
- :disabled="sonDisable || isDRCk"
- slot="append"
- icon="el-icon-more"
- @click="
- chooseMxHW(
- scope.$index,
- 'ALLOCATION_PARAM',
- true,
- '调入货位',
- basicForm.storageWarehouse
- )
- "
- ></el-button>
- </el-input>
- </el-form-item>
- </template>
- </el-table-column>
- <el-table-column
- show-overflow-tooltip
- label="批次号"
- align="center"
- prop="patchNo"
- />
- <el-table-column
- show-overflow-tooltip
- label="产品批号"
- align="center"
- prop="producBatch"
- width="220px"
- >
- <template slot-scope="scope">
- <el-form-item class="hang">
- <el-input
- disabled
- size="mini"
- v-model="scope.row.producBatch"
- >
- <el-button
- size="mini"
- :disabled="sonDisable"
- slot="append"
- icon="el-icon-more"
- @click="chooseBatch(scope.$index)"
- ></el-button>
- </el-input>
- </el-form-item>
- </template>
- </el-table-column>
- <el-table-column
- show-overflow-tooltip
- label="生产日期"
- align="center"
- prop="manufactureDate"
- width="230px"
- >
- <template slot-scope="scope">
- <el-form-item class="hang">
- <el-date-picker
- v-model="scope.row.manufactureDate"
- :disabled="sonDisable"
- type="date"
- size="mini"
- value-format="yyyy-MM-dd"
- >
- </el-date-picker>
- </el-form-item>
- </template>
- </el-table-column>
- <el-table-column
- show-overflow-tooltip
- label="有效期至/失效日期"
- align="center"
- prop="periodEndDate"
- width="150px"
- />
- <el-table-column
- show-overflow-tooltip
- label="批准文号"
- align="center"
- prop="ratifyCode"
- />
- <el-table-column
- show-overflow-tooltip
- label="注册证号"
- align="center"
- prop="registration"
- />
- <el-table-column
- show-overflow-tooltip
- label="商品名"
- align="center"
- prop="productCode"
- />
- <el-table-column
- show-overflow-tooltip
- label="通用名"
- align="center"
- prop="commonCode"
- width="150px"
- />
- <el-table-column
- show-overflow-tooltip
- label="剂型"
- align="center"
- prop="drug"
- />
- <el-table-column
- show-overflow-tooltip
- label="调入调出结算规则明细"
- align="center"
- prop="ruleDetail"
- width="200px"
- />
- <el-table-column
- show-overflow-tooltip
- label="上市许可持有人"
- align="center"
- prop="marketingApprovalPersonal"
- width="150px"
- />
- <el-table-column
- show-overflow-tooltip
- label="生产许可证号/经营许可证号/备案凭证号"
- align="center"
- prop="production"
- width="270px"
- />
- <el-table-column
- show-overflow-tooltip
- label="pi码"
- align="center"
- prop="pi"
- >
- <!-- <template slot-scope="scope">
- <el-form-item class="hang">
- <el-input
- :disabled="sonDisable"
- size="mini"
- v-model="scope.row.pi"
- />
- </el-form-item>
- </template> -->
- </el-table-column>
- <!-- <el-table-column show-overflow-tooltip label="无税金额" align="center" prop="code"/> -->
- <!-- <el-table-column show-overflow-tooltip label="备注" align="center" prop="code"/> -->
- <el-table-column
- show-overflow-tooltip
- label="类别"
- align="center"
- prop="classify"
- />
- <el-table-column
- show-overflow-tooltip
- label="客户物料码"
- align="center"
- prop="customerLogistic"
- width="150px"
- />
- <el-table-column
- show-overflow-tooltip
- label="客户物料名称"
- align="center"
- prop="customerLogisticName"
- width="150px"
- />
- <el-table-column fixed="right" label="操作" align="center">
- <template slot-scope="scope">
- <el-button
- type="text"
- size="mini"
- :disabled="sonDisable"
- @click="delLine(scope.$index, scope.row)"
- >删除</el-button
- >
- </template>
- </el-table-column>
- </el-table>
- </el-tab-pane>
- <el-tab-pane label="收发货信息">
- <el-table
- :data="receiveInfo"
- fit
- border
- max-height="280"
- style="font-size: 12px"
- >
- <el-table-column
- show-overflow-tooltip
- label="行号"
- align="center"
- prop="rowno"
- />
- <el-table-column
- show-overflow-tooltip
- label="调拨出库单号"
- align="center"
- prop="deliveryCode"
- width="150px"
- />
- <el-table-column
- show-overflow-tooltip
- label="调拨入库单号"
- align="center"
- prop="storageCode"
- width="150px"
- />
- <el-table-column
- show-overflow-tooltip
- label="生产厂家/代理人"
- align="center"
- prop="manufacturer"
- width="150px"
- />
- <el-table-column
- show-overflow-tooltip
- label="产地"
- align="center"
- prop="originPlace"
- width="150px"
- />
- <el-table-column
- show-overflow-tooltip
- label="类别"
- align="center"
- prop="classify"
- width="150px"
- />
- <el-table-column
- show-overflow-tooltip
- label="调出仓库"
- align="center"
- prop="deliveryWarehouseName"
- width="150px"
- />
- <el-table-column
- show-overflow-tooltip
- label="调入仓库"
- align="center"
- prop="storageWarehouseName"
- width="150px"
- />
- <!-- <el-table-column show-overflow-tooltip label="收货利润中心" align="center" prop="code"/>
- <el-table-column show-overflow-tooltip label="发货利润中心" align="center" prop="code"/> -->
- <el-table-column
- show-overflow-tooltip
- label="调入业务员"
- align="center"
- prop="businessPersonalName"
- width="150px"
- />
- <el-table-column
- show-overflow-tooltip
- label="产品批号"
- align="center"
- prop="productBatch"
- width="150px"
- />
- <el-table-column
- show-overflow-tooltip
- label="生产日期"
- align="center"
- prop="manufactureDate"
- width="150px"
- />
- <el-table-column
- show-overflow-tooltip
- label="有效期至/失效日期"
- align="center"
- prop="periodEndDate"
- width="150px"
- />
- <el-table-column
- show-overflow-tooltip
- label="批准文号"
- align="center"
- prop="ratifyCode"
- width="150px"
- />
- <el-table-column
- show-overflow-tooltip
- label="注册证号"
- align="center"
- prop="registration"
- width="150px"
- />
- <el-table-column
- show-overflow-tooltip
- label="商品名"
- align="center"
- prop="productCode"
- width="150px"
- />
- <el-table-column
- show-overflow-tooltip
- label="通用名"
- align="center"
- prop="commonCode"
- width="150px"
- />
- <el-table-column
- show-overflow-tooltip
- label="剂型"
- align="center"
- prop="drug"
- width="150px"
- />
- <el-table-column
- show-overflow-tooltip
- label="收货客户"
- align="center"
- prop="customerName"
- width="150px"
- />
- <el-table-column
- show-overflow-tooltip
- label="收货地址"
- align="center"
- prop="addressaddress"
- width="150px"
- />
- <el-table-column
- show-overflow-tooltip
- label="收货地区"
- align="center"
- prop="area"
- width="150px"
- />
- <el-table-column
- show-overflow-tooltip
- label="收货地点"
- align="center"
- prop="place"
- width="150px"
- />
- <el-table-column
- show-overflow-tooltip
- label="计划发货日期"
- align="center"
- prop="deliveryDate"
- width="150px"
- />
- <el-table-column
- show-overflow-tooltip
- label="计划到货日期"
- align="center"
- prop="strageDate"
- width="150px"
- />
- <el-table-column
- show-overflow-tooltip
- label="运输方式"
- align="center"
- prop="transportation"
- width="150px"
- />
- <el-table-column
- show-overflow-tooltip
- label="备注"
- align="center"
- prop="remark"
- width="150px"
- />
- <el-table-column
- show-overflow-tooltip
- label="客户物料编码"
- align="center"
- prop="customerLogistic"
- width="150px"
- />
- <el-table-column
- show-overflow-tooltip
- label="客户物料名称"
- align="center"
- prop="customerLogisticName"
- width="150px"
- />
- </el-table>
- </el-tab-pane>
- <el-tab-pane label="价格费用">
- <el-table
- :data="priceList"
- fit
- border
- max-height="280"
- style="font-size: 12px"
- >
- <el-table-column
- show-overflow-tooltip
- label="行号"
- align="center"
- prop="rowno"
- />
- <el-table-column
- show-overflow-tooltip
- label="调拨出库单号"
- align="center"
- prop="deliveryCode"
- width="150px"
- />
- <el-table-column
- show-overflow-tooltip
- label="调拨入库单号"
- align="center"
- prop="storageCode"
- width="150px"
- />
- <el-table-column
- show-overflow-tooltip
- label="生产厂家/代理人"
- align="center"
- prop="manufacturer"
- width="150px"
- />
- <el-table-column
- show-overflow-tooltip
- label="产地"
- align="center"
- prop="originPlace"
- width="150px"
- />
- <el-table-column
- show-overflow-tooltip
- label="类别"
- align="center"
- prop="classify"
- width="150px"
- />
- <!-- <el-table-column show-overflow-tooltip label="税率" align="center" prop="code"/> -->
- <!-- <el-table-column show-overflow-tooltip label="无税单价" align="center" prop="code"/> -->
- <!-- <el-table-column show-overflow-tooltip label="含税单价" align="center" prop="code"/> -->
- <el-table-column
- show-overflow-tooltip
- label="产品批号"
- align="center"
- prop="productBatch"
- width="150px"
- />
- <el-table-column
- show-overflow-tooltip
- label="生产日期"
- align="center"
- prop="manufactureDate"
- width="150px"
- />
- <el-table-column
- show-overflow-tooltip
- label="有效期至/失效日期"
- align="center"
- prop="periodEndDate"
- width="150px"
- />
- <el-table-column
- show-overflow-tooltip
- label="批准文号"
- align="center"
- prop="ratifyCode"
- width="150px"
- />
- <el-table-column
- show-overflow-tooltip
- label="注册证号"
- align="center"
- prop="registration"
- width="150px"
- />
- <el-table-column
- show-overflow-tooltip
- label="商品名"
- align="center"
- prop="productCode"
- width="150px"
- />
- <el-table-column
- show-overflow-tooltip
- label="通用名"
- align="center"
- prop="commonCode"
- width="150px"
- />
- <el-table-column
- show-overflow-tooltip
- label="剂型"
- align="center"
- prop="drug"
- width="150px"
- />
- <!-- <el-table-column show-overflow-tooltip label="询价无税价" align="center" prop="code"/> -->
- <!-- <el-table-column show-overflow-tooltip label="询价含税价" align="center" prop="code"/> -->
- <!-- <el-table-column show-overflow-tooltip label="税额" align="center" prop="code"/> -->
- <!-- <el-table-column show-overflow-tooltip label="加价率" align="center" prop="code"/> -->
- <!-- <el-table-column show-overflow-tooltip label="无税金额" align="center" prop="code"/> -->
- <!-- <el-table-column show-overflow-tooltip label="价税合计" align="center" prop="code"/> -->
- <el-table-column
- show-overflow-tooltip
- label="客户物料码"
- align="center"
- prop="customerLogistic"
- width="150px"
- />
- <el-table-column
- show-overflow-tooltip
- label="客户物料名称"
- align="center"
- prop="customerLogisticName"
- width="150px"
- />
- </el-table>
- </el-tab-pane>
- <el-tab-pane label="执行结果">
- <el-table
- :data="resultList"
- fit
- border
- max-height="280"
- style="font-size: 12px"
- >
- <el-table-column
- show-overflow-tooltip
- label="行号"
- align="center"
- prop="rowno"
- />
- <el-table-column
- show-overflow-tooltip
- label="调拨出库单号"
- align="center"
- prop="deliveryCode"
- width="150px"
- />
- <el-table-column
- show-overflow-tooltip
- label="调拨入库单号"
- align="center"
- prop="storageCode"
- width="150px"
- />
- <el-table-column
- show-overflow-tooltip
- label="生产厂家/代理人"
- align="center"
- prop="manufacturer"
- width="150px"
- />
- <el-table-column
- show-overflow-tooltip
- label="产地"
- align="center"
- prop="originPlace"
- width="150px"
- />
- <el-table-column
- show-overflow-tooltip
- label="类别"
- align="center"
- prop="classify"
- width="150px"
- />
- <el-table-column
- show-overflow-tooltip
- label="产品批号"
- align="center"
- prop="productBatch"
- width="150px"
- />
- <el-table-column
- show-overflow-tooltip
- label="生产日期"
- align="center"
- prop="manufactureDate"
- width="150px"
- />
- <el-table-column
- show-overflow-tooltip
- label="有效期至/失效日期"
- align="center"
- prop="periodEndDate"
- width="150px"
- />
- <el-table-column
- show-overflow-tooltip
- label="批准文号"
- align="center"
- prop="ratifyCode"
- width="150px"
- />
- <el-table-column
- show-overflow-tooltip
- label="注册证号"
- align="center"
- prop="registration"
- width="150px"
- />
- <el-table-column
- show-overflow-tooltip
- label="商品名"
- align="center"
- prop="productCode"
- width="150px"
- />
- <el-table-column
- show-overflow-tooltip
- label="通用名"
- align="center"
- prop="commonCode"
- width="150px"
- />
- <el-table-column
- show-overflow-tooltip
- label="剂型"
- align="center"
- prop="drug"
- width="150px"
- />
- <!-- <el-table-column show-overflow-tooltip label="已调出主数量" align="center" prop="code"/>
- <el-table-column show-overflow-tooltip label="已调入主数量" align="center" prop="code"/> -->
- <!-- <el-table-column show-overflow-tooltip label="调拨在途主数量" align="center" prop="code"/> -->
- <!-- <el-table-column show-overflow-tooltip label="已发货主数量" align="center" prop="code"/> -->
- <!-- <el-table-column show-overflow-tooltip label="途损主数量" align="center" prop="code"/> -->
- <!-- <el-table-column show-overflow-tooltip label="累计退货主数量" align="center" prop="code"/> -->
- <!-- <el-table-column show-overflow-tooltip label="调出与调入已结算主数量" align="center" prop="code"/> -->
- <!-- <el-table-column show-overflow-tooltip label="调出与调入已结算金额" align="center" prop="code"/> -->
- <el-table-column
- show-overflow-tooltip
- label="客户物料码"
- align="center"
- prop="customerLogistic"
- width="150px"
- />
- <el-table-column
- show-overflow-tooltip
- label="客户物料名称"
- align="center"
- prop="customerLogisticName"
- width="150px"
- />
- </el-table>
- </el-tab-pane>
- </el-tabs>
- <el-button type="primary" style='position: absolute;right:10px;top:5px;' size="mini" v-if="!sonDisable" @click="addLine">增行</el-button>
- </div>
- <el-divider content-position="left">表尾信息</el-divider>
- <el-row :gutter="10">
- <el-col :span="1.5">
- <el-form-item label="制单人">
- <el-input
- v-model="basicForm.createByName"
- size="mini"
- disabled
- clearable
- style="width: 200px"
- />
- </el-form-item>
- </el-col>
- <el-col :span="1.5">
- <el-form-item label="制单日期">
- <el-input
- v-model="basicForm.createTime"
- size="mini"
- disabled
- clearable
- style="width: 200px"
- />
- </el-form-item>
- </el-col>
- <!-- <el-col :span="1.5">
- <el-form-item label="审批人">
- <el-input
- v-model="basicForm.code"
- size="mini"
- disabled
- clearable
- style="width: 200px"
- />
- </el-form-item>
- </el-col>
- <el-col :span="1.5">
- <el-form-item label="审批日期">
- <el-input
- v-model="basicForm.code"
- size="mini"
- disabled
- clearable
- style="width: 200px"
- />
- </el-form-item>
- </el-col> -->
- </el-row>
- <el-divider content-position="left">审计信息</el-divider>
- <el-row :gutter="10">
- <el-col :span="1.5">
- <el-form-item label="创建人">
- <el-input
- v-model="basicForm.createByName"
- size="mini"
- disabled
- clearable
- style="width: 200px"
- />
- </el-form-item>
- </el-col>
- <el-col :span="1.5">
- <el-form-item label="创建时间">
- <el-input
- v-model="basicForm.createTime"
- size="mini"
- disabled
- clearable
- style="width: 200px"
- />
- </el-form-item>
- </el-col>
- <el-col :span="1.5">
- <el-form-item label="最后修改人">
- <el-input
- v-model="basicForm.updateByName"
- size="mini"
- disabled
- clearable
- style="width: 200px"
- />
- </el-form-item>
- </el-col>
- <el-col :span="1.5">
- <el-form-item label="最后修改时间">
- <el-input
- v-model="basicForm.updateTime"
- size="mini"
- disabled
- clearable
- style="width: 200px"
- />
- </el-form-item>
- </el-col>
- </el-row>
- </el-form>
- <div class="btn_group">
- <el-button
- type="primary"
- size="mini"
- plain
- @click="jumpOA"
- v-if="
- sonPageStu == 'check' &&
- (row.status == '1' || row.status == '2') &&
- row.oaId
- "
- >流程跳转</el-button
- >
- <el-button
- type="primary"
- size="mini"
- plain
- @click="copy"
- v-if="sonPageStu == 'check'"
- >复制</el-button
- >
- <el-button
- type="primary"
- size="mini"
- plain
- @click="editPage"
- v-if="sonPageStu == 'check' && row.status == '0'"
- >编辑</el-button
- >
- <el-button
- type="danger"
- size="mini"
- plain
- @click="toNC"
- v-if="sonPageStu == 'check' && row.status == '2'"
- >重传NC</el-button
- >
- <el-button
- type="primary"
- size="mini"
- plain
- @click="save"
- v-if="sonPageStu == 'add' || sonPageStu == 'edit'"
- >保存</el-button
- >
- <el-button
- type="primary"
- size="mini"
- plain
- @click="submit"
- v-if="
- sonPageStu == 'check' && (row.status == '0' || row.status == '3')
- "
- >提交</el-button
- >
- <el-button size="mini" plain @click="back">返回</el-button>
- </div>
- </el-card>
- <Refers ref="refer" @doSubmit="selectionsToInput" :single="true" />
- <TreeRefers ref="tree" @doSubmit="selectionsToInput2" :single="true" />
- <popDialog ref="materialRefer" @doSubmit="selectMaterial" :single="true" />
- <batchRefers ref="batchRefer" @doSubmit="selectBatch" :single="true" />
- </div>
- </template>
- <script>
- import { toOA } from "@/api/purchase/purchaseDemand.js";
- import {
- addOrder,
- getOrderDetail,
- editOrder,
- submitOrder,
- againToNC,
- } from "@/api/purchase/transferOrder.js";
- import Refers from "@/components/Refers/refers.vue";
- // 用于回显参照框数据
- import { getRefer } from "@/api/purchase/basic.js";
- import TreeRefers from "@/components/Refers/treeRefer.vue";
- // 明细行选择物料参照
- import popDialog from "@/components/PopDialog/index.vue";
- // 明细行选择批次号
- import batchRefers from "@/components/Refers/batchRefer.vue";
- export default {
- name: "addOder",
- dicts: [
- "sys_allot_billtype",
- "sys_project_group",
- "sys_status",
- "sys_to_type",
- ],
- props: ["pageStu", "row", "disable"],
- components: {
- Refers,
- TreeRefers,
- popDialog,
- batchRefers,
- },
- model: {
- prop: "isList",
- event: "jugislist",
- },
- data() {
- return {
- loading: true,
- // 不能直接改变props传来的值
- sonPageStu: this.pageStu,
- sonDisable: this.disable,
- basicForm: {
- deliveryInventoryOrg: "",
- deliveryInventoryOrgCode: "",
- deliveryInventoryOrgName: "",
- billType: "",
- code: "",
- billDate: "",
- allotType: "",
- deliveryCode: "",
- storageCode: "",
- storageInventoryOrg: "",
- storageInventory: "",
- storageInventoryOrgName: "",
- businessPersonal: "",
- businessPersonalName: "",
- deliveryDept: "",
- deliveryDeptName: "",
- currency: "",
- currencyName: "",
- rate: 1,
- onRouteAffilliation: "",
- oaId: '',
- qty: "",
- accountPath: "",
- customer: "",
- customerName: "",
- deliveryWarehouse: "",
- deliveryWarehouseCode: "",
- deliveryWarehouseName: "",
- storageWarehouse: "",
- storageWarehouseName: "",
- materialProject: "",
- liacenter: "",
- liacenterName: "",
- sourceIdentification: "",
- remark: "",
- ncCode: "",
- isSendWms: "",
- status: "0",
- tenantId: "",
- revision: "",
- createByName: "",
- updateByName: "",
- delFlag: "",
- materialInfo: [],
- },
- referCondition: {
- type: "",
- isPage: true,
- title: "",
- // 仓库编码
- stordocId: "",
- orgCode: "",
- materialCode: "",
- unitCode: "",
- warehouseCode: "",
- },
- options: [
- {
- value: "Y",
- label: "是",
- },
- {
- value: "N",
- label: "否",
- },
- ],
- tableIndex: null,
- chuOrgOptions: [],
- ruOrgOptions: [],
- manOptions: [],
- deptOptions: [],
- currencyOptions: [],
- customerOptions: [],
- ruHouseOptions: [],
- chuHouseOptions: [],
- liacenterOptions: [],
- basicRules: {
- billType: [
- { required: true, message: "订单类型不能为空", trigger: "blur" },
- ],
- deliveryWarehouse: [
- { required: true, message: "调出仓库不能为空", trigger: "blur" },
- ],
- storageWarehouse:[
- { required: true, message: "调入仓库不能为空", trigger: "blur" },
- ],
- deliveryInventoryOrg:[
- { required: true, message: "调出库存组织不能为空", trigger: "blur" },
- ],
- storageInventoryOrg:[
- { required: true, message: "调入库存组织不能为空", trigger: "blur" },
- ],
- deliveryDept:[
- { required: true, message: "调出部门不能为空", trigger: "blur" },
- ],
- },
- // materialInfo: [],
- receiveInfo: [],
- priceList: [],
- resultList: [],
- pickerOptionsEnd: {
- disabledDate: (time) => {
- let beginDateVal = this.basicForm.billDate;
- if (beginDateVal) {
- return time.getTime() < new Date(beginDateVal).getTime() - 8.64e7;
- }
- },
- },
- isOrg: true,
- isDRCk: true,
- isDCCk: true,
- };
- },
- created() {
- if (this.pageStu == "check") {
- console.log("数据", this.row);
- this.getDetails(this.row);
- } else if (this.pageStu == "edit") {
- this.getDetails(this.row);
- this.isDRCk = false;
- this.isDCCk = false;
- } else if (this.pageStu == "add") {
- this.basicForm.rate = 1;
- this.basicForm.billDate = new Date();
- this.loading = false
- }
- },
- methods: {
- // 控制先选调出库存组织和调入库存组织再选调出部门和调入调出仓库
- controlCk(val) {
- if (val = '调出库存组织') {console.log("进了吗");}
- if (
- this.basicForm.deliveryInventoryOrg &&
- this.basicForm.storageInventoryOrg
- ) {
- this.isOrg = false;
- } else {
- this.basicForm.deliveryDept = "";
- this.basicForm.storageWarehouse = "";
- this.basicForm.deliveryWarehouse = "";
- this.isOrg = true;
- // 选择调入库存组织时判断调拨方式
- this.basicForm.allotType = "";
- }
- },
- // 控制子表内货位是否可以填写,根据选择仓库内csFlag
- controlDCHW() {
- console.log("🚀 ~ file: add.vue:735 调出货位");
- this.isDCCk = true;
- this.basicForm.materialInfo.forEach((item) => {
- item.deliveryAllocation = null;
- item.deliveryAllocationName = null;
- });
- },
- controlDRHW() {
- console.log("🚀 ~ file: add.vue:735 调入货位");
- this.isDRCk = true;
- this.basicForm.materialInfo.forEach((item) => {
- item.storageAllocation = null;
- item.storageAllocationName = null;
- });
- },
- // 输入数量或者主数量同步改变,计算基本信息总数量
- getZSL(scope) {
- scope.row.qty = scope.row.mainQty;
- let sum = 0
- this.basicForm.materialInfo.forEach(item => {
- sum += Number(item.qty)
- this.basicForm.qty = sum
- })
- },
- getSL(scope) {
- scope.row.mainQty = scope.row.qty;
- let sum = 0
- this.basicForm.materialInfo.forEach(item => {
- sum += Number(item.qty)
- this.basicForm.qty = sum
- })
- },
- copy() {
- // await this.getDetails(this.row)
- this.$modal.notifySuccess("复制成功");
- this.sonPageStu = "add";
- this.sonDisable = false;
- this.basicForm.id = "";
- this.basicForm.code = "";
- this.basicForm.status = "0";
- this.basicForm.createByName = "";
- this.basicForm.createBy = "";
- this.basicForm.createTime = "";
- this.basicForm.isSendWms = "";
- this.basicForm.ncCode = "";
- this.basicForm.oaId = "";
- this.basicForm.updateBy = "";
- this.basicForm.updateByName = "";
- this.basicForm.updateTime = "";
- this.basicForm.storageCode = "";
- this.basicForm.deliveryCode = "";
- this.basicForm.billDate = new Date();
- // 复制新增把id,编码,创建人置为空,子表去掉id
- if (this.basicForm.materialInfo.length !== 0) {
- this.basicForm.materialInfo.forEach((item) => {
- if (item.allotDate) {
- item.allotDate = new Date();
- }
- if (item.deliveryCode) {
- item.deliveryCode = "";
- }
- if (item.storageCode) {
- item.storageCode = "";
- }
- if (item.demandCode) {
- item.demandCode = "";
- }
- if (item.allotId) {
- delete item.allotId;
- }
- if (item.id) {
- delete item.id;
- }
- if (item.createBy) {
- delete item.createBy;
- delete item.createByName;
- delete item.createTime;
- }
- if (item.updateBy) {
- delete item.updateBy;
- delete item.updateByName;
- delete item.updateTime;
- }
- });
- }
- this.isDRCk = false;
- this.isDCCk = false;
- },
- editPage() {
- this.sonPageStu = 'edit'
- this.sonDisable = false
- },
- toNC() {
- againToNC(this.row)
- .then((res) => {
- this.getDetails(this.row);
- })
- .catch((err) => {
- this.getDetails(this.row);
- });
- },
- submit() {
- this.$modal.loading("提交中...");
- this.basicForm.stAllotMaterialList = this.basicForm.materialInfo;
- this.basicForm.stAllotReceiveDeliverList = this.receiveInfo;
- this.basicForm.stAllotReceiveExecuteList = this.priceList;
- this.basicForm.stAllotReceiveExpenseList = this.resultList;
- submitOrder(this.basicForm)
- .then((res) => {
- if (res.code === 200) {
- this.$modal.closeLoading();
- this.$modal.notifySuccess("提交成功");
- this.back();
- }
- })
- .catch((err) => {
- this.$modal.closeLoading();
- });
- },
- save() {
- this.$refs["basic"].validate(async (valid, obj) => {
- if (valid) {
- if (this.basicForm.materialInfo.length !== 0) {
- if (this.sonPageStu == "add") {
- this.basicForm.stAllotMaterialList = this.basicForm.materialInfo;
- this.basicForm.stAllotReceiveDeliverList = this.receiveInfo;
- this.basicForm.stAllotReceiveExecuteList = this.priceList;
- this.basicForm.stAllotReceiveExpenseList = this.resultList;
- this.$modal.loading("保存中...");
- addOrder(this.basicForm)
- .then((res) => {
- if (res.code === 200) {
- this.$modal.notifySuccess("保存成功");
- this.$modal.closeLoading();
- this.back();
- }
- })
- .catch((err) => {
- this.$modal.closeLoading();
- });
- } else if (this.sonPageStu == "edit") {
- this.basicForm.stAllotMaterialList = this.basicForm.materialInfo;
- this.basicForm.stAllotReceiveDeliverList = this.receiveInfo;
- this.basicForm.stAllotReceiveExecuteList = this.priceList;
- this.basicForm.stAllotReceiveExpenseList = this.resultList;
- this.$modal.loading("保存中...");
- editOrder(this.basicForm)
- .then((res) => {
- if (res.code === 200) {
- this.$modal.notifySuccess("编辑成功");
- this.$modal.closeLoading();
- this.back();
- }
- })
- .catch((err) => {
- this.$modal.closeLoading();
- });
- }
- } else {
- this.$modal.notifyWarning("明细行不能为空");
- }
- } else {
- console.log("obj",obj);
- const jiaoyan = []
- for(let key in obj) {
- jiaoyan.push(obj[key][0].message);
- }
- this.$modal.notifyWarning(jiaoyan + "!");
- return false;
- }
- });
-
- },
- back() {
- this.$emit("jugislist", true);
- // let queryParams = {
- // pageNum: 1,
- // pageSize: 5
- // }
- this.$emit("refresh");
- },
- // 如果需要回显则调用详情接口
- getDetails(row) {
- getOrderDetail(row.id).then((res) => {
- if (res.code === 200) {
- this.basicForm = res.data;
- this.basicForm.materialInfo = res.data.stAllotMaterialList;
- this.receiveInfo = res.data.stAllotReceiveDeliverList;
- this.priceList = res.data.stAllotReceiveExecuteList;
- this.resultList = res.data.stAllotReceiveExpenseList;
- if (this.basicForm.deliveryInventoryOrg) {
- this.reBackRefer(
- "ORG_PARAM",
- this.basicForm.deliveryInventoryOrg,
- "调出库存组织"
- );
- }
- if (this.basicForm.storageInventoryOrg) {
- this.reBackRefer(
- "ORG_PARAM",
- this.basicForm.storageInventoryOrg,
- "调入库存组织"
- );
- }
- if (this.basicForm.businessPersonal) {
- this.reBackRefer("CONTACTS_PARAM", this.basicForm.businessPersonal);
- }
- if (this.basicForm.deliveryDept) {
- this.reBackRefer("DEPT_PARAM", this.basicForm.deliveryDept);
- }
- if (this.basicForm.currency) {
- this.reBackRefer("CURRENCY_PARAM", this.basicForm.currency);
- }
- // 客户
- if (this.basicForm.customer) {
- this.reBackRefer("CUSTOMER_PARAM", this.basicForm.customer);
- }
- if (this.basicForm.storageWarehouse) {
- this.reBackRefer(
- "WAREHOUSE_PARAM",
- this.basicForm.storageWarehouse,
- "调入仓库"
- );
- }
- if (this.basicForm.deliveryWarehouse) {
- this.reBackRefer(
- "WAREHOUSE_PARAM",
- this.basicForm.deliveryWarehouse,
- "调出仓库"
- );
- }
- if (this.basicForm.liacenter) {
- this.reBackRefer("LIACENTER_PARAM", this.basicForm.liacenter);
- }
- // 控制先选调出库存组织和调入库存组织再选调出部门和调入调出仓库
- this.controlCk();
- }
- }).then(() => {
- this.loading = false
- }).catch(err => {
- this.loading = false
- })
- },
- // 回显参照框
- reBackRefer(type, id, title) {
- getRefer({ type: type, id: id, title: title }).then((res) => {
- if (type == "ORG_PARAM" && title == "调出库存组织") {
- this.chuOrgOptions = res.rows;
- }
- if (type == "ORG_PARAM" && title == "调入库存组织") {
- this.ruOrgOptions = res.rows;
- }
- if (type == "CONTACTS_PARAM") {
- this.manOptions = res.rows;
- }
- if (type == "DEPT_PARAM") {
- this.deptOptions = res.rows;
- }
- if (type == "CURRENCY_PARAM") {
- this.currencyOptions = res.rows;
- }
- if (type == "LIACENTER_PARAM") {
- this.liacenterOptions = res.rows;
- }
- if (type == "CUSTOMER_PARAM") {
- this.customerOptions = res.rows;
- }
- if (type == "WAREHOUSE_PARAM" && title == "调入仓库") {
- this.ruHouseOptions = res.rows;
- }
- if (type == "WAREHOUSE_PARAM" && title == "调出仓库") {
- this.chuHouseOptions = res.rows;
- }
- if (type == "UNIT_PARAM") {
- this.basicForm.materialInfo[this.tableIndex].unitCode = res.rows[0].code;
- }
- });
- },
- addLine() {
- const newLine = {
- rowno: null,
- demandCode: null,
- material: null,
- materialCode: null,
- materialName: null,
- deliveryCode: null,
- storageCode: null,
- specification: null,
- manufacturer: null,
- originPlace: null,
- originPlaceName: null,
- model: null,
- unit: null,
- unitCode: null,
- unitName: null,
- deliveryWarehouseName: null,
- qty: null,
- mainUnit: null,
- mainUnitName: null,
- equation: "1/1",
- mainQty: null,
- rate: "0.00",
- storageWarehouseName: null,
- deliveryAllocationName: null,
- deliveryAllocation: null,
- storageDept: null,
- storageDeptName: null,
- storageAllocationName: null,
- storageAllocation: null,
- patchNo: null,
- producBatch: null,
- manufactureDate: null,
- periodEndDate: null,
- allotDate: new Date(),
- ratifyCode: null,
- registration: null,
- productCode: null,
- commonCode: null,
- drug: null,
- ruleDetail: null,
- marketingApprovalPersonal: null,
- production: null,
- pi: null,
- classify: null,
- customerLogistic: null,
- customerLogisticName: null,
- delFlag: 0,
- };
- this.basicForm.materialInfo.push(newLine);
- },
- delLine(index,row) {
- // this.basicForm.materialInfo = this.basicForm.materialInfo.map((item, index) => ({
- // ...item,
- // delFlag: index === $index ? "2" : item.delFlag,
- // }));
- if (row.id) {
- this.basicForm.materialInfo.forEach(e => {
- if(e.id == row.id){
- e.delFlag = '2'
- }
- });
- }else{
- this.basicForm.materialInfo.splice(index, 1);
- }
- },
- //
- rowClassName(prop) {
- const {
- row: { delFlag },
- } = prop;
- if (delFlag === "2") {
- return "is-hidden";
- } else {
- return "";
- }
- },
- chooseRefer(type, isPage, title, pkOrg, isDirectStore, gubFlag,parame) {
- this.referCondition.type = type;
- this.referCondition.isPage = isPage;
- this.referCondition.title = title;
- this.referCondition.pkOrg = pkOrg;
- this.referCondition.isDirectStore = isDirectStore;
- this.referCondition.gubFlag = gubFlag;
- this.referCondition.parame = parame;
- this.$refs.refer.init(this.referCondition);
- },
- selectionsToInput(selection) {
- if (this.referCondition.title == "调出库存组织") {
- this.chuOrgOptions = selection;
- this.basicForm.deliveryInventoryOrg = selection[0].id;
- this.basicForm.deliveryInventoryOrgCode = selection[0].code;
- this.basicForm.deliveryInventoryOrgName = selection[0].name;
- this.clearDCZZ()
- }
- if (this.referCondition.title == "调入库存组织") {
- this.ruOrgOptions = selection;
- this.basicForm.storageInventoryOrg = selection[0].id;
- this.basicForm.storageInventory = selection[0].code;
- this.basicForm.storageInventoryOrgName = selection[0].name;
- this.basicForm.onRouteAffilliation = selection[0].name;
- this.clearDRZZ()
- }
- if (this.referCondition.title == "调出业务员") {
- this.manOptions = selection;
- this.basicForm.businessPersonal = selection[0].code;
- this.basicForm.businessPersonalName = selection[0].name;
- }
- if (this.referCondition.title == "调出部门") {
- this.deptOptions = selection;
- this.basicForm.deliveryDept = selection[0].id;
- this.basicForm.deliveryDeptName = selection[0].name;
- }
- if (this.referCondition.title == "币种") {
- this.currencyOptions = selection;
- this.basicForm.currency = selection[0].id;
- this.basicForm.currencyName = selection[0].name;
- }
- if (this.referCondition.title == "客户") {
- this.customerOptions = selection;
- this.basicForm.customer = selection[0].id;
- this.basicForm.customerName = selection[0].name;
- }
- if (this.referCondition.title == "调入仓库") {
- this.ruHouseOptions = selection;
- this.basicForm.storageWarehouse = selection[0].id;
- this.basicForm.storageWarehouseName = selection[0].name;
- console.log("1111", selection[0].csFlag);
- // 清空调入货位
- this.basicForm.materialInfo.forEach((item) => {
- item.storageAllocation = null;
- item.storageAllocationName = null;
- });
- if (selection[0].csFlag == "N") {
- this.isDRCk = true;
- } else {
- this.isDRCk = false;
- }
- }
- if (this.referCondition.title == "调出仓库") {
- this.chuHouseOptions = selection;
- this.basicForm.deliveryWarehouse = selection[0].id;
- this.basicForm.deliveryWarehouseCode = selection[0].code;
- this.basicForm.deliveryWarehouseName = selection[0].name;
- console.log("2222", selection[0].csFlag);
- // 清空调出货位
- this.basicForm.materialInfo.forEach((item) => {
- item.deliveryAllocation = null;
- item.deliveryAllocationName = null;
- });
- if (selection[0].csFlag == "N") {
- this.isDCCk = true;
- } else {
- this.isDCCk = false;
- }
- }
- if (this.referCondition.title == "调出货位") {
- this.basicForm.materialInfo[this.tableIndex].deliveryAllocationName =
- selection[0].name;
- this.basicForm.materialInfo[this.tableIndex].deliveryAllocation = selection[0].id;
- }
- if (this.referCondition.title == "调入货位") {
- this.basicForm.materialInfo[this.tableIndex].storageAllocationName =
- selection[0].name;
- this.basicForm.materialInfo[this.tableIndex].storageAllocation = selection[0].id;
- }
- if (this.referCondition.title == "调入部门") {
- this.basicForm.materialInfo[this.tableIndex].storageDeptName = selection[0].name;
- this.basicForm.materialInfo[this.tableIndex].storageDept = selection[0].id;
- }
- // 控制先选调出库存组织和调入库存组织再选调出部门和调入调出仓库
- this.controlCk();
- },
- // 必选标识
- addRedStar(h, { column }) {
- return [
- h('span', { style: 'color: #F56C6C' }, '*'),
- h('span', ' ' + column.label)
- ];
- },
- // 调出库存组织清空相关数据
- clearDCZZ() {
- // 清空调出仓库,部门
- this.basicForm.deliveryWarehouse = "";
- this.basicForm.deliveryWarehouseCode = "";
- this.basicForm.deliveryWarehouseName = "";
- this.basicForm.deliveryDept = "";
- this.basicForm.deliveryDeptName = "";
- // 清空调出货位且禁用
- this.basicForm.materialInfo.forEach((item) => {
- item.deliveryAllocation = null;
- item.deliveryAllocationName = null;
- });
- this.isDCCk = true;
- // 选择调入库存组织时判断调拨方式
- if (
- this.basicForm.storageInventoryOrg ==
- this.basicForm.deliveryInventoryOrg
- ) {
- this.basicForm.allotType = "4";
- } else {
- this.basicForm.allotType = "2";
- }
- },
- // 调入库存组织清空相关数据
- clearDRZZ() {
- // 选择调入库存组织清空仓库
- this.basicForm.storageWarehouse = "";
- this.basicForm.storageWarehouseName = "";
- // 清空调入部门
- this.basicForm.materialInfo.forEach((item) => {
- item.storageDept = null;
- item.storageDeptName = null;
- });
- // 清空调入货位且禁用
- this.basicForm.materialInfo.forEach((item) => {
- item.storageAllocation = null;
- item.storageAllocationName = null;
- });
- this.isDRCk = true
- // 选择调入库存组织时判断调拨方式
- if (
- this.basicForm.storageInventoryOrg ==
- this.basicForm.deliveryInventoryOrg
- ) {
- this.basicForm.allotType = "4";
- } else {
- this.basicForm.allotType = "2";
- }
- },
- chooseTreeRefer(type, isPage, title) {
- this.referCondition.type = type;
- this.referCondition.isPage = isPage;
- this.referCondition.title = title;
- this.$refs.tree.init(this.referCondition);
- },
- selectionsToInput2(selection) {
- this.liacenterOptions.push(selection);
- this.basicForm.liacenter = selection.id;
- this.basicForm.liacenterName = selection.name;
- },
- // 明细行选择物料编码带出数据
- chooseMaterial(index) {
- console.log("🚀 ~ file: add.vue:790 ~ chooseMaterial ~ index:", index);
- this.tableIndex = index;
- this.$refs.materialRefer.init();
- },
- // 明细行数量失去焦点
- changeQty(aa,bb){
- console.log('aa',aa);
- console.log('bb',bb);
- },
- selectMaterial(selection) {
- console.log("选中的物料", selection);
- // 先清空通用名,调入调出结算规则明细
- this.basicForm.materialInfo[this.tableIndex].ruleDetail = ''
- this.basicForm.materialInfo[this.tableIndex].commonCode = ''
- this.basicForm.materialInfo[this.tableIndex].material = selection[0].id;
- this.basicForm.materialInfo[this.tableIndex].materialCode = selection[0].code;
- this.basicForm.materialInfo[this.tableIndex].materialName = selection[0].name;
- this.basicForm.materialInfo[this.tableIndex].specification = selection[0].specification;
- this.basicForm.materialInfo[this.tableIndex].model = selection[0].model;
- this.basicForm.materialInfo[this.tableIndex].originPlace = selection[0].originPlace;
- this.basicForm.materialInfo[this.tableIndex].originPlaceName = selection[0].originPlaceName;
- this.basicForm.materialInfo[this.tableIndex].unit = selection[0].unitId;
- this.basicForm.materialInfo[this.tableIndex].mainUnit = selection[0].unitId;
- this.basicForm.materialInfo[this.tableIndex].unitName = selection[0].unitIdName;
- this.basicForm.materialInfo[this.tableIndex].mainUnitName = selection[0].unitIdName;
- this.basicForm.materialInfo[this.tableIndex].manufacturer = selection[0].manufacturerIdName;
- this.basicForm.materialInfo[this.tableIndex].marketingApprovalPersonal = selection[0].registrant;
- this.basicForm.materialInfo[this.tableIndex].production = selection[0].productionPermit;
- // 根据物料单位id查询单位code
- this.reBackRefer("UNIT_PARAM", selection[0].unitId);
- },
- // 明细行选择批次号
- chooseBatch(index) {
- this.tableIndex = index;
- this.referCondition.orgId = this.basicForm.deliveryInventoryOrg;
- this.referCondition.materialCode =
- this.basicForm.materialInfo[this.tableIndex].materialCode;
- this.referCondition.unitId = this.basicForm.materialInfo[this.tableIndex].unit;
- this.referCondition.warehouseId = this.basicForm.deliveryWarehouse;
- this.$refs.batchRefer.init(this.referCondition);
- },
- selectBatch(selection) {
- console.log("选中的批次号", selection);
- },
- // 明细行选择货位
- chooseMxHW(index, type, isPage, title, stordocId) {
- this.tableIndex = index;
- this.referCondition.type = type;
- this.referCondition.isPage = isPage;
- this.referCondition.title = title;
- this.referCondition.pkOrg = "";
- this.referCondition.stordocId = stordocId;
- this.$refs.refer.init(this.referCondition);
- },
- // 明细行选择调入部门
- chooseMxBM(index, type, isPage, title,parame) {
- this.tableIndex = index;
- this.referCondition.type = type;
- this.referCondition.isPage = isPage;
- this.referCondition.title = title;
- this.referCondition.parame = parame;
- this.$refs.refer.init(this.referCondition);
- },
- // 选择框彻底清空
- clean(val) {
- if (val == "调出库存组织") {
- this.clearDCZZ()
- }
- if (val == "调入库存组织") {
- this.clearDRZZ()
- }
- if (val == "调出业务员") {
- this.basicForm.businessPersonal = "";
- this.basicForm.businessPersonalName = "";
- }
- if (val == "调入仓库") {
- this.basicForm.storageWarehouse = "";
- this.basicForm.storageWarehouseName = "";
- this.basicForm.materialInfo.forEach((item) => {
- item.storageAllocation = null;
- item.storageAllocationName = null;
- });
- this.isDRCk = true
- }
- if (val == "调出仓库") {
- this.basicForm.deliveryWarehouse = "";
- this.basicForm.deliveryWarehouseCode = "";
- this.basicForm.deliveryWarehouseName = "";
- }
- if (val == "利润中心") {
- this.basicForm.liacenter = "";
- this.basicForm.liacenterName = "";
- }
- },
- // 明细选择框清空
- cleanMx(index, val) {
- if (val == "物料编码") {
- this.basicForm.materialInfo[index].material = "";
- this.basicForm.materialInfo[index].materialCode = "";
- this.basicForm.materialInfo[index].materialName = "";
- this.basicForm.materialInfo[index].specification = "";
- this.basicForm.materialInfo[index].model = "";
- this.basicForm.materialInfo[index].originPlace = "";
- this.basicForm.materialInfo[index].originPlaceName = "";
- this.basicForm.materialInfo[index].unit = "";
- this.basicForm.materialInfo[index].mainUnit = "";
- this.basicForm.materialInfo[index].unitName = "";
- this.basicForm.materialInfo[index].mainUnitName = "";
- this.basicForm.materialInfo[index].manufacturer = "";
- this.basicForm.materialInfo[index].ruleDetail = ''
- this.basicForm.materialInfo[index].commonCode = ''
- this.basicForm.materialInfo[index].marketingApprovalPersonal = "";
- this.basicForm.materialInfo[index].production = "";
- this.basicForm.materialInfo[index].unitCode = "";
- }
- if (val == "调出货位") {
- this.basicForm.materialInfo[index].deliveryAllocationName = "";
- this.basicForm.materialInfo[index].deliveryAllocation = "";
- }
- if (val == "调入部门") {
- this.basicForm.materialInfo[index].storageDeptName = "";
- this.basicForm.materialInfo[index].storageDept = "";
- }
- if (val == "调入货位") {
- this.basicForm.materialInfo[index].storageAllocationName = "";
- this.basicForm.materialInfo[index].storageAllocation = "";
- }
- },
- jumpOA() {
- toOA(this.$store.state.user.name, this.basicForm.oaId).then((res) => {
- if (res.code === 200) {
- window.open(res.oaUrl);
- }
- });
- },
- },
- };
- </script>
- <style lang="scss" scoped>
- ::v-deep .el-table__row.is-hidden {
- display: none;
- }
- .btn_group {
- // width: 100%;
- // margin: 20px 0;
- display: flex;
- // justify-content: center;
- position: absolute;
- top: 10px;
- right: 20px;
- }
- .btn_grooup {
- margin-bottom: 10px;
- display: flex;
- justify-content: flex-end;
- }
- .hang {
- margin: auto;
- }
- .hang ::v-deep .el-form-item__content {
- margin-left: 0px !important;
- }
- ::v-deep .el-table__row > td {
- border-right: none;
- }
- </style>
|