add.vue 80 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274
  1. <template>
  2. <div id="addOder">
  3. <el-card style="position: relative">
  4. <span>基本信息</span>
  5. <el-form :model="basicForm" :rules="basicRules" :show-message="false" ref="basic" label-width="auto">
  6. <el-row :gutter="10">
  7. <el-col :span="1.5">
  8. <el-form-item label="单据号">
  9. <el-input clearable disabled v-model="basicForm.code" size="mini" style="width: 200px"/>
  10. </el-form-item>
  11. </el-col>
  12. <el-col :span="1.5">
  13. <el-form-item label="单据日期">
  14. <el-date-picker clearable :disabled="sonDisable" v-model="basicForm.billDate" size="mini" type="date"
  15. value-format="yyyy-MM-dd"
  16. style="width: 200px"
  17. >
  18. </el-date-picker>
  19. </el-form-item>
  20. </el-col>
  21. <el-col :span="1.5">
  22. <el-form-item label="订单类型" prop="billType">
  23. <el-select clearable v-model="basicForm.billType" :disabled="sonDisable" size="mini" style="width: 200px">
  24. <el-option v-for="dict in dict.type.sys_allot_billtype" :key="dict.value" :label="dict.label" :value="dict.value">
  25. </el-option>
  26. </el-select>
  27. </el-form-item>
  28. </el-col>
  29. <el-col :span="1.5">
  30. <el-form-item label="调拨方式">
  31. <el-select clearable disabled v-model="basicForm.allotType" size="mini" style="width: 200px">
  32. <el-option v-for="dict in dict.type.sys_to_type" :key="dict.value" :label="dict.label" :value="dict.value">
  33. </el-option>
  34. </el-select>
  35. </el-form-item>
  36. </el-col>
  37. <el-col :span="1.5">
  38. <el-form-item label="单据状态">
  39. <el-select disabled v-model="basicForm.status"
  40. size="mini"
  41. style="width: 200px"
  42. >
  43. <el-option v-for="dict in dict.type.sys_status" :key="dict.value" :label="dict.label" :value="dict.value">
  44. </el-option>
  45. </el-select>
  46. </el-form-item>
  47. </el-col>
  48. <el-col :span="1.5">
  49. <el-form-item label="币种">
  50. <el-select clearable :disabled="sonDisable"
  51. size="mini"
  52. v-model="basicForm.currency"
  53. @focus="chooseRefer('CURRENCY_PARAM', true, '币种')"
  54. style="width: 200px"
  55. >
  56. <el-option v-for="item in currencyOptions" :key="item.id" :label="item.name" :value="item.id"/>
  57. </el-select>
  58. </el-form-item>
  59. </el-col>
  60. <el-col :span="1.5">
  61. <el-form-item label="总数量">
  62. <el-input disabled v-model="basicForm.qty" type="number" min="0" size="mini" style="width: 200px"/>
  63. </el-form-item>
  64. </el-col>
  65. <el-col :span="1.5">
  66. <el-form-item label="结算路径">
  67. <el-input clearable :disabled="sonDisable" v-model="basicForm.accountPath" size="mini" style="width: 200px"/>
  68. </el-form-item>
  69. </el-col>
  70. <el-col :span="1.5">
  71. <el-form-item label="折本汇率">
  72. <el-input-number
  73. v-model="basicForm.rate" size="mini" disabled :precision="2" :step="0.1" :max="10" style="width: 200px"></el-input-number>
  74. </el-form-item>
  75. </el-col>
  76. <el-col :span="1.5">
  77. <el-form-item label="客户">
  78. <DrPopoverSelectV2
  79. size="mini"
  80. v-model="basicForm.customerName"
  81. valueKey= "name"
  82. referName="CUSTOMER_PARAM"
  83. :dataMapping="{
  84. customer: 'id',
  85. customerName: 'name',
  86. }"
  87. :source.sync="basicForm"
  88. >
  89. </DrPopoverSelectV2>
  90. <!-- <el-select clearable :disabled="sonDisable"
  91. size="mini"
  92. v-model="basicForm.customer"
  93. @clear="clean('客户')"
  94. @focus="chooseRefer('CUSTOMER_PARAM', true, '客户')"
  95. style="width: 200px"
  96. >
  97. <el-option v-for="item in customerOptions" :key="item.id" :label="item.name" :value="item.id"/>
  98. </el-select> -->
  99. </el-form-item>
  100. </el-col>
  101. <el-col :span="1.5">
  102. <el-form-item label="物流项目组">
  103. <el-select clearable :disabled="sonDisable" v-model="basicForm.materialProject"
  104. size="mini"
  105. style="width: 200px"
  106. >
  107. <el-option v-for="dict in dict.type.sys_project_group" :key="dict.value" :label="dict.label" :value="dict.value">
  108. </el-option>
  109. </el-select>
  110. </el-form-item>
  111. </el-col>
  112. <el-col :span="1.5">
  113. <el-form-item label="利润中心">
  114. <el-select clearable :disabled="sonDisable"
  115. size="mini"
  116. v-model="basicForm.liacenter"
  117. @clear="clean('利润中心')"
  118. @focus="chooseTreeRefer('LIACENTER_PARAM', false, '利润中心')"
  119. style="width: 200px"
  120. >
  121. <el-option v-for="item in liacenterOptions" :key="item.id" :label="item.name" :value="item.id"/>
  122. </el-select>
  123. </el-form-item>
  124. </el-col>
  125. <el-col :span="1.5">
  126. <el-form-item label="在途归属">
  127. <el-input clearable disabled v-model="basicForm.onRouteAffilliation" size="mini" style="width: 200px"/>
  128. </el-form-item>
  129. </el-col>
  130. <el-col :span="1.5">
  131. <el-form-item label="备注">
  132. <el-input
  133. v-model="basicForm.remark"
  134. size="mini"
  135. :disabled="sonDisable"
  136. clearable
  137. style="width: 200px"
  138. />
  139. </el-form-item>
  140. </el-col>
  141. </el-row>
  142. <el-row :gutter="10">
  143. <el-col :span="1.5">
  144. <el-form-item label="调出库存组织" prop="deliveryInventoryOrg">
  145. <el-select clearable :disabled="sonDisable" size="mini" v-model="basicForm.deliveryInventoryOrg"
  146. @clear="clean('调出库存组织')"
  147. @change="controlCk('调出库存组织')"
  148. @focus="chooseRefer('ORG_PARAM', true, '调出库存组织')"
  149. style="width: 200px"
  150. >
  151. <el-option v-for="item in chuOrgOptions" :key="item.id" :label="item.name" :value="item.id"/>
  152. </el-select>
  153. </el-form-item>
  154. </el-col>
  155. <el-col :span="1.5">
  156. <el-form-item label="调出仓库" prop="deliveryWarehouse">
  157. <el-select clearable :disabled="sonDisable || isOrg"
  158. size="mini"
  159. v-model="basicForm.deliveryWarehouse"
  160. @clear="clean('调出仓库')"
  161. @change="controlDCHW"
  162. @focus="chooseRefer('WAREHOUSE_PARAM', true, '调出仓库', basicForm.deliveryInventoryOrg, 'N', 'N')"
  163. style="width: 200px"
  164. >
  165. <el-option v-for="item in chuHouseOptions" :key="item.id" :label="item.name" :value="item.id"/>
  166. </el-select>
  167. </el-form-item>
  168. </el-col>
  169. <el-col :span="1.5">
  170. <el-form-item label="调出部门" prop="deliveryDept">
  171. <el-select clearable :disabled="sonDisable || isOrg"
  172. size="mini"
  173. v-model="basicForm.deliveryDept"
  174. @focus="chooseRefer('DEPT_PARAM', true, '调出部门', '','','',{drpOrg:basicForm.deliveryInventoryOrg})"
  175. style="width: 200px"
  176. >
  177. <el-option v-for="item in deptOptions" :key="item.id" :label="item.name" :value="item.id"/>
  178. </el-select>
  179. </el-form-item>
  180. </el-col>
  181. <el-col :span="1.5">
  182. <el-form-item label="调出业务员">
  183. <el-select clearable :disabled="sonDisable"
  184. size="mini"
  185. v-model="basicForm.businessPersonal"
  186. @clear="clean('调出业务员')"
  187. @focus="chooseRefer('CONTACTS_PARAM', true, '调出业务员')"
  188. style="width: 200px"
  189. >
  190. <el-option v-for="item in manOptions" :key="item.id" :label="item.name" :value="item.code"/>
  191. </el-select>
  192. </el-form-item>
  193. </el-col>
  194. <el-col :span="1.5">
  195. <el-form-item label="调拨出库单号">
  196. <el-input
  197. v-model="basicForm.deliveryCode"
  198. size="mini"
  199. disabled
  200. style="width: 200px"
  201. />
  202. </el-form-item>
  203. </el-col>
  204. </el-row>
  205. <el-row :gutter="10">
  206. <el-col :span="1.5">
  207. <el-form-item label="调入库存组织" prop="storageInventoryOrg">
  208. <el-select clearable :disabled="sonDisable" size="mini" v-model="basicForm.storageInventoryOrg"
  209. @clear="clean('调入库存组织')"
  210. @change="controlCk('调入库存组织')"
  211. @focus="chooseRefer('ORG_PARAM', true, '调入库存组织')"
  212. style="width: 200px"
  213. >
  214. <el-option v-for="item in ruOrgOptions" :key="item.id" :label="item.name" :value="item.id"/>
  215. </el-select>
  216. </el-form-item>
  217. </el-col>
  218. <el-col :span="1.5">
  219. <el-form-item label="调入仓库" prop="storageWarehouse">
  220. <el-select clearable :disabled="sonDisable || isOrg"
  221. size="mini"
  222. v-model="basicForm.storageWarehouse"
  223. @clear="clean('调入仓库')"
  224. @change="controlDRHW"
  225. @focus="chooseRefer('WAREHOUSE_PARAM', true, '调入仓库', basicForm.storageInventoryOrg, 'N', 'N')"
  226. style="width: 200px"
  227. >
  228. <el-option v-for="item in ruHouseOptions" :key="item.id" :label="item.name" :value="item.id"/>
  229. </el-select>
  230. </el-form-item>
  231. </el-col>
  232. <el-col :span="1.5">
  233. <el-form-item label="调拨入库单号">
  234. <el-input
  235. v-model="basicForm.storageCode"
  236. size="mini"
  237. disabled
  238. style="width: 200px"
  239. />
  240. </el-form-item>
  241. </el-col>
  242. </el-row>
  243. <el-row>
  244. <el-col :span="1.5">
  245. <el-form-item label="NC单据号">
  246. <el-input
  247. v-model="basicForm.ncCode"
  248. size="mini"
  249. disabled
  250. style="width: 200px"
  251. />
  252. </el-form-item>
  253. </el-col>
  254. </el-row>
  255. <el-row>
  256. <el-col :span="20">
  257. <el-form-item label="同步NC结果">
  258. <el-input
  259. v-model="basicForm.isSendWms"
  260. type="textarea"
  261. :rows="3"
  262. size="mini"
  263. disabled
  264. clearable
  265. />
  266. </el-form-item>
  267. </el-col>
  268. </el-row>
  269. <div style='position: relative;'>
  270. <el-tabs style="margin-top: 10px" type="border-card">
  271. <el-tab-pane label="物料信息">
  272. <el-table
  273. v-loading="loading"
  274. :data="basicForm.materialInfo"
  275. fit
  276. border
  277. max-height="280"
  278. style="font-size: 12px"
  279. :row-class-name="rowClassName"
  280. >
  281. <el-table-column
  282. show-overflow-tooltip
  283. label="行号"
  284. align="center"
  285. prop="rowno"
  286. >
  287. <template slot-scope="scope">
  288. {{ scope.row.rowno = scope.$index + 1 + "0" }}
  289. </template>
  290. </el-table-column>
  291. <el-table-column
  292. show-overflow-tooltip
  293. label="采购需求单单号"
  294. align="center"
  295. prop="demandCode"
  296. width="150px"
  297. />
  298. <el-table-column
  299. show-overflow-tooltip
  300. label="物料编码"
  301. align="center"
  302. prop="materialCode"
  303. width="200px"
  304. :render-header="addRedStar"
  305. >
  306. <template slot-scope="scope">
  307. <el-form-item class="hang" :prop="'materialInfo.' + scope.$index + '.materialCode'" :show-message="false" :rules="{ required: true, message: '请选择物料', trigger: 'blur' }">
  308. <el-input
  309. clearable
  310. :disabled="sonDisable"
  311. size="mini"
  312. v-model="scope.row.materialCode"
  313. @clear="cleanMx(scope.$index, '物料编码')"
  314. @focus="chooseMaterial(scope.$index)"
  315. >
  316. <el-button
  317. size="mini"
  318. :disabled="sonDisable"
  319. slot="append"
  320. icon="el-icon-more"
  321. @click="chooseMaterial(scope.$index)"
  322. ></el-button>
  323. </el-input>
  324. </el-form-item>
  325. </template>
  326. </el-table-column>
  327. <el-table-column
  328. show-overflow-tooltip
  329. label="物料名称"
  330. align="center"
  331. prop="materialName"
  332. width="180px"
  333. />
  334. <el-table-column
  335. show-overflow-tooltip
  336. label="数量"
  337. align="center"
  338. prop="qty"
  339. width="150px"
  340. :render-header="addRedStar"
  341. >
  342. <template slot-scope="scope">
  343. <el-form-item class="hang" :prop="'materialInfo.' + scope.$index + '.qty'" :show-message="false" :rules="{ required: true, message: '请填写数量', trigger: 'blur' }">
  344. <el-input
  345. type="number"
  346. min="0"
  347. :disabled="sonDisable"
  348. clearable
  349. size="mini"
  350. v-model="scope.row.qty"
  351. @input="getSL(scope)"
  352. @change="changeQty()"
  353. />
  354. </el-form-item>
  355. </template>
  356. </el-table-column>
  357. <el-table-column
  358. show-overflow-tooltip
  359. label="调入部门"
  360. align="center"
  361. prop="storageDeptName"
  362. width="220px"
  363. :render-header="addRedStar"
  364. >
  365. <template slot-scope="scope">
  366. <el-form-item class="hang" :prop="'materialInfo.' + scope.$index + '.storageDeptName'" :show-message="false" :rules="{ required: true, message: '请填写调入部门', trigger: 'blur' }">
  367. <el-input
  368. clearable
  369. :disabled="sonDisable || isOrg"
  370. size="mini"
  371. v-model="scope.row.storageDeptName"
  372. @clear="cleanMx(scope.$index, '调入部门')"
  373. @focus="
  374. chooseMxBM(
  375. scope.$index,
  376. 'DEPT_PARAM',
  377. true,
  378. '调入部门',{drpOrg:basicForm.storageInventoryOrg}
  379. )
  380. "
  381. >
  382. <el-button
  383. size="mini"
  384. :disabled="sonDisable || isOrg"
  385. slot="append"
  386. icon="el-icon-more"
  387. @click="
  388. chooseMxBM(
  389. scope.$index,
  390. 'DEPT_PARAM',
  391. true,
  392. '调入部门',{drpOrg:basicForm.storageInventoryOrg}
  393. )
  394. "
  395. ></el-button>
  396. </el-input>
  397. </el-form-item>
  398. </template>
  399. </el-table-column>
  400. <!-- <el-table-column
  401. show-overflow-tooltip
  402. label="调拨日期"
  403. align="center"
  404. prop="allotDate"
  405. width="230px"
  406. :render-header="addRedStar"
  407. >
  408. <template slot-scope="scope">
  409. <el-form-item class="hang" :prop="'materialInfo.' + scope.$index + '.allotDate'" :show-message="false" :rules="{ required: true, message: '请填写调拨日期', trigger: 'blur' }">
  410. <el-date-picker
  411. ref="findDate"
  412. v-model="scope.row.allotDate"
  413. :disabled="sonDisable"
  414. type="date"
  415. size="mini"
  416. :picker-options="pickerOptionsEnd"
  417. value-format="yyyy-MM-dd"
  418. >
  419. </el-date-picker>
  420. </el-form-item>
  421. </template>
  422. </el-table-column> -->
  423. <el-table-column
  424. show-overflow-tooltip
  425. label="调拨出库单号"
  426. align="center"
  427. prop="deliveryCode"
  428. width="180px"
  429. />
  430. <el-table-column
  431. show-overflow-tooltip
  432. label="调拨入库单号"
  433. align="center"
  434. prop="storageCode"
  435. width="180px"
  436. />
  437. <el-table-column
  438. show-overflow-tooltip
  439. label="规格"
  440. align="center"
  441. prop="specification"
  442. />
  443. <el-table-column
  444. show-overflow-tooltip
  445. label="生产厂家/代理人"
  446. align="center"
  447. prop="manufacturer"
  448. width="250px"
  449. />
  450. <el-table-column
  451. show-overflow-tooltip
  452. label="产地"
  453. align="center"
  454. prop="originPlaceName"
  455. />
  456. <el-table-column
  457. show-overflow-tooltip
  458. label="型号"
  459. align="center"
  460. prop="model"
  461. />
  462. <el-table-column
  463. show-overflow-tooltip
  464. label="单位"
  465. align="center"
  466. prop="unitName"
  467. />
  468. <!-- <el-table-column show-overflow-tooltip label="调出仓库" align="center" prop="deliveryWarehouseName"/> -->
  469. <el-table-column
  470. show-overflow-tooltip
  471. label="主单位"
  472. align="center"
  473. prop="mainUnitName"
  474. />
  475. <el-table-column
  476. show-overflow-tooltip
  477. label="换算率"
  478. align="center"
  479. prop="equation"
  480. />
  481. <el-table-column
  482. show-overflow-tooltip
  483. label="主数量"
  484. align="center"
  485. prop="mainQty"
  486. width="150px"
  487. >
  488. <template slot-scope="scope">
  489. <el-form-item class="hang">
  490. <el-input
  491. type="number"
  492. min="0"
  493. :disabled="sonDisable"
  494. clearable
  495. size="mini"
  496. v-model="scope.row.mainQty"
  497. @input="getZSL(scope)"
  498. />
  499. </el-form-item>
  500. </template>
  501. </el-table-column>
  502. <el-table-column
  503. show-overflow-tooltip
  504. label="税率"
  505. align="center"
  506. prop="rate"
  507. />
  508. <el-table-column
  509. show-overflow-tooltip
  510. label="调出货位"
  511. align="center"
  512. prop="deliveryAllocationName"
  513. width="220px"
  514. >
  515. <template slot-scope="scope">
  516. <el-form-item class="hang">
  517. <el-input
  518. clearable
  519. :disabled="sonDisable || isDCCk"
  520. size="mini"
  521. v-model="scope.row.deliveryAllocationName"
  522. @clear="cleanMx(scope.$index, '调出货位')"
  523. @focus="
  524. chooseMxHW(
  525. scope.$index,
  526. 'ALLOCATION_PARAM',
  527. true,
  528. '调出货位',
  529. basicForm.deliveryWarehouse
  530. )
  531. "
  532. >
  533. <el-button
  534. size="mini"
  535. :disabled="sonDisable || isDCCk"
  536. slot="append"
  537. icon="el-icon-more"
  538. @click="
  539. chooseMxHW(
  540. scope.$index,
  541. 'ALLOCATION_PARAM',
  542. true,
  543. '调出货位',
  544. basicForm.deliveryWarehouse
  545. )
  546. "
  547. ></el-button>
  548. </el-input>
  549. </el-form-item>
  550. </template>
  551. </el-table-column>
  552. <el-table-column
  553. show-overflow-tooltip
  554. label="调入货位"
  555. align="center"
  556. prop="storageAllocationName"
  557. width="220px"
  558. >
  559. <template slot-scope="scope">
  560. <el-form-item class="hang">
  561. <el-input
  562. clearable
  563. :disabled="sonDisable || isDRCk"
  564. size="mini"
  565. v-model="scope.row.storageAllocationName"
  566. @clear="cleanMx(scope.$index, '调入货位')"
  567. @focus="
  568. chooseMxHW(
  569. scope.$index,
  570. 'ALLOCATION_PARAM',
  571. true,
  572. '调入货位',
  573. basicForm.storageWarehouse
  574. )
  575. "
  576. >
  577. <el-button
  578. size="mini"
  579. :disabled="sonDisable || isDRCk"
  580. slot="append"
  581. icon="el-icon-more"
  582. @click="
  583. chooseMxHW(
  584. scope.$index,
  585. 'ALLOCATION_PARAM',
  586. true,
  587. '调入货位',
  588. basicForm.storageWarehouse
  589. )
  590. "
  591. ></el-button>
  592. </el-input>
  593. </el-form-item>
  594. </template>
  595. </el-table-column>
  596. <el-table-column
  597. show-overflow-tooltip
  598. label="批次号"
  599. align="center"
  600. prop="patchNo"
  601. />
  602. <el-table-column
  603. show-overflow-tooltip
  604. label="产品批号"
  605. align="center"
  606. prop="producBatch"
  607. width="220px"
  608. >
  609. <template slot-scope="scope">
  610. <el-form-item class="hang">
  611. <el-input
  612. disabled
  613. size="mini"
  614. v-model="scope.row.producBatch"
  615. >
  616. <el-button
  617. size="mini"
  618. :disabled="sonDisable"
  619. slot="append"
  620. icon="el-icon-more"
  621. @click="chooseBatch(scope.$index)"
  622. ></el-button>
  623. </el-input>
  624. </el-form-item>
  625. </template>
  626. </el-table-column>
  627. <el-table-column
  628. show-overflow-tooltip
  629. label="生产日期"
  630. align="center"
  631. prop="manufactureDate"
  632. width="230px"
  633. >
  634. <template slot-scope="scope">
  635. <el-form-item class="hang">
  636. <el-date-picker
  637. v-model="scope.row.manufactureDate"
  638. :disabled="sonDisable"
  639. type="date"
  640. size="mini"
  641. value-format="yyyy-MM-dd"
  642. >
  643. </el-date-picker>
  644. </el-form-item>
  645. </template>
  646. </el-table-column>
  647. <el-table-column
  648. show-overflow-tooltip
  649. label="有效期至/失效日期"
  650. align="center"
  651. prop="periodEndDate"
  652. width="150px"
  653. />
  654. <el-table-column
  655. show-overflow-tooltip
  656. label="批准文号"
  657. align="center"
  658. prop="ratifyCode"
  659. />
  660. <el-table-column
  661. show-overflow-tooltip
  662. label="注册证号"
  663. align="center"
  664. prop="registration"
  665. />
  666. <el-table-column
  667. show-overflow-tooltip
  668. label="商品名"
  669. align="center"
  670. prop="productCode"
  671. />
  672. <el-table-column
  673. show-overflow-tooltip
  674. label="通用名"
  675. align="center"
  676. prop="commonCode"
  677. width="150px"
  678. />
  679. <el-table-column
  680. show-overflow-tooltip
  681. label="剂型"
  682. align="center"
  683. prop="drug"
  684. />
  685. <el-table-column
  686. show-overflow-tooltip
  687. label="调入调出结算规则明细"
  688. align="center"
  689. prop="ruleDetail"
  690. width="200px"
  691. />
  692. <el-table-column
  693. show-overflow-tooltip
  694. label="上市许可持有人"
  695. align="center"
  696. prop="marketingApprovalPersonal"
  697. width="150px"
  698. />
  699. <el-table-column
  700. show-overflow-tooltip
  701. label="生产许可证号/经营许可证号/备案凭证号"
  702. align="center"
  703. prop="production"
  704. width="270px"
  705. />
  706. <el-table-column
  707. show-overflow-tooltip
  708. label="pi码"
  709. align="center"
  710. prop="pi"
  711. >
  712. <!-- <template slot-scope="scope">
  713. <el-form-item class="hang">
  714. <el-input
  715. :disabled="sonDisable"
  716. size="mini"
  717. v-model="scope.row.pi"
  718. />
  719. </el-form-item>
  720. </template> -->
  721. </el-table-column>
  722. <!-- <el-table-column show-overflow-tooltip label="无税金额" align="center" prop="code"/> -->
  723. <!-- <el-table-column show-overflow-tooltip label="备注" align="center" prop="code"/> -->
  724. <el-table-column
  725. show-overflow-tooltip
  726. label="类别"
  727. align="center"
  728. prop="classify"
  729. />
  730. <el-table-column
  731. show-overflow-tooltip
  732. label="客户物料码"
  733. align="center"
  734. prop="customerLogistic"
  735. width="150px"
  736. />
  737. <el-table-column
  738. show-overflow-tooltip
  739. label="客户物料名称"
  740. align="center"
  741. prop="customerLogisticName"
  742. width="150px"
  743. />
  744. <el-table-column fixed="right" label="操作" align="center">
  745. <template slot-scope="scope">
  746. <el-button
  747. type="text"
  748. size="mini"
  749. :disabled="sonDisable"
  750. @click="delLine(scope.$index, scope.row)"
  751. >删除</el-button
  752. >
  753. </template>
  754. </el-table-column>
  755. </el-table>
  756. </el-tab-pane>
  757. <el-tab-pane label="收发货信息">
  758. <el-table
  759. :data="receiveInfo"
  760. fit
  761. border
  762. max-height="280"
  763. style="font-size: 12px"
  764. >
  765. <el-table-column
  766. show-overflow-tooltip
  767. label="行号"
  768. align="center"
  769. prop="rowno"
  770. />
  771. <el-table-column
  772. show-overflow-tooltip
  773. label="调拨出库单号"
  774. align="center"
  775. prop="deliveryCode"
  776. width="150px"
  777. />
  778. <el-table-column
  779. show-overflow-tooltip
  780. label="调拨入库单号"
  781. align="center"
  782. prop="storageCode"
  783. width="150px"
  784. />
  785. <el-table-column
  786. show-overflow-tooltip
  787. label="生产厂家/代理人"
  788. align="center"
  789. prop="manufacturer"
  790. width="150px"
  791. />
  792. <el-table-column
  793. show-overflow-tooltip
  794. label="产地"
  795. align="center"
  796. prop="originPlace"
  797. width="150px"
  798. />
  799. <el-table-column
  800. show-overflow-tooltip
  801. label="类别"
  802. align="center"
  803. prop="classify"
  804. width="150px"
  805. />
  806. <el-table-column
  807. show-overflow-tooltip
  808. label="调出仓库"
  809. align="center"
  810. prop="deliveryWarehouseName"
  811. width="150px"
  812. />
  813. <el-table-column
  814. show-overflow-tooltip
  815. label="调入仓库"
  816. align="center"
  817. prop="storageWarehouseName"
  818. width="150px"
  819. />
  820. <!-- <el-table-column show-overflow-tooltip label="收货利润中心" align="center" prop="code"/>
  821. <el-table-column show-overflow-tooltip label="发货利润中心" align="center" prop="code"/> -->
  822. <el-table-column
  823. show-overflow-tooltip
  824. label="调入业务员"
  825. align="center"
  826. prop="businessPersonalName"
  827. width="150px"
  828. />
  829. <el-table-column
  830. show-overflow-tooltip
  831. label="产品批号"
  832. align="center"
  833. prop="productBatch"
  834. width="150px"
  835. />
  836. <el-table-column
  837. show-overflow-tooltip
  838. label="生产日期"
  839. align="center"
  840. prop="manufactureDate"
  841. width="150px"
  842. />
  843. <el-table-column
  844. show-overflow-tooltip
  845. label="有效期至/失效日期"
  846. align="center"
  847. prop="periodEndDate"
  848. width="150px"
  849. />
  850. <el-table-column
  851. show-overflow-tooltip
  852. label="批准文号"
  853. align="center"
  854. prop="ratifyCode"
  855. width="150px"
  856. />
  857. <el-table-column
  858. show-overflow-tooltip
  859. label="注册证号"
  860. align="center"
  861. prop="registration"
  862. width="150px"
  863. />
  864. <el-table-column
  865. show-overflow-tooltip
  866. label="商品名"
  867. align="center"
  868. prop="productCode"
  869. width="150px"
  870. />
  871. <el-table-column
  872. show-overflow-tooltip
  873. label="通用名"
  874. align="center"
  875. prop="commonCode"
  876. width="150px"
  877. />
  878. <el-table-column
  879. show-overflow-tooltip
  880. label="剂型"
  881. align="center"
  882. prop="drug"
  883. width="150px"
  884. />
  885. <el-table-column
  886. show-overflow-tooltip
  887. label="收货客户"
  888. align="center"
  889. prop="customerName"
  890. width="150px"
  891. />
  892. <el-table-column
  893. show-overflow-tooltip
  894. label="收货地址"
  895. align="center"
  896. prop="addressaddress"
  897. width="150px"
  898. />
  899. <el-table-column
  900. show-overflow-tooltip
  901. label="收货地区"
  902. align="center"
  903. prop="area"
  904. width="150px"
  905. />
  906. <el-table-column
  907. show-overflow-tooltip
  908. label="收货地点"
  909. align="center"
  910. prop="place"
  911. width="150px"
  912. />
  913. <el-table-column
  914. show-overflow-tooltip
  915. label="计划发货日期"
  916. align="center"
  917. prop="deliveryDate"
  918. width="150px"
  919. />
  920. <el-table-column
  921. show-overflow-tooltip
  922. label="计划到货日期"
  923. align="center"
  924. prop="strageDate"
  925. width="150px"
  926. />
  927. <el-table-column
  928. show-overflow-tooltip
  929. label="运输方式"
  930. align="center"
  931. prop="transportation"
  932. width="150px"
  933. />
  934. <el-table-column
  935. show-overflow-tooltip
  936. label="备注"
  937. align="center"
  938. prop="remark"
  939. width="150px"
  940. />
  941. <el-table-column
  942. show-overflow-tooltip
  943. label="客户物料编码"
  944. align="center"
  945. prop="customerLogistic"
  946. width="150px"
  947. />
  948. <el-table-column
  949. show-overflow-tooltip
  950. label="客户物料名称"
  951. align="center"
  952. prop="customerLogisticName"
  953. width="150px"
  954. />
  955. </el-table>
  956. </el-tab-pane>
  957. <el-tab-pane label="价格费用">
  958. <el-table
  959. :data="priceList"
  960. fit
  961. border
  962. max-height="280"
  963. style="font-size: 12px"
  964. >
  965. <el-table-column
  966. show-overflow-tooltip
  967. label="行号"
  968. align="center"
  969. prop="rowno"
  970. />
  971. <el-table-column
  972. show-overflow-tooltip
  973. label="调拨出库单号"
  974. align="center"
  975. prop="deliveryCode"
  976. width="150px"
  977. />
  978. <el-table-column
  979. show-overflow-tooltip
  980. label="调拨入库单号"
  981. align="center"
  982. prop="storageCode"
  983. width="150px"
  984. />
  985. <el-table-column
  986. show-overflow-tooltip
  987. label="生产厂家/代理人"
  988. align="center"
  989. prop="manufacturer"
  990. width="150px"
  991. />
  992. <el-table-column
  993. show-overflow-tooltip
  994. label="产地"
  995. align="center"
  996. prop="originPlace"
  997. width="150px"
  998. />
  999. <el-table-column
  1000. show-overflow-tooltip
  1001. label="类别"
  1002. align="center"
  1003. prop="classify"
  1004. width="150px"
  1005. />
  1006. <!-- <el-table-column show-overflow-tooltip label="税率" align="center" prop="code"/> -->
  1007. <!-- <el-table-column show-overflow-tooltip label="无税单价" align="center" prop="code"/> -->
  1008. <!-- <el-table-column show-overflow-tooltip label="含税单价" align="center" prop="code"/> -->
  1009. <el-table-column
  1010. show-overflow-tooltip
  1011. label="产品批号"
  1012. align="center"
  1013. prop="productBatch"
  1014. width="150px"
  1015. />
  1016. <el-table-column
  1017. show-overflow-tooltip
  1018. label="生产日期"
  1019. align="center"
  1020. prop="manufactureDate"
  1021. width="150px"
  1022. />
  1023. <el-table-column
  1024. show-overflow-tooltip
  1025. label="有效期至/失效日期"
  1026. align="center"
  1027. prop="periodEndDate"
  1028. width="150px"
  1029. />
  1030. <el-table-column
  1031. show-overflow-tooltip
  1032. label="批准文号"
  1033. align="center"
  1034. prop="ratifyCode"
  1035. width="150px"
  1036. />
  1037. <el-table-column
  1038. show-overflow-tooltip
  1039. label="注册证号"
  1040. align="center"
  1041. prop="registration"
  1042. width="150px"
  1043. />
  1044. <el-table-column
  1045. show-overflow-tooltip
  1046. label="商品名"
  1047. align="center"
  1048. prop="productCode"
  1049. width="150px"
  1050. />
  1051. <el-table-column
  1052. show-overflow-tooltip
  1053. label="通用名"
  1054. align="center"
  1055. prop="commonCode"
  1056. width="150px"
  1057. />
  1058. <el-table-column
  1059. show-overflow-tooltip
  1060. label="剂型"
  1061. align="center"
  1062. prop="drug"
  1063. width="150px"
  1064. />
  1065. <!-- <el-table-column show-overflow-tooltip label="询价无税价" align="center" prop="code"/> -->
  1066. <!-- <el-table-column show-overflow-tooltip label="询价含税价" align="center" prop="code"/> -->
  1067. <!-- <el-table-column show-overflow-tooltip label="税额" align="center" prop="code"/> -->
  1068. <!-- <el-table-column show-overflow-tooltip label="加价率" align="center" prop="code"/> -->
  1069. <!-- <el-table-column show-overflow-tooltip label="无税金额" align="center" prop="code"/> -->
  1070. <!-- <el-table-column show-overflow-tooltip label="价税合计" align="center" prop="code"/> -->
  1071. <el-table-column
  1072. show-overflow-tooltip
  1073. label="客户物料码"
  1074. align="center"
  1075. prop="customerLogistic"
  1076. width="150px"
  1077. />
  1078. <el-table-column
  1079. show-overflow-tooltip
  1080. label="客户物料名称"
  1081. align="center"
  1082. prop="customerLogisticName"
  1083. width="150px"
  1084. />
  1085. </el-table>
  1086. </el-tab-pane>
  1087. <el-tab-pane label="执行结果">
  1088. <el-table
  1089. :data="resultList"
  1090. fit
  1091. border
  1092. max-height="280"
  1093. style="font-size: 12px"
  1094. >
  1095. <el-table-column
  1096. show-overflow-tooltip
  1097. label="行号"
  1098. align="center"
  1099. prop="rowno"
  1100. />
  1101. <el-table-column
  1102. show-overflow-tooltip
  1103. label="调拨出库单号"
  1104. align="center"
  1105. prop="deliveryCode"
  1106. width="150px"
  1107. />
  1108. <el-table-column
  1109. show-overflow-tooltip
  1110. label="调拨入库单号"
  1111. align="center"
  1112. prop="storageCode"
  1113. width="150px"
  1114. />
  1115. <el-table-column
  1116. show-overflow-tooltip
  1117. label="生产厂家/代理人"
  1118. align="center"
  1119. prop="manufacturer"
  1120. width="150px"
  1121. />
  1122. <el-table-column
  1123. show-overflow-tooltip
  1124. label="产地"
  1125. align="center"
  1126. prop="originPlace"
  1127. width="150px"
  1128. />
  1129. <el-table-column
  1130. show-overflow-tooltip
  1131. label="类别"
  1132. align="center"
  1133. prop="classify"
  1134. width="150px"
  1135. />
  1136. <el-table-column
  1137. show-overflow-tooltip
  1138. label="产品批号"
  1139. align="center"
  1140. prop="productBatch"
  1141. width="150px"
  1142. />
  1143. <el-table-column
  1144. show-overflow-tooltip
  1145. label="生产日期"
  1146. align="center"
  1147. prop="manufactureDate"
  1148. width="150px"
  1149. />
  1150. <el-table-column
  1151. show-overflow-tooltip
  1152. label="有效期至/失效日期"
  1153. align="center"
  1154. prop="periodEndDate"
  1155. width="150px"
  1156. />
  1157. <el-table-column
  1158. show-overflow-tooltip
  1159. label="批准文号"
  1160. align="center"
  1161. prop="ratifyCode"
  1162. width="150px"
  1163. />
  1164. <el-table-column
  1165. show-overflow-tooltip
  1166. label="注册证号"
  1167. align="center"
  1168. prop="registration"
  1169. width="150px"
  1170. />
  1171. <el-table-column
  1172. show-overflow-tooltip
  1173. label="商品名"
  1174. align="center"
  1175. prop="productCode"
  1176. width="150px"
  1177. />
  1178. <el-table-column
  1179. show-overflow-tooltip
  1180. label="通用名"
  1181. align="center"
  1182. prop="commonCode"
  1183. width="150px"
  1184. />
  1185. <el-table-column
  1186. show-overflow-tooltip
  1187. label="剂型"
  1188. align="center"
  1189. prop="drug"
  1190. width="150px"
  1191. />
  1192. <!-- <el-table-column show-overflow-tooltip label="已调出主数量" align="center" prop="code"/>
  1193. <el-table-column show-overflow-tooltip label="已调入主数量" align="center" prop="code"/> -->
  1194. <!-- <el-table-column show-overflow-tooltip label="调拨在途主数量" align="center" prop="code"/> -->
  1195. <!-- <el-table-column show-overflow-tooltip label="已发货主数量" align="center" prop="code"/> -->
  1196. <!-- <el-table-column show-overflow-tooltip label="途损主数量" align="center" prop="code"/> -->
  1197. <!-- <el-table-column show-overflow-tooltip label="累计退货主数量" align="center" prop="code"/> -->
  1198. <!-- <el-table-column show-overflow-tooltip label="调出与调入已结算主数量" align="center" prop="code"/> -->
  1199. <!-- <el-table-column show-overflow-tooltip label="调出与调入已结算金额" align="center" prop="code"/> -->
  1200. <el-table-column
  1201. show-overflow-tooltip
  1202. label="客户物料码"
  1203. align="center"
  1204. prop="customerLogistic"
  1205. width="150px"
  1206. />
  1207. <el-table-column
  1208. show-overflow-tooltip
  1209. label="客户物料名称"
  1210. align="center"
  1211. prop="customerLogisticName"
  1212. width="150px"
  1213. />
  1214. </el-table>
  1215. </el-tab-pane>
  1216. </el-tabs>
  1217. <el-button type="primary" style='position: absolute;right:10px;top:5px;' size="mini" v-if="!sonDisable" @click="addLine">增行</el-button>
  1218. </div>
  1219. <el-divider content-position="left">表尾信息</el-divider>
  1220. <el-row :gutter="10">
  1221. <el-col :span="1.5">
  1222. <el-form-item label="制单人">
  1223. <el-input
  1224. v-model="basicForm.createByName"
  1225. size="mini"
  1226. disabled
  1227. clearable
  1228. style="width: 200px"
  1229. />
  1230. </el-form-item>
  1231. </el-col>
  1232. <el-col :span="1.5">
  1233. <el-form-item label="制单日期">
  1234. <el-input
  1235. v-model="basicForm.createTime"
  1236. size="mini"
  1237. disabled
  1238. clearable
  1239. style="width: 200px"
  1240. />
  1241. </el-form-item>
  1242. </el-col>
  1243. <!-- <el-col :span="1.5">
  1244. <el-form-item label="审批人">
  1245. <el-input
  1246. v-model="basicForm.code"
  1247. size="mini"
  1248. disabled
  1249. clearable
  1250. style="width: 200px"
  1251. />
  1252. </el-form-item>
  1253. </el-col>
  1254. <el-col :span="1.5">
  1255. <el-form-item label="审批日期">
  1256. <el-input
  1257. v-model="basicForm.code"
  1258. size="mini"
  1259. disabled
  1260. clearable
  1261. style="width: 200px"
  1262. />
  1263. </el-form-item>
  1264. </el-col> -->
  1265. </el-row>
  1266. <el-divider content-position="left">审计信息</el-divider>
  1267. <el-row :gutter="10">
  1268. <el-col :span="1.5">
  1269. <el-form-item label="创建人">
  1270. <el-input
  1271. v-model="basicForm.createByName"
  1272. size="mini"
  1273. disabled
  1274. clearable
  1275. style="width: 200px"
  1276. />
  1277. </el-form-item>
  1278. </el-col>
  1279. <el-col :span="1.5">
  1280. <el-form-item label="创建时间">
  1281. <el-input
  1282. v-model="basicForm.createTime"
  1283. size="mini"
  1284. disabled
  1285. clearable
  1286. style="width: 200px"
  1287. />
  1288. </el-form-item>
  1289. </el-col>
  1290. <el-col :span="1.5">
  1291. <el-form-item label="最后修改人">
  1292. <el-input
  1293. v-model="basicForm.updateByName"
  1294. size="mini"
  1295. disabled
  1296. clearable
  1297. style="width: 200px"
  1298. />
  1299. </el-form-item>
  1300. </el-col>
  1301. <el-col :span="1.5">
  1302. <el-form-item label="最后修改时间">
  1303. <el-input
  1304. v-model="basicForm.updateTime"
  1305. size="mini"
  1306. disabled
  1307. clearable
  1308. style="width: 200px"
  1309. />
  1310. </el-form-item>
  1311. </el-col>
  1312. </el-row>
  1313. </el-form>
  1314. <div class="btn_group">
  1315. <el-button
  1316. type="primary"
  1317. size="mini"
  1318. plain
  1319. @click="jumpOA"
  1320. v-if="
  1321. sonPageStu == 'check' &&
  1322. (row.status == '1' || row.status == '2') &&
  1323. row.oaId
  1324. "
  1325. >流程跳转</el-button
  1326. >
  1327. <el-button
  1328. type="primary"
  1329. size="mini"
  1330. plain
  1331. @click="copy"
  1332. v-if="sonPageStu == 'check'"
  1333. >复制</el-button
  1334. >
  1335. <el-button
  1336. type="primary"
  1337. size="mini"
  1338. plain
  1339. @click="editPage"
  1340. v-if="sonPageStu == 'check' && row.status == '0'"
  1341. >编辑</el-button
  1342. >
  1343. <el-button
  1344. type="danger"
  1345. size="mini"
  1346. plain
  1347. @click="toNC"
  1348. v-if="sonPageStu == 'check' && row.status == '2'"
  1349. >重传NC</el-button
  1350. >
  1351. <el-button
  1352. type="primary"
  1353. size="mini"
  1354. plain
  1355. @click="save"
  1356. v-if="sonPageStu == 'add' || sonPageStu == 'edit'"
  1357. >保存</el-button
  1358. >
  1359. <el-button
  1360. type="primary"
  1361. size="mini"
  1362. plain
  1363. @click="submit"
  1364. v-if="
  1365. sonPageStu == 'check' && (row.status == '0' || row.status == '3')
  1366. "
  1367. >提交</el-button
  1368. >
  1369. <el-button size="mini" plain @click="back">返回</el-button>
  1370. </div>
  1371. </el-card>
  1372. <Refers ref="refer" @doSubmit="selectionsToInput" :single="true" />
  1373. <TreeRefers ref="tree" @doSubmit="selectionsToInput2" :single="true" />
  1374. <popDialog ref="materialRefer" @doSubmit="selectMaterial" :single="true" />
  1375. <batchRefers ref="batchRefer" @doSubmit="selectBatch" :single="true" />
  1376. </div>
  1377. </template>
  1378. <script>
  1379. import { toOA } from "@/api/purchase/purchaseDemand.js";
  1380. import {
  1381. addOrder,
  1382. getOrderDetail,
  1383. editOrder,
  1384. submitOrder,
  1385. againToNC,
  1386. } from "@/api/purchase/transferOrder.js";
  1387. import Refers from "@/components/Refers/refers.vue";
  1388. // 用于回显参照框数据
  1389. import { getRefer } from "@/api/purchase/basic.js";
  1390. import TreeRefers from "@/components/Refers/treeRefer.vue";
  1391. // 明细行选择物料参照
  1392. import popDialog from "@/components/PopDialog/index.vue";
  1393. // 明细行选择批次号
  1394. import batchRefers from "@/components/Refers/batchRefer.vue";
  1395. export default {
  1396. name: "addOder",
  1397. dicts: [
  1398. "sys_allot_billtype",
  1399. "sys_project_group",
  1400. "sys_status",
  1401. "sys_to_type",
  1402. ],
  1403. props: ["pageStu", "row", "disable"],
  1404. components: {
  1405. Refers,
  1406. TreeRefers,
  1407. popDialog,
  1408. batchRefers,
  1409. },
  1410. model: {
  1411. prop: "isList",
  1412. event: "jugislist",
  1413. },
  1414. data() {
  1415. return {
  1416. loading: true,
  1417. // 不能直接改变props传来的值
  1418. sonPageStu: this.pageStu,
  1419. sonDisable: this.disable,
  1420. basicForm: {
  1421. deliveryInventoryOrg: "",
  1422. deliveryInventoryOrgCode: "",
  1423. deliveryInventoryOrgName: "",
  1424. billType: "",
  1425. code: "",
  1426. billDate: "",
  1427. allotType: "",
  1428. deliveryCode: "",
  1429. storageCode: "",
  1430. storageInventoryOrg: "",
  1431. storageInventory: "",
  1432. storageInventoryOrgName: "",
  1433. businessPersonal: "",
  1434. businessPersonalName: "",
  1435. deliveryDept: "",
  1436. deliveryDeptName: "",
  1437. currency: "",
  1438. currencyName: "",
  1439. rate: 1,
  1440. onRouteAffilliation: "",
  1441. oaId: '',
  1442. qty: "",
  1443. accountPath: "",
  1444. customer: "",
  1445. customerName: "",
  1446. deliveryWarehouse: "",
  1447. deliveryWarehouseCode: "",
  1448. deliveryWarehouseName: "",
  1449. storageWarehouse: "",
  1450. storageWarehouseName: "",
  1451. materialProject: "",
  1452. liacenter: "",
  1453. liacenterName: "",
  1454. sourceIdentification: "",
  1455. remark: "",
  1456. ncCode: "",
  1457. isSendWms: "",
  1458. status: "0",
  1459. tenantId: "",
  1460. revision: "",
  1461. createByName: "",
  1462. updateByName: "",
  1463. delFlag: "",
  1464. materialInfo: [],
  1465. },
  1466. referCondition: {
  1467. type: "",
  1468. isPage: true,
  1469. title: "",
  1470. // 仓库编码
  1471. stordocId: "",
  1472. orgCode: "",
  1473. materialCode: "",
  1474. unitCode: "",
  1475. warehouseCode: "",
  1476. },
  1477. options: [
  1478. {
  1479. value: "Y",
  1480. label: "是",
  1481. },
  1482. {
  1483. value: "N",
  1484. label: "否",
  1485. },
  1486. ],
  1487. tableIndex: null,
  1488. chuOrgOptions: [],
  1489. ruOrgOptions: [],
  1490. manOptions: [],
  1491. deptOptions: [],
  1492. currencyOptions: [],
  1493. customerOptions: [],
  1494. ruHouseOptions: [],
  1495. chuHouseOptions: [],
  1496. liacenterOptions: [],
  1497. basicRules: {
  1498. billType: [
  1499. { required: true, message: "订单类型不能为空", trigger: "blur" },
  1500. ],
  1501. deliveryWarehouse: [
  1502. { required: true, message: "调出仓库不能为空", trigger: "blur" },
  1503. ],
  1504. storageWarehouse:[
  1505. { required: true, message: "调入仓库不能为空", trigger: "blur" },
  1506. ],
  1507. deliveryInventoryOrg:[
  1508. { required: true, message: "调出库存组织不能为空", trigger: "blur" },
  1509. ],
  1510. storageInventoryOrg:[
  1511. { required: true, message: "调入库存组织不能为空", trigger: "blur" },
  1512. ],
  1513. deliveryDept:[
  1514. { required: true, message: "调出部门不能为空", trigger: "blur" },
  1515. ],
  1516. },
  1517. // materialInfo: [],
  1518. receiveInfo: [],
  1519. priceList: [],
  1520. resultList: [],
  1521. pickerOptionsEnd: {
  1522. disabledDate: (time) => {
  1523. let beginDateVal = this.basicForm.billDate;
  1524. if (beginDateVal) {
  1525. return time.getTime() < new Date(beginDateVal).getTime() - 8.64e7;
  1526. }
  1527. },
  1528. },
  1529. isOrg: true,
  1530. isDRCk: true,
  1531. isDCCk: true,
  1532. };
  1533. },
  1534. created() {
  1535. if (this.pageStu == "check") {
  1536. console.log("数据", this.row);
  1537. this.getDetails(this.row);
  1538. } else if (this.pageStu == "edit") {
  1539. this.getDetails(this.row);
  1540. this.isDRCk = false;
  1541. this.isDCCk = false;
  1542. } else if (this.pageStu == "add") {
  1543. this.basicForm.rate = 1;
  1544. this.basicForm.billDate = new Date();
  1545. this.loading = false
  1546. }
  1547. },
  1548. methods: {
  1549. // 控制先选调出库存组织和调入库存组织再选调出部门和调入调出仓库
  1550. controlCk(val) {
  1551. if (val = '调出库存组织') {console.log("进了吗");}
  1552. if (
  1553. this.basicForm.deliveryInventoryOrg &&
  1554. this.basicForm.storageInventoryOrg
  1555. ) {
  1556. this.isOrg = false;
  1557. } else {
  1558. this.basicForm.deliveryDept = "";
  1559. this.basicForm.storageWarehouse = "";
  1560. this.basicForm.deliveryWarehouse = "";
  1561. this.isOrg = true;
  1562. // 选择调入库存组织时判断调拨方式
  1563. this.basicForm.allotType = "";
  1564. }
  1565. },
  1566. // 控制子表内货位是否可以填写,根据选择仓库内csFlag
  1567. controlDCHW() {
  1568. console.log("🚀 ~ file: add.vue:735 调出货位");
  1569. this.isDCCk = true;
  1570. this.basicForm.materialInfo.forEach((item) => {
  1571. item.deliveryAllocation = null;
  1572. item.deliveryAllocationName = null;
  1573. });
  1574. },
  1575. controlDRHW() {
  1576. console.log("🚀 ~ file: add.vue:735 调入货位");
  1577. this.isDRCk = true;
  1578. this.basicForm.materialInfo.forEach((item) => {
  1579. item.storageAllocation = null;
  1580. item.storageAllocationName = null;
  1581. });
  1582. },
  1583. // 输入数量或者主数量同步改变,计算基本信息总数量
  1584. getZSL(scope) {
  1585. scope.row.qty = scope.row.mainQty;
  1586. let sum = 0
  1587. this.basicForm.materialInfo.forEach(item => {
  1588. sum += Number(item.qty)
  1589. this.basicForm.qty = sum
  1590. })
  1591. },
  1592. getSL(scope) {
  1593. scope.row.mainQty = scope.row.qty;
  1594. let sum = 0
  1595. this.basicForm.materialInfo.forEach(item => {
  1596. sum += Number(item.qty)
  1597. this.basicForm.qty = sum
  1598. })
  1599. },
  1600. copy() {
  1601. // await this.getDetails(this.row)
  1602. this.$modal.notifySuccess("复制成功");
  1603. this.sonPageStu = "add";
  1604. this.sonDisable = false;
  1605. this.basicForm.id = "";
  1606. this.basicForm.code = "";
  1607. this.basicForm.status = "0";
  1608. this.basicForm.createByName = "";
  1609. this.basicForm.createBy = "";
  1610. this.basicForm.createTime = "";
  1611. this.basicForm.isSendWms = "";
  1612. this.basicForm.ncCode = "";
  1613. this.basicForm.oaId = "";
  1614. this.basicForm.updateBy = "";
  1615. this.basicForm.updateByName = "";
  1616. this.basicForm.updateTime = "";
  1617. this.basicForm.storageCode = "";
  1618. this.basicForm.deliveryCode = "";
  1619. this.basicForm.billDate = new Date();
  1620. // 复制新增把id,编码,创建人置为空,子表去掉id
  1621. if (this.basicForm.materialInfo.length !== 0) {
  1622. this.basicForm.materialInfo.forEach((item) => {
  1623. if (item.allotDate) {
  1624. item.allotDate = new Date();
  1625. }
  1626. if (item.deliveryCode) {
  1627. item.deliveryCode = "";
  1628. }
  1629. if (item.storageCode) {
  1630. item.storageCode = "";
  1631. }
  1632. if (item.demandCode) {
  1633. item.demandCode = "";
  1634. }
  1635. if (item.allotId) {
  1636. delete item.allotId;
  1637. }
  1638. if (item.id) {
  1639. delete item.id;
  1640. }
  1641. if (item.createBy) {
  1642. delete item.createBy;
  1643. delete item.createByName;
  1644. delete item.createTime;
  1645. }
  1646. if (item.updateBy) {
  1647. delete item.updateBy;
  1648. delete item.updateByName;
  1649. delete item.updateTime;
  1650. }
  1651. });
  1652. }
  1653. this.isDRCk = false;
  1654. this.isDCCk = false;
  1655. },
  1656. editPage() {
  1657. this.sonPageStu = 'edit'
  1658. this.sonDisable = false
  1659. },
  1660. toNC() {
  1661. againToNC(this.row)
  1662. .then((res) => {
  1663. this.getDetails(this.row);
  1664. })
  1665. .catch((err) => {
  1666. this.getDetails(this.row);
  1667. });
  1668. },
  1669. submit() {
  1670. this.$modal.loading("提交中...");
  1671. this.basicForm.stAllotMaterialList = this.basicForm.materialInfo;
  1672. this.basicForm.stAllotReceiveDeliverList = this.receiveInfo;
  1673. this.basicForm.stAllotReceiveExecuteList = this.priceList;
  1674. this.basicForm.stAllotReceiveExpenseList = this.resultList;
  1675. submitOrder(this.basicForm)
  1676. .then((res) => {
  1677. if (res.code === 200) {
  1678. this.$modal.closeLoading();
  1679. this.$modal.notifySuccess("提交成功");
  1680. this.back();
  1681. }
  1682. })
  1683. .catch((err) => {
  1684. this.$modal.closeLoading();
  1685. });
  1686. },
  1687. save() {
  1688. this.$refs["basic"].validate(async (valid, obj) => {
  1689. if (valid) {
  1690. if (this.basicForm.materialInfo.length !== 0) {
  1691. if (this.sonPageStu == "add") {
  1692. this.basicForm.stAllotMaterialList = this.basicForm.materialInfo;
  1693. this.basicForm.stAllotReceiveDeliverList = this.receiveInfo;
  1694. this.basicForm.stAllotReceiveExecuteList = this.priceList;
  1695. this.basicForm.stAllotReceiveExpenseList = this.resultList;
  1696. this.$modal.loading("保存中...");
  1697. addOrder(this.basicForm)
  1698. .then((res) => {
  1699. if (res.code === 200) {
  1700. this.$modal.notifySuccess("保存成功");
  1701. this.$modal.closeLoading();
  1702. this.back();
  1703. }
  1704. })
  1705. .catch((err) => {
  1706. this.$modal.closeLoading();
  1707. });
  1708. } else if (this.sonPageStu == "edit") {
  1709. this.basicForm.stAllotMaterialList = this.basicForm.materialInfo;
  1710. this.basicForm.stAllotReceiveDeliverList = this.receiveInfo;
  1711. this.basicForm.stAllotReceiveExecuteList = this.priceList;
  1712. this.basicForm.stAllotReceiveExpenseList = this.resultList;
  1713. this.$modal.loading("保存中...");
  1714. editOrder(this.basicForm)
  1715. .then((res) => {
  1716. if (res.code === 200) {
  1717. this.$modal.notifySuccess("编辑成功");
  1718. this.$modal.closeLoading();
  1719. this.back();
  1720. }
  1721. })
  1722. .catch((err) => {
  1723. this.$modal.closeLoading();
  1724. });
  1725. }
  1726. } else {
  1727. this.$modal.notifyWarning("明细行不能为空");
  1728. }
  1729. } else {
  1730. console.log("obj",obj);
  1731. const jiaoyan = []
  1732. for(let key in obj) {
  1733. jiaoyan.push(obj[key][0].message);
  1734. }
  1735. this.$modal.notifyWarning(jiaoyan + "!");
  1736. return false;
  1737. }
  1738. });
  1739. },
  1740. back() {
  1741. this.$emit("jugislist", true);
  1742. // let queryParams = {
  1743. // pageNum: 1,
  1744. // pageSize: 5
  1745. // }
  1746. this.$emit("refresh");
  1747. },
  1748. // 如果需要回显则调用详情接口
  1749. getDetails(row) {
  1750. getOrderDetail(row.id).then((res) => {
  1751. if (res.code === 200) {
  1752. this.basicForm = res.data;
  1753. this.basicForm.materialInfo = res.data.stAllotMaterialList;
  1754. this.receiveInfo = res.data.stAllotReceiveDeliverList;
  1755. this.priceList = res.data.stAllotReceiveExecuteList;
  1756. this.resultList = res.data.stAllotReceiveExpenseList;
  1757. if (this.basicForm.deliveryInventoryOrg) {
  1758. this.reBackRefer(
  1759. "ORG_PARAM",
  1760. this.basicForm.deliveryInventoryOrg,
  1761. "调出库存组织"
  1762. );
  1763. }
  1764. if (this.basicForm.storageInventoryOrg) {
  1765. this.reBackRefer(
  1766. "ORG_PARAM",
  1767. this.basicForm.storageInventoryOrg,
  1768. "调入库存组织"
  1769. );
  1770. }
  1771. if (this.basicForm.businessPersonal) {
  1772. this.reBackRefer("CONTACTS_PARAM", this.basicForm.businessPersonal);
  1773. }
  1774. if (this.basicForm.deliveryDept) {
  1775. this.reBackRefer("DEPT_PARAM", this.basicForm.deliveryDept);
  1776. }
  1777. if (this.basicForm.currency) {
  1778. this.reBackRefer("CURRENCY_PARAM", this.basicForm.currency);
  1779. }
  1780. // 客户
  1781. if (this.basicForm.customer) {
  1782. this.reBackRefer("CUSTOMER_PARAM", this.basicForm.customer);
  1783. }
  1784. if (this.basicForm.storageWarehouse) {
  1785. this.reBackRefer(
  1786. "WAREHOUSE_PARAM",
  1787. this.basicForm.storageWarehouse,
  1788. "调入仓库"
  1789. );
  1790. }
  1791. if (this.basicForm.deliveryWarehouse) {
  1792. this.reBackRefer(
  1793. "WAREHOUSE_PARAM",
  1794. this.basicForm.deliveryWarehouse,
  1795. "调出仓库"
  1796. );
  1797. }
  1798. if (this.basicForm.liacenter) {
  1799. this.reBackRefer("LIACENTER_PARAM", this.basicForm.liacenter);
  1800. }
  1801. // 控制先选调出库存组织和调入库存组织再选调出部门和调入调出仓库
  1802. this.controlCk();
  1803. }
  1804. }).then(() => {
  1805. this.loading = false
  1806. }).catch(err => {
  1807. this.loading = false
  1808. })
  1809. },
  1810. // 回显参照框
  1811. reBackRefer(type, id, title) {
  1812. getRefer({ type: type, id: id, title: title }).then((res) => {
  1813. if (type == "ORG_PARAM" && title == "调出库存组织") {
  1814. this.chuOrgOptions = res.rows;
  1815. }
  1816. if (type == "ORG_PARAM" && title == "调入库存组织") {
  1817. this.ruOrgOptions = res.rows;
  1818. }
  1819. if (type == "CONTACTS_PARAM") {
  1820. this.manOptions = res.rows;
  1821. }
  1822. if (type == "DEPT_PARAM") {
  1823. this.deptOptions = res.rows;
  1824. }
  1825. if (type == "CURRENCY_PARAM") {
  1826. this.currencyOptions = res.rows;
  1827. }
  1828. if (type == "LIACENTER_PARAM") {
  1829. this.liacenterOptions = res.rows;
  1830. }
  1831. if (type == "CUSTOMER_PARAM") {
  1832. this.customerOptions = res.rows;
  1833. }
  1834. if (type == "WAREHOUSE_PARAM" && title == "调入仓库") {
  1835. this.ruHouseOptions = res.rows;
  1836. }
  1837. if (type == "WAREHOUSE_PARAM" && title == "调出仓库") {
  1838. this.chuHouseOptions = res.rows;
  1839. }
  1840. if (type == "UNIT_PARAM") {
  1841. this.basicForm.materialInfo[this.tableIndex].unitCode = res.rows[0].code;
  1842. }
  1843. });
  1844. },
  1845. addLine() {
  1846. const newLine = {
  1847. rowno: null,
  1848. demandCode: null,
  1849. material: null,
  1850. materialCode: null,
  1851. materialName: null,
  1852. deliveryCode: null,
  1853. storageCode: null,
  1854. specification: null,
  1855. manufacturer: null,
  1856. originPlace: null,
  1857. originPlaceName: null,
  1858. model: null,
  1859. unit: null,
  1860. unitCode: null,
  1861. unitName: null,
  1862. deliveryWarehouseName: null,
  1863. qty: null,
  1864. mainUnit: null,
  1865. mainUnitName: null,
  1866. equation: "1/1",
  1867. mainQty: null,
  1868. rate: "0.00",
  1869. storageWarehouseName: null,
  1870. deliveryAllocationName: null,
  1871. deliveryAllocation: null,
  1872. storageDept: null,
  1873. storageDeptName: null,
  1874. storageAllocationName: null,
  1875. storageAllocation: null,
  1876. patchNo: null,
  1877. producBatch: null,
  1878. manufactureDate: null,
  1879. periodEndDate: null,
  1880. allotDate: new Date(),
  1881. ratifyCode: null,
  1882. registration: null,
  1883. productCode: null,
  1884. commonCode: null,
  1885. drug: null,
  1886. ruleDetail: null,
  1887. marketingApprovalPersonal: null,
  1888. production: null,
  1889. pi: null,
  1890. classify: null,
  1891. customerLogistic: null,
  1892. customerLogisticName: null,
  1893. delFlag: 0,
  1894. };
  1895. this.basicForm.materialInfo.push(newLine);
  1896. },
  1897. delLine(index,row) {
  1898. // this.basicForm.materialInfo = this.basicForm.materialInfo.map((item, index) => ({
  1899. // ...item,
  1900. // delFlag: index === $index ? "2" : item.delFlag,
  1901. // }));
  1902. if (row.id) {
  1903. this.basicForm.materialInfo.forEach(e => {
  1904. if(e.id == row.id){
  1905. e.delFlag = '2'
  1906. }
  1907. });
  1908. }else{
  1909. this.basicForm.materialInfo.splice(index, 1);
  1910. }
  1911. },
  1912. //
  1913. rowClassName(prop) {
  1914. const {
  1915. row: { delFlag },
  1916. } = prop;
  1917. if (delFlag === "2") {
  1918. return "is-hidden";
  1919. } else {
  1920. return "";
  1921. }
  1922. },
  1923. chooseRefer(type, isPage, title, pkOrg, isDirectStore, gubFlag,parame) {
  1924. this.referCondition.type = type;
  1925. this.referCondition.isPage = isPage;
  1926. this.referCondition.title = title;
  1927. this.referCondition.pkOrg = pkOrg;
  1928. this.referCondition.isDirectStore = isDirectStore;
  1929. this.referCondition.gubFlag = gubFlag;
  1930. this.referCondition.parame = parame;
  1931. this.$refs.refer.init(this.referCondition);
  1932. },
  1933. selectionsToInput(selection) {
  1934. if (this.referCondition.title == "调出库存组织") {
  1935. this.chuOrgOptions = selection;
  1936. this.basicForm.deliveryInventoryOrg = selection[0].id;
  1937. this.basicForm.deliveryInventoryOrgCode = selection[0].code;
  1938. this.basicForm.deliveryInventoryOrgName = selection[0].name;
  1939. this.clearDCZZ()
  1940. }
  1941. if (this.referCondition.title == "调入库存组织") {
  1942. this.ruOrgOptions = selection;
  1943. this.basicForm.storageInventoryOrg = selection[0].id;
  1944. this.basicForm.storageInventory = selection[0].code;
  1945. this.basicForm.storageInventoryOrgName = selection[0].name;
  1946. this.basicForm.onRouteAffilliation = selection[0].name;
  1947. this.clearDRZZ()
  1948. }
  1949. if (this.referCondition.title == "调出业务员") {
  1950. this.manOptions = selection;
  1951. this.basicForm.businessPersonal = selection[0].code;
  1952. this.basicForm.businessPersonalName = selection[0].name;
  1953. }
  1954. if (this.referCondition.title == "调出部门") {
  1955. this.deptOptions = selection;
  1956. this.basicForm.deliveryDept = selection[0].id;
  1957. this.basicForm.deliveryDeptName = selection[0].name;
  1958. }
  1959. if (this.referCondition.title == "币种") {
  1960. this.currencyOptions = selection;
  1961. this.basicForm.currency = selection[0].id;
  1962. this.basicForm.currencyName = selection[0].name;
  1963. }
  1964. if (this.referCondition.title == "客户") {
  1965. this.customerOptions = selection;
  1966. this.basicForm.customer = selection[0].id;
  1967. this.basicForm.customerName = selection[0].name;
  1968. }
  1969. if (this.referCondition.title == "调入仓库") {
  1970. this.ruHouseOptions = selection;
  1971. this.basicForm.storageWarehouse = selection[0].id;
  1972. this.basicForm.storageWarehouseName = selection[0].name;
  1973. console.log("1111", selection[0].csFlag);
  1974. // 清空调入货位
  1975. this.basicForm.materialInfo.forEach((item) => {
  1976. item.storageAllocation = null;
  1977. item.storageAllocationName = null;
  1978. });
  1979. if (selection[0].csFlag == "N") {
  1980. this.isDRCk = true;
  1981. } else {
  1982. this.isDRCk = false;
  1983. }
  1984. }
  1985. if (this.referCondition.title == "调出仓库") {
  1986. this.chuHouseOptions = selection;
  1987. this.basicForm.deliveryWarehouse = selection[0].id;
  1988. this.basicForm.deliveryWarehouseCode = selection[0].code;
  1989. this.basicForm.deliveryWarehouseName = selection[0].name;
  1990. console.log("2222", selection[0].csFlag);
  1991. // 清空调出货位
  1992. this.basicForm.materialInfo.forEach((item) => {
  1993. item.deliveryAllocation = null;
  1994. item.deliveryAllocationName = null;
  1995. });
  1996. if (selection[0].csFlag == "N") {
  1997. this.isDCCk = true;
  1998. } else {
  1999. this.isDCCk = false;
  2000. }
  2001. }
  2002. if (this.referCondition.title == "调出货位") {
  2003. this.basicForm.materialInfo[this.tableIndex].deliveryAllocationName =
  2004. selection[0].name;
  2005. this.basicForm.materialInfo[this.tableIndex].deliveryAllocation = selection[0].id;
  2006. }
  2007. if (this.referCondition.title == "调入货位") {
  2008. this.basicForm.materialInfo[this.tableIndex].storageAllocationName =
  2009. selection[0].name;
  2010. this.basicForm.materialInfo[this.tableIndex].storageAllocation = selection[0].id;
  2011. }
  2012. if (this.referCondition.title == "调入部门") {
  2013. this.basicForm.materialInfo[this.tableIndex].storageDeptName = selection[0].name;
  2014. this.basicForm.materialInfo[this.tableIndex].storageDept = selection[0].id;
  2015. }
  2016. // 控制先选调出库存组织和调入库存组织再选调出部门和调入调出仓库
  2017. this.controlCk();
  2018. },
  2019. // 必选标识
  2020. addRedStar(h, { column }) {
  2021. return [
  2022. h('span', { style: 'color: #F56C6C' }, '*'),
  2023. h('span', ' ' + column.label)
  2024. ];
  2025. },
  2026. // 调出库存组织清空相关数据
  2027. clearDCZZ() {
  2028. // 清空调出仓库,部门
  2029. this.basicForm.deliveryWarehouse = "";
  2030. this.basicForm.deliveryWarehouseCode = "";
  2031. this.basicForm.deliveryWarehouseName = "";
  2032. this.basicForm.deliveryDept = "";
  2033. this.basicForm.deliveryDeptName = "";
  2034. // 清空调出货位且禁用
  2035. this.basicForm.materialInfo.forEach((item) => {
  2036. item.deliveryAllocation = null;
  2037. item.deliveryAllocationName = null;
  2038. });
  2039. this.isDCCk = true;
  2040. // 选择调入库存组织时判断调拨方式
  2041. if (
  2042. this.basicForm.storageInventoryOrg ==
  2043. this.basicForm.deliveryInventoryOrg
  2044. ) {
  2045. this.basicForm.allotType = "4";
  2046. } else {
  2047. this.basicForm.allotType = "2";
  2048. }
  2049. },
  2050. // 调入库存组织清空相关数据
  2051. clearDRZZ() {
  2052. // 选择调入库存组织清空仓库
  2053. this.basicForm.storageWarehouse = "";
  2054. this.basicForm.storageWarehouseName = "";
  2055. // 清空调入部门
  2056. this.basicForm.materialInfo.forEach((item) => {
  2057. item.storageDept = null;
  2058. item.storageDeptName = null;
  2059. });
  2060. // 清空调入货位且禁用
  2061. this.basicForm.materialInfo.forEach((item) => {
  2062. item.storageAllocation = null;
  2063. item.storageAllocationName = null;
  2064. });
  2065. this.isDRCk = true
  2066. // 选择调入库存组织时判断调拨方式
  2067. if (
  2068. this.basicForm.storageInventoryOrg ==
  2069. this.basicForm.deliveryInventoryOrg
  2070. ) {
  2071. this.basicForm.allotType = "4";
  2072. } else {
  2073. this.basicForm.allotType = "2";
  2074. }
  2075. },
  2076. chooseTreeRefer(type, isPage, title) {
  2077. this.referCondition.type = type;
  2078. this.referCondition.isPage = isPage;
  2079. this.referCondition.title = title;
  2080. this.$refs.tree.init(this.referCondition);
  2081. },
  2082. selectionsToInput2(selection) {
  2083. this.liacenterOptions.push(selection);
  2084. this.basicForm.liacenter = selection.id;
  2085. this.basicForm.liacenterName = selection.name;
  2086. },
  2087. // 明细行选择物料编码带出数据
  2088. chooseMaterial(index) {
  2089. console.log("🚀 ~ file: add.vue:790 ~ chooseMaterial ~ index:", index);
  2090. this.tableIndex = index;
  2091. this.$refs.materialRefer.init();
  2092. },
  2093. // 明细行数量失去焦点
  2094. changeQty(aa,bb){
  2095. console.log('aa',aa);
  2096. console.log('bb',bb);
  2097. },
  2098. selectMaterial(selection) {
  2099. console.log("选中的物料", selection);
  2100. // 先清空通用名,调入调出结算规则明细
  2101. this.basicForm.materialInfo[this.tableIndex].ruleDetail = ''
  2102. this.basicForm.materialInfo[this.tableIndex].commonCode = ''
  2103. this.basicForm.materialInfo[this.tableIndex].material = selection[0].id;
  2104. this.basicForm.materialInfo[this.tableIndex].materialCode = selection[0].code;
  2105. this.basicForm.materialInfo[this.tableIndex].materialName = selection[0].name;
  2106. this.basicForm.materialInfo[this.tableIndex].specification = selection[0].specification;
  2107. this.basicForm.materialInfo[this.tableIndex].model = selection[0].model;
  2108. this.basicForm.materialInfo[this.tableIndex].originPlace = selection[0].originPlace;
  2109. this.basicForm.materialInfo[this.tableIndex].originPlaceName = selection[0].originPlaceName;
  2110. this.basicForm.materialInfo[this.tableIndex].unit = selection[0].unitId;
  2111. this.basicForm.materialInfo[this.tableIndex].mainUnit = selection[0].unitId;
  2112. this.basicForm.materialInfo[this.tableIndex].unitName = selection[0].unitIdName;
  2113. this.basicForm.materialInfo[this.tableIndex].mainUnitName = selection[0].unitIdName;
  2114. this.basicForm.materialInfo[this.tableIndex].manufacturer = selection[0].manufacturerIdName;
  2115. this.basicForm.materialInfo[this.tableIndex].marketingApprovalPersonal = selection[0].registrant;
  2116. this.basicForm.materialInfo[this.tableIndex].production = selection[0].productionPermit;
  2117. // 根据物料单位id查询单位code
  2118. this.reBackRefer("UNIT_PARAM", selection[0].unitId);
  2119. },
  2120. // 明细行选择批次号
  2121. chooseBatch(index) {
  2122. this.tableIndex = index;
  2123. this.referCondition.orgId = this.basicForm.deliveryInventoryOrg;
  2124. this.referCondition.materialCode =
  2125. this.basicForm.materialInfo[this.tableIndex].materialCode;
  2126. this.referCondition.unitId = this.basicForm.materialInfo[this.tableIndex].unit;
  2127. this.referCondition.warehouseId = this.basicForm.deliveryWarehouse;
  2128. this.$refs.batchRefer.init(this.referCondition);
  2129. },
  2130. selectBatch(selection) {
  2131. console.log("选中的批次号", selection);
  2132. },
  2133. // 明细行选择货位
  2134. chooseMxHW(index, type, isPage, title, stordocId) {
  2135. this.tableIndex = index;
  2136. this.referCondition.type = type;
  2137. this.referCondition.isPage = isPage;
  2138. this.referCondition.title = title;
  2139. this.referCondition.pkOrg = "";
  2140. this.referCondition.stordocId = stordocId;
  2141. this.$refs.refer.init(this.referCondition);
  2142. },
  2143. // 明细行选择调入部门
  2144. chooseMxBM(index, type, isPage, title,parame) {
  2145. this.tableIndex = index;
  2146. this.referCondition.type = type;
  2147. this.referCondition.isPage = isPage;
  2148. this.referCondition.title = title;
  2149. this.referCondition.parame = parame;
  2150. this.$refs.refer.init(this.referCondition);
  2151. },
  2152. // 选择框彻底清空
  2153. clean(val) {
  2154. if (val == "调出库存组织") {
  2155. this.clearDCZZ()
  2156. }
  2157. if (val == "调入库存组织") {
  2158. this.clearDRZZ()
  2159. }
  2160. if (val == "调出业务员") {
  2161. this.basicForm.businessPersonal = "";
  2162. this.basicForm.businessPersonalName = "";
  2163. }
  2164. if (val == "调入仓库") {
  2165. this.basicForm.storageWarehouse = "";
  2166. this.basicForm.storageWarehouseName = "";
  2167. this.basicForm.materialInfo.forEach((item) => {
  2168. item.storageAllocation = null;
  2169. item.storageAllocationName = null;
  2170. });
  2171. this.isDRCk = true
  2172. }
  2173. if (val == "调出仓库") {
  2174. this.basicForm.deliveryWarehouse = "";
  2175. this.basicForm.deliveryWarehouseCode = "";
  2176. this.basicForm.deliveryWarehouseName = "";
  2177. }
  2178. if (val == "利润中心") {
  2179. this.basicForm.liacenter = "";
  2180. this.basicForm.liacenterName = "";
  2181. }
  2182. },
  2183. // 明细选择框清空
  2184. cleanMx(index, val) {
  2185. if (val == "物料编码") {
  2186. this.basicForm.materialInfo[index].material = "";
  2187. this.basicForm.materialInfo[index].materialCode = "";
  2188. this.basicForm.materialInfo[index].materialName = "";
  2189. this.basicForm.materialInfo[index].specification = "";
  2190. this.basicForm.materialInfo[index].model = "";
  2191. this.basicForm.materialInfo[index].originPlace = "";
  2192. this.basicForm.materialInfo[index].originPlaceName = "";
  2193. this.basicForm.materialInfo[index].unit = "";
  2194. this.basicForm.materialInfo[index].mainUnit = "";
  2195. this.basicForm.materialInfo[index].unitName = "";
  2196. this.basicForm.materialInfo[index].mainUnitName = "";
  2197. this.basicForm.materialInfo[index].manufacturer = "";
  2198. this.basicForm.materialInfo[index].ruleDetail = ''
  2199. this.basicForm.materialInfo[index].commonCode = ''
  2200. this.basicForm.materialInfo[index].marketingApprovalPersonal = "";
  2201. this.basicForm.materialInfo[index].production = "";
  2202. this.basicForm.materialInfo[index].unitCode = "";
  2203. }
  2204. if (val == "调出货位") {
  2205. this.basicForm.materialInfo[index].deliveryAllocationName = "";
  2206. this.basicForm.materialInfo[index].deliveryAllocation = "";
  2207. }
  2208. if (val == "调入部门") {
  2209. this.basicForm.materialInfo[index].storageDeptName = "";
  2210. this.basicForm.materialInfo[index].storageDept = "";
  2211. }
  2212. if (val == "调入货位") {
  2213. this.basicForm.materialInfo[index].storageAllocationName = "";
  2214. this.basicForm.materialInfo[index].storageAllocation = "";
  2215. }
  2216. },
  2217. jumpOA() {
  2218. toOA(this.$store.state.user.name, this.basicForm.oaId).then((res) => {
  2219. if (res.code === 200) {
  2220. window.open(res.oaUrl);
  2221. }
  2222. });
  2223. },
  2224. },
  2225. };
  2226. </script>
  2227. <style lang="scss" scoped>
  2228. ::v-deep .el-table__row.is-hidden {
  2229. display: none;
  2230. }
  2231. .btn_group {
  2232. // width: 100%;
  2233. // margin: 20px 0;
  2234. display: flex;
  2235. // justify-content: center;
  2236. position: absolute;
  2237. top: 10px;
  2238. right: 20px;
  2239. }
  2240. .btn_grooup {
  2241. margin-bottom: 10px;
  2242. display: flex;
  2243. justify-content: flex-end;
  2244. }
  2245. .hang {
  2246. margin: auto;
  2247. }
  2248. .hang ::v-deep .el-form-item__content {
  2249. margin-left: 0px !important;
  2250. }
  2251. ::v-deep .el-table__row > td {
  2252. border-right: none;
  2253. }
  2254. </style>