add.vue 57 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278
  1. <template>
  2. <div id="addOder">
  3. <el-form :model="basicForm" :rules="basicRules" ref="basic" label-width="auto">
  4. <el-row :gutter="10">
  5. <el-col :span="1.5">
  6. <el-form-item label="调出库存组织">
  7. <el-select clearable size="mini" v-model="basicForm.deliveryInventoryOrg" :disabled="sonDisable" @clear="clean('调出库存组织')" @change="controlCk" @focus="chooseRefer('ORG_PARAM', true, '调出库存组织')" style="width: 200px">
  8. <el-option v-for="item in chuOrgOptions" :key="item.id" :label="item.name" :value="item.id" />
  9. </el-select>
  10. </el-form-item>
  11. </el-col>
  12. <el-col :span="1.5">
  13. <el-form-item label="订单类型">
  14. <el-select v-model="basicForm.billType" :disabled="sonDisable" size="mini" style="width: 200px" clearable>
  15. <el-option v-for="dict in dict.type.sys_allot_billtype" :key="dict.value" :label="dict.label" :value="dict.value">
  16. </el-option>
  17. </el-select>
  18. </el-form-item>
  19. </el-col>
  20. <el-col :span="1.5">
  21. <el-form-item label="单据号">
  22. <el-input
  23. v-model="basicForm.code"
  24. size="mini"
  25. :disabled="sonDisable"
  26. clearable
  27. style="width: 200px"
  28. />
  29. </el-form-item>
  30. </el-col>
  31. <el-col :span="1.5">
  32. <el-form-item label="单据日期">
  33. <el-date-picker
  34. v-model="basicForm.billDate"
  35. size="mini"
  36. :disabled="sonDisable"
  37. type="date"
  38. clearable
  39. @change="changeBillDate"
  40. value-format="yyyy-MM-dd"
  41. style="width: 200px">
  42. </el-date-picker>
  43. </el-form-item>
  44. </el-col>
  45. <el-col :span="1.5">
  46. <el-form-item label="调拨方式">
  47. <el-select v-model="basicForm.allotType" disabled size="mini" style="width: 200px" clearable>
  48. <el-option v-for="dict in dict.type.sys_to_type" :key="dict.value" :label="dict.label" :value="dict.value">
  49. </el-option>
  50. </el-select>
  51. </el-form-item>
  52. </el-col>
  53. <el-col :span="1.5">
  54. <el-form-item label="调拨出库单号">
  55. <el-input
  56. v-model="basicForm.deliveryCode"
  57. size="mini"
  58. :disabled="sonDisable"
  59. clearable
  60. style="width: 200px"
  61. />
  62. </el-form-item>
  63. </el-col>
  64. <el-col :span="1.5">
  65. <el-form-item label="调拨入库单号">
  66. <el-input
  67. v-model="basicForm.storageCode"
  68. size="mini"
  69. :disabled="sonDisable"
  70. clearable
  71. style="width: 200px"
  72. />
  73. </el-form-item>
  74. </el-col>
  75. <el-col :span="1.5">
  76. <el-form-item label="调入库存组织">
  77. <el-select clearable size="mini" v-model="basicForm.storageInventoryOrg" :disabled="sonDisable" @clear="clean('调入库存组织')" @change="controlCk" @focus="chooseRefer('ORG_PARAM', true, '调入库存组织')" style="width: 200px">
  78. <el-option v-for="item in ruOrgOptions" :key="item.id" :label="item.name" :value="item.id" />
  79. </el-select>
  80. </el-form-item>
  81. </el-col>
  82. <el-col :span="1.5">
  83. <el-form-item label="调出业务员">
  84. <el-select clearable size="mini" v-model="basicForm.businessPersonal" :disabled="sonDisable" @clear="clean('调出业务员')" @focus="chooseRefer('CONTACTS_PARAM', true, '调出业务员')" style="width: 200px">
  85. <el-option v-for="item in manOptions" :key="item.id" :label="item.name" :value="item.code" />
  86. </el-select>
  87. </el-form-item>
  88. </el-col>
  89. <el-col :span="1.5">
  90. <el-form-item label="调出部门">
  91. <el-select clearable size="mini" v-model="basicForm.deliveryDept" :disabled="sonDisable || isOrg" @focus="chooseRefer('DEPT_PARAM', true, '调出部门', basicForm.deliveryInventoryOrg)" style="width: 200px">
  92. <el-option v-for="item in deptOptions" :key="item.id" :label="item.name" :value="item.id" />
  93. </el-select>
  94. </el-form-item>
  95. </el-col>
  96. <el-col :span="1.5">
  97. <el-form-item label="币种">
  98. <el-select clearable size="mini" v-model="basicForm.currency" :disabled="sonDisable" @focus="chooseRefer('CURRENCY_PARAM', true, '币种')" style="width: 200px">
  99. <el-option v-for="item in currencyOptions" :key="item.id" :label="item.name" :value="item.id" />
  100. </el-select>
  101. </el-form-item>
  102. </el-col>
  103. <el-col :span="1.5">
  104. <el-form-item label="折本汇率">
  105. <el-input-number
  106. v-model="basicForm.rate"
  107. size="mini"
  108. disabled
  109. :precision="2"
  110. :step="0.1"
  111. :max="10"
  112. style="width: 200px"
  113. ></el-input-number>
  114. </el-form-item>
  115. </el-col>
  116. <el-col :span="1.5">
  117. <el-form-item label="在途归属">
  118. <el-input
  119. v-model="basicForm.onRouteAffilliation"
  120. size="mini"
  121. disabled
  122. clearable
  123. style="width: 200px"
  124. />
  125. </el-form-item>
  126. </el-col>
  127. <el-col :span="1.5">
  128. <el-form-item label="总数量">
  129. <el-input
  130. v-model="basicForm.qty"
  131. type="number" min="0"
  132. size="mini"
  133. :disabled="sonDisable"
  134. clearable
  135. style="width: 200px"
  136. />
  137. </el-form-item>
  138. </el-col>
  139. <el-col :span="1.5">
  140. <el-form-item label="结算路径">
  141. <el-input
  142. v-model="basicForm.accountPath"
  143. size="mini"
  144. :disabled="sonDisable"
  145. clearable
  146. style="width: 200px"
  147. />
  148. </el-form-item>
  149. </el-col>
  150. <el-col :span="1.5">
  151. <el-form-item label="客户">
  152. <el-input
  153. v-model="basicForm.customer"
  154. size="mini"
  155. :disabled="sonDisable"
  156. clearable
  157. style="width: 200px"
  158. />
  159. </el-form-item>
  160. </el-col>
  161. <el-col :span="1.5">
  162. <el-form-item label="调入仓库">
  163. <el-select clearable size="mini" v-model="basicForm.storageWarehouse" :disabled="sonDisable || isOrg" @clear="clean('调入仓库')" @change="controlDRHW" @focus="chooseRefer('WAREHOUSE_PARAM', true, '调入仓库', basicForm.storageInventoryOrg, 'N', 'N')" style="width: 200px">
  164. <el-option v-for="item in ruHouseOptions" :key="item.id" :label="item.name" :value="item.id" />
  165. </el-select>
  166. </el-form-item>
  167. </el-col>
  168. <el-col :span="1.5">
  169. <el-form-item label="调出仓库">
  170. <el-select clearable size="mini" v-model="basicForm.deliveryWarehouse" :disabled="sonDisable || isOrg" @clear="clean('调出仓库')" @change="controlDCHW" @focus="chooseRefer('WAREHOUSE_PARAM', true, '调出仓库', basicForm.deliveryInventoryOrg, 'N', 'N')" style="width: 200px">
  171. <el-option v-for="item in chuHouseOptions" :key="item.id" :label="item.name" :value="item.id" />
  172. </el-select>
  173. </el-form-item>
  174. </el-col>
  175. <el-col :span="1.5">
  176. <el-form-item label="物流项目组">
  177. <el-select v-model="basicForm.materialProject" :disabled="sonDisable" size="mini" style="width: 200px" clearable>
  178. <el-option v-for="dict in dict.type.sys_project_group" :key="dict.value" :label="dict.label" :value="dict.value">
  179. </el-option>
  180. </el-select>
  181. </el-form-item>
  182. </el-col>
  183. <el-col :span="1.5">
  184. <el-form-item label="利润中心">
  185. <el-select clearable size="mini" v-model="basicForm.liacenter" :disabled="sonDisable" @clear="clean('利润中心')" @focus="chooseTreeRefer('LIACENTER_PARAM', false, '利润中心')" style="width: 200px">
  186. <el-option v-for="item in liacenterOptions" :key="item.id" :label="item.name" :value="item.id" />
  187. </el-select>
  188. </el-form-item>
  189. </el-col>
  190. <el-col :span="1.5">
  191. <el-form-item label="单据状态">
  192. <el-select disabled v-model="basicForm.status" size="mini" style="width: 200px" clearable>
  193. <el-option v-for="dict in dict.type.sys_status" :key="dict.value" :label="dict.label" :value="dict.value">
  194. </el-option>
  195. </el-select>
  196. </el-form-item>
  197. </el-col>
  198. <el-col :span="1.5">
  199. <el-form-item label="备注">
  200. <el-input
  201. v-model="basicForm.remark"
  202. size="mini"
  203. :disabled="sonDisable"
  204. clearable
  205. style="width: 200px"
  206. />
  207. </el-form-item>
  208. </el-col>
  209. </el-row>
  210. <el-row>
  211. <el-col :span="1.5">
  212. <el-form-item label="NC单据号">
  213. <el-input
  214. v-model="basicForm.ncCode"
  215. size="mini"
  216. disabled
  217. style="width: 200px"
  218. />
  219. </el-form-item>
  220. </el-col>
  221. </el-row>
  222. <el-row>
  223. <el-col :span="20">
  224. <el-form-item label="同步NC结果">
  225. <el-input
  226. v-model="basicForm.isSendWms"
  227. type="textarea"
  228. :rows="3"
  229. size="mini"
  230. disabled
  231. clearable
  232. />
  233. </el-form-item>
  234. </el-col>
  235. </el-row>
  236. <el-tabs style="margin-top: 10px;" type="border-card">
  237. <el-tab-pane label="物料信息">
  238. <div class="btn_grooup">
  239. <el-button type="primary" size="mini" v-if="!sonDisable" @click="addLine">增行</el-button>
  240. </div>
  241. <el-table
  242. :data="materialInfo"
  243. fit
  244. max-height="480"
  245. style="font-size: 12px;"
  246. >
  247. <el-table-column show-overflow-tooltip label="行号" align="center" prop="rowno">
  248. <template slot-scope="scope">
  249. {{ scope.$index + 1 + '0' }}
  250. </template>
  251. </el-table-column>
  252. <el-table-column show-overflow-tooltip label="采购需求单单号" align="center" prop="demandCode" width="200px"/>
  253. <el-table-column show-overflow-tooltip label="物料编码" align="center" prop="materialCode" width="230px">
  254. <template slot-scope="scope">
  255. <el-form-item class="hang">
  256. <el-input clearable :disabled="sonDisable" size="mini" v-model="scope.row.materialCode" @clear="cleanMx(scope.$index, '物料编码')" @focus="chooseMaterial(scope.$index)">
  257. <el-button size="mini" :disabled="sonDisable" slot="append" icon="el-icon-more" @click="chooseMaterial(scope.$index)"></el-button>
  258. </el-input>
  259. </el-form-item>
  260. </template>
  261. </el-table-column>
  262. <el-table-column show-overflow-tooltip label="物料名称" align="center" prop="materialName" width="200px"/>
  263. <el-table-column show-overflow-tooltip label="调拨出库单号" align="center" prop="deliveryCode" width="200px"/>
  264. <el-table-column show-overflow-tooltip label="调拨入库单号" align="center" prop="storageCode" width="200px"/>
  265. <el-table-column show-overflow-tooltip label="规格" align="center" prop="specification"/>
  266. <el-table-column show-overflow-tooltip label="生产厂家/代理人" align="center" prop="manufacturer" width="200px"/>
  267. <el-table-column show-overflow-tooltip label="产地" align="center" prop="originPlaceName"/>
  268. <el-table-column show-overflow-tooltip label="型号" align="center" prop="model"/>
  269. <el-table-column show-overflow-tooltip label="单位" align="center" prop="unitName"/>
  270. <!-- <el-table-column show-overflow-tooltip label="调出仓库" align="center" prop="deliveryWarehouseName"/> -->
  271. <el-table-column show-overflow-tooltip label="数量" align="center" prop="qty" width="150px">
  272. <template slot-scope="scope">
  273. <el-form-item class="hang">
  274. <el-input type="number" min="0" :readonly="sonDisable" clearable size="mini" v-model="scope.row.qty" @input="getSL(scope)"/>
  275. </el-form-item>
  276. </template>
  277. </el-table-column>
  278. <el-table-column show-overflow-tooltip label="主单位" align="center" prop="mainUnitName"/>
  279. <el-table-column show-overflow-tooltip label="换算率" align="center" prop="equation"/>
  280. <el-table-column show-overflow-tooltip label="主数量" align="center" prop="mainQty" width="150px">
  281. <template slot-scope="scope">
  282. <el-form-item class="hang">
  283. <el-input type="number" min="0" :readonly="sonDisable" clearable size="mini" v-model="scope.row.mainQty" @input="getZSL(scope)"/>
  284. </el-form-item>
  285. </template>
  286. </el-table-column>
  287. <el-table-column show-overflow-tooltip label="税率" align="center" prop="rate"/>
  288. <el-table-column show-overflow-tooltip label="调出货位" align="center" prop="deliveryAllocationName" width="230px">
  289. <template slot-scope="scope">
  290. <el-form-item class="hang">
  291. <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)">
  292. <el-button size="mini" :disabled="sonDisable || isDCCk" slot="append" icon="el-icon-more" @click="chooseMxHW(scope.$index, 'ALLOCATION_PARAM', true, '调出货位', basicForm.deliveryWarehouse)"></el-button>
  293. </el-input>
  294. </el-form-item>
  295. </template>
  296. </el-table-column>
  297. <el-table-column show-overflow-tooltip label="调入部门" align="center" prop="storageDeptName" width="230px">
  298. <template slot-scope="scope">
  299. <el-form-item class="hang">
  300. <el-input clearable :disabled="sonDisable" size="mini" v-model="scope.row.storageDeptName" @clear="cleanMx(scope.$index, '调入部门')" @focus="chooseMxBM(scope.$index, 'DEPT_PARAM', true, '调入部门', basicForm.storageInventoryOrg)">
  301. <el-button size="mini" :disabled="sonDisable" slot="append" icon="el-icon-more" @click="chooseMxBM(scope.$index, 'DEPT_PARAM', true, '调入部门', basicForm.storageInventoryOrg)"></el-button>
  302. </el-input>
  303. </el-form-item>
  304. </template>
  305. </el-table-column>
  306. <el-table-column show-overflow-tooltip label="调入货位" align="center" prop="storageAllocationName" width="230px">
  307. <template slot-scope="scope">
  308. <el-form-item class="hang">
  309. <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)">
  310. <el-button size="mini" :disabled="sonDisable || isDRCk" slot="append" icon="el-icon-more" @click="chooseMxHW(scope.$index, 'ALLOCATION_PARAM', true, '调入货位', basicForm.storageWarehouse)"></el-button>
  311. </el-input>
  312. </el-form-item>
  313. </template>
  314. </el-table-column>
  315. <el-table-column show-overflow-tooltip label="批次号" align="center" prop="patchNo" width="150px"/>
  316. <el-table-column show-overflow-tooltip label="产品批号" align="center" prop="producBatch" width="230px">
  317. <template slot-scope="scope">
  318. <el-form-item class="hang">
  319. <el-input readonly size="mini" v-model="scope.row.producBatch">
  320. <el-button size="mini" :disabled="sonDisable" slot="append" icon="el-icon-more" @click="chooseBatch(scope.$index)"></el-button>
  321. </el-input>
  322. </el-form-item>
  323. </template>
  324. </el-table-column>
  325. <el-table-column show-overflow-tooltip label="生产日期" align="center" prop="manufactureDate" width="230px">
  326. <template slot-scope="scope">
  327. <el-form-item class="hang">
  328. <el-date-picker
  329. v-model="scope.row.manufactureDate"
  330. :readonly="sonDisable"
  331. type="date"
  332. size="mini"
  333. value-format="yyyy-MM-dd">
  334. </el-date-picker>
  335. </el-form-item>
  336. </template>
  337. </el-table-column>
  338. <el-table-column show-overflow-tooltip label="有效期至/失效日期" align="center" prop="periodEndDate" width="150px"/>
  339. <el-table-column show-overflow-tooltip label="调拨日期" align="center" prop="allotDate" width="230px">
  340. <template slot-scope="scope">
  341. <el-form-item class="hang">
  342. <el-date-picker
  343. ref="findDate"
  344. v-model="scope.row.allotDate"
  345. :readonly="sonDisable"
  346. type="date"
  347. size="mini"
  348. :picker-options="pickerOptionsEnd"
  349. value-format="yyyy-MM-dd">
  350. </el-date-picker>
  351. </el-form-item>
  352. </template>
  353. </el-table-column>
  354. <el-table-column show-overflow-tooltip label="批准文号" align="center" prop="ratifyCode" width="200px"/>
  355. <el-table-column show-overflow-tooltip label="注册证号" align="center" prop="registration" width="200px"/>
  356. <el-table-column show-overflow-tooltip label="商品名" align="center" prop="productCode" width="150px"/>
  357. <el-table-column show-overflow-tooltip label="通用名" align="center" prop="commonCode" width="150px"/>
  358. <el-table-column show-overflow-tooltip label="剂型" align="center" prop="drug"/>
  359. <el-table-column show-overflow-tooltip label="调入调出结算规则明细" align="center" prop="ruleDetail" width="200px"/>
  360. <el-table-column show-overflow-tooltip label="上市许可持有人" align="center" prop="marketingApprovalPersonal" width="200px"/>
  361. <el-table-column show-overflow-tooltip label="生产许可证号/经营许可证号/备案凭证号" align="center" prop="production" width="260px"/>
  362. <el-table-column show-overflow-tooltip label="pi码" align="center" prop="pi">
  363. <template slot-scope="scope">
  364. <el-form-item class="hang">
  365. <el-input :readonly="sonDisable" size="mini" v-model="scope.row.pi"/>
  366. </el-form-item>
  367. </template>
  368. </el-table-column>
  369. <!-- <el-table-column show-overflow-tooltip label="无税金额" align="center" prop="code"/> -->
  370. <!-- <el-table-column show-overflow-tooltip label="备注" align="center" prop="code"/> -->
  371. <el-table-column show-overflow-tooltip label="类别" align="center" prop="classify" width="150px"/>
  372. <el-table-column show-overflow-tooltip label="客户物料码" align="center" prop="customerLogistic" width="150px"/>
  373. <el-table-column show-overflow-tooltip label="客户物料名称" align="center" prop="customerLogisticName" width="150px"/>
  374. <el-table-column
  375. fixed="right"
  376. label="操作"
  377. align="center"
  378. >
  379. <template slot-scope="scope">
  380. <el-button type="text" size="mini" :disabled="sonDisable" @click="delLine(scope.$index, scope.row)">删除</el-button>
  381. </template>
  382. </el-table-column>
  383. </el-table>
  384. </el-tab-pane>
  385. <el-tab-pane label="收发货信息">
  386. <el-table
  387. :data="receiveInfo"
  388. fit
  389. max-height="480"
  390. style="font-size: 12px;"
  391. >
  392. <el-table-column show-overflow-tooltip label="行号" align="center" prop="rowno"/>
  393. <el-table-column show-overflow-tooltip label="调拨出库单号" align="center" prop="deliveryCode" width="150px"/>
  394. <el-table-column show-overflow-tooltip label="调拨入库单号" align="center" prop="storageCode" width="150px"/>
  395. <el-table-column show-overflow-tooltip label="生产厂家/代理人" align="center" prop="manufacturer" width="150px"/>
  396. <el-table-column show-overflow-tooltip label="产地" align="center" prop="originPlace" width="150px"/>
  397. <el-table-column show-overflow-tooltip label="类别" align="center" prop="classify" width="150px"/>
  398. <el-table-column show-overflow-tooltip label="调出仓库" align="center" prop="deliveryWarehouseName" width="150px"/>
  399. <el-table-column show-overflow-tooltip label="调入仓库" align="center" prop="storageWarehouseName" width="150px"/>
  400. <!-- <el-table-column show-overflow-tooltip label="收货利润中心" align="center" prop="code"/>
  401. <el-table-column show-overflow-tooltip label="发货利润中心" align="center" prop="code"/> -->
  402. <el-table-column show-overflow-tooltip label="调入业务员" align="center" prop="businessPersonalName" width="150px"/>
  403. <el-table-column show-overflow-tooltip label="产品批号" align="center" prop="productBatch" width="150px"/>
  404. <el-table-column show-overflow-tooltip label="生产日期" align="center" prop="manufactureDate" width="150px"/>
  405. <el-table-column show-overflow-tooltip label="有效期至/失效日期" align="center" prop="periodEndDate" width="150px"/>
  406. <el-table-column show-overflow-tooltip label="批准文号" align="center" prop="ratifyCode" width="150px"/>
  407. <el-table-column show-overflow-tooltip label="注册证号" align="center" prop="registration" width="150px"/>
  408. <el-table-column show-overflow-tooltip label="商品名" align="center" prop="productCode" width="150px"/>
  409. <el-table-column show-overflow-tooltip label="通用名" align="center" prop="commonCode" width="150px"/>
  410. <el-table-column show-overflow-tooltip label="剂型" align="center" prop="drug" width="150px"/>
  411. <el-table-column show-overflow-tooltip label="收货客户" align="center" prop="customerName" width="150px"/>
  412. <el-table-column show-overflow-tooltip label="收货地址" align="center" prop="addressaddress" width="150px"/>
  413. <el-table-column show-overflow-tooltip label="收货地区" align="center" prop="area" width="150px"/>
  414. <el-table-column show-overflow-tooltip label="收货地点" align="center" prop="place" width="150px"/>
  415. <el-table-column show-overflow-tooltip label="计划发货日期" align="center" prop="deliveryDate" width="150px"/>
  416. <el-table-column show-overflow-tooltip label="计划到货日期" align="center" prop="strageDate" width="150px"/>
  417. <el-table-column show-overflow-tooltip label="运输方式" align="center" prop="transportation" width="150px"/>
  418. <el-table-column show-overflow-tooltip label="备注" align="center" prop="remark" width="150px"/>
  419. <el-table-column show-overflow-tooltip label="客户物料编码" align="center" prop="customerLogistic" width="150px"/>
  420. <el-table-column show-overflow-tooltip label="客户物料名称" align="center" prop="customerLogisticName" width="150px"/>
  421. </el-table>
  422. </el-tab-pane>
  423. <el-tab-pane label="价格费用">
  424. <el-table
  425. :data="priceList"
  426. fit
  427. max-height="480"
  428. style="font-size: 12px;"
  429. >
  430. <el-table-column show-overflow-tooltip label="行号" align="center" prop="rowno"/>
  431. <el-table-column show-overflow-tooltip label="调拨出库单号" align="center" prop="deliveryCode" width="150px"/>
  432. <el-table-column show-overflow-tooltip label="调拨入库单号" align="center" prop="storageCode" width="150px"/>
  433. <el-table-column show-overflow-tooltip label="生产厂家/代理人" align="center" prop="manufacturer" width="150px"/>
  434. <el-table-column show-overflow-tooltip label="产地" align="center" prop="originPlace" width="150px"/>
  435. <el-table-column show-overflow-tooltip label="类别" align="center" prop="classify" width="150px"/>
  436. <!-- <el-table-column show-overflow-tooltip label="税率" align="center" prop="code"/> -->
  437. <!-- <el-table-column show-overflow-tooltip label="无税单价" align="center" prop="code"/> -->
  438. <!-- <el-table-column show-overflow-tooltip label="含税单价" align="center" prop="code"/> -->
  439. <el-table-column show-overflow-tooltip label="产品批号" align="center" prop="productBatch" width="150px"/>
  440. <el-table-column show-overflow-tooltip label="生产日期" align="center" prop="manufactureDate" width="150px"/>
  441. <el-table-column show-overflow-tooltip label="有效期至/失效日期" align="center" prop="periodEndDate" width="150px"/>
  442. <el-table-column show-overflow-tooltip label="批准文号" align="center" prop="ratifyCode" width="150px"/>
  443. <el-table-column show-overflow-tooltip label="注册证号" align="center" prop="registration" width="150px"/>
  444. <el-table-column show-overflow-tooltip label="商品名" align="center" prop="productCode" width="150px"/>
  445. <el-table-column show-overflow-tooltip label="通用名" align="center" prop="commonCode" width="150px"/>
  446. <el-table-column show-overflow-tooltip label="剂型" align="center" prop="drug" width="150px"/>
  447. <!-- <el-table-column show-overflow-tooltip label="询价无税价" align="center" prop="code"/> -->
  448. <!-- <el-table-column show-overflow-tooltip label="询价含税价" align="center" prop="code"/> -->
  449. <!-- <el-table-column show-overflow-tooltip label="税额" align="center" prop="code"/> -->
  450. <!-- <el-table-column show-overflow-tooltip label="加价率" align="center" prop="code"/> -->
  451. <!-- <el-table-column show-overflow-tooltip label="无税金额" align="center" prop="code"/> -->
  452. <!-- <el-table-column show-overflow-tooltip label="价税合计" align="center" prop="code"/> -->
  453. <el-table-column show-overflow-tooltip label="客户物料码" align="center" prop="customerLogistic" width="150px"/>
  454. <el-table-column show-overflow-tooltip label="客户物料名称" align="center" prop="customerLogisticName" width="150px"/>
  455. </el-table>
  456. </el-tab-pane>
  457. <el-tab-pane label="执行结果">
  458. <el-table
  459. :data="resultList"
  460. fit
  461. max-height="480"
  462. style="font-size: 12px;"
  463. >
  464. <el-table-column show-overflow-tooltip label="行号" align="center" prop="rowno"/>
  465. <el-table-column show-overflow-tooltip label="调拨出库单号" align="center" prop="deliveryCode" width="150px"/>
  466. <el-table-column show-overflow-tooltip label="调拨入库单号" align="center" prop="storageCode" width="150px"/>
  467. <el-table-column show-overflow-tooltip label="生产厂家/代理人" align="center" prop="manufacturer" width="150px"/>
  468. <el-table-column show-overflow-tooltip label="产地" align="center" prop="originPlace" width="150px"/>
  469. <el-table-column show-overflow-tooltip label="类别" align="center" prop="classify" width="150px"/>
  470. <el-table-column show-overflow-tooltip label="产品批号" align="center" prop="productBatch" width="150px"/>
  471. <el-table-column show-overflow-tooltip label="生产日期" align="center" prop="manufactureDate" width="150px"/>
  472. <el-table-column show-overflow-tooltip label="有效期至/失效日期" align="center" prop="periodEndDate" width="150px"/>
  473. <el-table-column show-overflow-tooltip label="批准文号" align="center" prop="ratifyCode" width="150px"/>
  474. <el-table-column show-overflow-tooltip label="注册证号" align="center" prop="registration" width="150px"/>
  475. <el-table-column show-overflow-tooltip label="商品名" align="center" prop="productCode" width="150px"/>
  476. <el-table-column show-overflow-tooltip label="通用名" align="center" prop="commonCode" width="150px"/>
  477. <el-table-column show-overflow-tooltip label="剂型" align="center" prop="drug" width="150px"/>
  478. <!-- <el-table-column show-overflow-tooltip label="已调出主数量" align="center" prop="code"/>
  479. <el-table-column show-overflow-tooltip label="已调入主数量" align="center" prop="code"/> -->
  480. <!-- <el-table-column show-overflow-tooltip label="调拨在途主数量" align="center" prop="code"/> -->
  481. <!-- <el-table-column show-overflow-tooltip label="已发货主数量" align="center" prop="code"/> -->
  482. <!-- <el-table-column show-overflow-tooltip label="途损主数量" align="center" prop="code"/> -->
  483. <!-- <el-table-column show-overflow-tooltip label="累计退货主数量" align="center" prop="code"/> -->
  484. <!-- <el-table-column show-overflow-tooltip label="调出与调入已结算主数量" align="center" prop="code"/> -->
  485. <!-- <el-table-column show-overflow-tooltip label="调出与调入已结算金额" align="center" prop="code"/> -->
  486. <el-table-column show-overflow-tooltip label="客户物料码" align="center" prop="customerLogistic" width="150px"/>
  487. <el-table-column show-overflow-tooltip label="客户物料名称" align="center" prop="customerLogisticName" width="150px"/>
  488. </el-table>
  489. </el-tab-pane>
  490. </el-tabs>
  491. <el-divider content-position="left">表尾信息</el-divider>
  492. <el-row :gutter="10">
  493. <el-col :span="1.5">
  494. <el-form-item label="制单人">
  495. <el-input
  496. v-model="basicForm.createByName"
  497. size="mini"
  498. disabled
  499. clearable
  500. style="width: 200px"
  501. />
  502. </el-form-item>
  503. </el-col>
  504. <el-col :span="1.5">
  505. <el-form-item label="制单日期">
  506. <el-input
  507. v-model="basicForm.createTime"
  508. size="mini"
  509. disabled
  510. clearable
  511. style="width: 200px"
  512. />
  513. </el-form-item>
  514. </el-col>
  515. <!-- <el-col :span="1.5">
  516. <el-form-item label="审批人">
  517. <el-input
  518. v-model="basicForm.code"
  519. size="mini"
  520. disabled
  521. clearable
  522. style="width: 200px"
  523. />
  524. </el-form-item>
  525. </el-col>
  526. <el-col :span="1.5">
  527. <el-form-item label="审批日期">
  528. <el-input
  529. v-model="basicForm.code"
  530. size="mini"
  531. disabled
  532. clearable
  533. style="width: 200px"
  534. />
  535. </el-form-item>
  536. </el-col> -->
  537. </el-row>
  538. <el-divider content-position="left">审计信息</el-divider>
  539. <el-row :gutter="10">
  540. <el-col :span="1.5">
  541. <el-form-item label="创建人">
  542. <el-input
  543. v-model="basicForm.createByName"
  544. size="mini"
  545. disabled
  546. clearable
  547. style="width: 200px"
  548. />
  549. </el-form-item>
  550. </el-col>
  551. <el-col :span="1.5">
  552. <el-form-item label="创建时间">
  553. <el-input
  554. v-model="basicForm.createTime"
  555. size="mini"
  556. disabled
  557. clearable
  558. style="width: 200px"
  559. />
  560. </el-form-item>
  561. </el-col>
  562. <el-col :span="1.5">
  563. <el-form-item label="最后修改人">
  564. <el-input
  565. v-model="basicForm.updateByName"
  566. size="mini"
  567. disabled
  568. clearable
  569. style="width: 200px"
  570. />
  571. </el-form-item>
  572. </el-col>
  573. <el-col :span="1.5">
  574. <el-form-item label="最后修改时间">
  575. <el-input
  576. v-model="basicForm.updateTime"
  577. size="mini"
  578. disabled
  579. clearable
  580. style="width: 200px"
  581. />
  582. </el-form-item>
  583. </el-col>
  584. </el-row>
  585. </el-form>
  586. <div class="btn_group">
  587. <el-col :span="1.5">
  588. <el-button style="margin-right: 10px;" type="primary" size="mini" plain @click="copy" v-if="sonPageStu == 'check'">复制</el-button>
  589. </el-col>
  590. <el-col :span="1.5">
  591. <el-button style="margin-right: 10px;" type="danger" size="mini" plain @click="toNC" v-if="sonPageStu == 'check' && row.status == '2'">重传NC</el-button>
  592. </el-col>
  593. <el-col :span="1.5">
  594. <el-button style="margin-right: 10px;" type="primary" size="mini" plain @click="save" v-if="sonPageStu == 'add' || sonPageStu == 'edit'">保存</el-button>
  595. </el-col>
  596. <el-col :span="1.5">
  597. <el-button style="margin-right: 10px;" type="primary" size="mini" plain @click="submit" v-if="sonPageStu == 'check' && (row.status == '0' || row.status == '3')">提交</el-button>
  598. </el-col>
  599. <el-col :span="1.5">
  600. <el-button size="mini" plain @click="back">返回</el-button>
  601. </el-col>
  602. </div>
  603. <Refers ref="refer" @doSubmit="selectionsToInput" :single="true"/>
  604. <TreeRefers ref="tree" @doSubmit="selectionsToInput2" :single="true"/>
  605. <popDialog ref="materialRefer" @doSubmit="selectMaterial" :single="true" />
  606. <batchRefers ref="batchRefer" @doSubmit="selectBatch" :single="true"/>
  607. </div>
  608. </template>
  609. <script>
  610. import {addOrder, getOrderDetail, editOrder, submitOrder, againToNC } from '@/api/purchase/transferOrder.js'
  611. import Refers from '@/components/Refers/refers.vue'
  612. // 用于回显参照框数据
  613. import { getRefer } from '@/api/purchase/basic.js'
  614. import TreeRefers from '@/components/Refers/treeRefer.vue'
  615. // 明细行选择物料参照
  616. import popDialog from '@/components/PopDialog/index.vue'
  617. // 明细行选择批次号
  618. import batchRefers from '@/components/Refers/batchRefer.vue'
  619. export default {
  620. name: 'addOder',
  621. dicts: ['sys_allot_billtype', 'sys_project_group', 'sys_status', 'sys_to_type'],
  622. props: ['pageStu','row', 'disable'],
  623. components: {
  624. Refers,
  625. TreeRefers,
  626. popDialog,
  627. batchRefers
  628. },
  629. model: {
  630. prop: 'isList',
  631. event: 'jugislist'
  632. },
  633. data() {
  634. return {
  635. // 不能直接改变props传来的值
  636. sonPageStu: this.pageStu,
  637. sonDisable: this.disable,
  638. basicForm: {
  639. deliveryInventoryOrg: '',
  640. deliveryInventoryOrgCode: '',
  641. deliveryInventoryOrgName: '',
  642. billType: '',
  643. code: '',
  644. billDate: '',
  645. allotType: '',
  646. deliveryCode: '',
  647. storageCode: '',
  648. storageInventoryOrg: '',
  649. storageInventory: '',
  650. storageInventoryOrgName: '',
  651. businessPersonal: '',
  652. businessPersonalName: '',
  653. deliveryDept: '',
  654. deliveryDeptName: '',
  655. currency: '',
  656. currencyName: '',
  657. rate: 1,
  658. onRouteAffilliation: '',
  659. qty: '',
  660. accountPath: '',
  661. customer: '',
  662. customerName: '',
  663. deliveryWarehouse: '',
  664. deliveryWarehouseCode: '',
  665. deliveryWarehouseName: '',
  666. storageWarehouse: '',
  667. storageWarehouseName: '',
  668. materialProject: '',
  669. liacenter: '',
  670. liacenterName: '',
  671. sourceIdentification: '',
  672. remark:'',
  673. ncCode: '',
  674. isSendWms: '',
  675. status: '0',
  676. tenantId: '',
  677. revision: '',
  678. createByName: '',
  679. updateByName: '',
  680. delFlag: '',
  681. },
  682. referCondition: {
  683. type: '',
  684. isPage: true,
  685. title: '',
  686. // 仓库编码
  687. stordocId: ''
  688. },
  689. referConditionMx: {
  690. orgCode: '',
  691. materialCode: '',
  692. unitCode: '',
  693. warehouseCode: ''
  694. },
  695. options: [{
  696. value: 'Y', label: '是',
  697. }, {
  698. value: 'N', label: '否'
  699. }],
  700. tableIndex: null,
  701. chuOrgOptions: [],
  702. ruOrgOptions:[],
  703. manOptions: [],
  704. deptOptions: [],
  705. currencyOptions: [],
  706. ruHouseOptions: [],
  707. chuHouseOptions: [],
  708. liacenterOptions: [],
  709. basicRules: {},
  710. materialInfo: [],
  711. receiveInfo: [],
  712. priceList: [],
  713. resultList: [],
  714. pickerOptionsEnd: {
  715. disabledDate: (time) => {
  716. let beginDateVal = this.basicForm.billDate;
  717. if (beginDateVal) {
  718. return (
  719. time.getTime() <
  720. new Date(beginDateVal).getTime() - 8.64e7
  721. );
  722. }
  723. }
  724. },
  725. isOrg: true,
  726. isDRCk: true,
  727. isDCCk: true,
  728. }
  729. },
  730. created() {
  731. if(this.pageStu == 'check') {
  732. console.log('数据', this.row)
  733. this.getDetails(this.row)
  734. } else if(this.pageStu == 'edit') {
  735. this.getDetails(this.row)
  736. }
  737. },
  738. methods: {
  739. // 改变单据日期时清空子表的调拨日期
  740. changeBillDate() {
  741. this.materialInfo.forEach(item => {
  742. item.allotDate = null
  743. })
  744. },
  745. // 控制先选调出库存组织和调入库存组织再选调出部门和调入调出仓库
  746. controlCk() {
  747. console.log('进了吗')
  748. if (this.basicForm.deliveryInventoryOrg && this.basicForm.storageInventoryOrg) {
  749. this.isOrg = false
  750. } else {
  751. this.basicForm.deliveryDept = ''
  752. this.basicForm.storageWarehouse = ''
  753. this.basicForm.deliveryWarehouse = ''
  754. this.isOrg = true
  755. // 选择调入库存组织时判断调拨方式
  756. this.basicForm.allotType = ''
  757. }
  758. },
  759. // 控制子表内货位是否可以填写,根据选择仓库内csFlag
  760. controlDCHW() {
  761. console.log("🚀 ~ file: add.vue:735 调出货位")
  762. this.isDCCk = true
  763. this.materialInfo.forEach(item => {
  764. item.deliveryAllocation = null
  765. item.deliveryAllocationName = null
  766. })
  767. },
  768. controlDRHW() {
  769. console.log("🚀 ~ file: add.vue:735 调入货位")
  770. this.isDRCk = true
  771. this.materialInfo.forEach(item => {
  772. item.storageAllocation = null
  773. item.storageAllocationName = null
  774. })
  775. },
  776. // 输入数量或者主数量同步改变
  777. getZSL(scope) {
  778. scope.row.qty = scope.row.mainQty
  779. },
  780. getSL(scope) {
  781. scope.row.mainQty = scope.row.qty
  782. },
  783. copy() {
  784. // await this.getDetails(this.row)
  785. this.$modal.msgSuccess("复制成功");
  786. this.sonPageStu = 'add'
  787. this.sonDisable = false
  788. this.basicForm.id = ''
  789. this.basicForm.code = ''
  790. this.basicForm.createByName = ''
  791. this.basicForm.createBy = ''
  792. this.basicForm.createTime = ''
  793. this.basicForm.isSendWms = ''
  794. this.basicForm.ncCode = ''
  795. this.basicForm.oaId = ''
  796. this.basicForm.updateBy = ''
  797. this.basicForm.updateByName = ''
  798. this.basicForm.updateTime = ''
  799. },
  800. handleData() {
  801. console.log('222')
  802. // 复制新增把id,编码,创建人置为空,子表去掉id
  803. this.basicForm.id = ''
  804. this.basicForm.code = ''
  805. this.basicForm.createBy = ''
  806. this.basicForm.createByName = ''
  807. this.basicForm.createTime = ''
  808. this.basicForm.isSendWms = ''
  809. this.basicForm.ncCode = ''
  810. this.basicForm.oaId = ''
  811. this.basicForm.updateBy = ''
  812. this.basicForm.updateByName = ''
  813. this.basicForm.updateTime = ''
  814. if (this.materialInfo.length !== 0) {
  815. this.materialInfo.forEach(item => {
  816. if (item.allotId) {
  817. delete item.allotId
  818. }
  819. if (item.id) {
  820. delete item.id
  821. }
  822. if (item.createBy) {
  823. delete item.createBy
  824. delete item.createByName
  825. delete item.createTime
  826. }
  827. if (item.updateBy) {
  828. delete item.updateBy
  829. delete item.updateByName
  830. delete item.updateTime
  831. }
  832. })
  833. }
  834. },
  835. toNC() {
  836. againToNC(this.row).then(res => {
  837. this.getDetails(this.row)
  838. }).catch(err => {
  839. this.getDetails(this.row)
  840. })
  841. },
  842. submit() {
  843. this.$modal.loading("提交中...");
  844. this.basicForm.stAllotMaterialList = this.materialInfo
  845. this.basicForm.stAllotReceiveDeliverList = this.receiveInfo
  846. this.basicForm.stAllotReceiveExecuteList = this.priceList
  847. this.basicForm.stAllotReceiveExpenseList = this.resultList
  848. submitOrder(this.basicForm).then(res => {
  849. if (res.code === 200) {
  850. this.$modal.closeLoading();
  851. this.$modal.msgSuccess("提交成功");
  852. this.back()
  853. }
  854. })
  855. },
  856. save() {
  857. if(this.materialInfo.length !== 0) {
  858. if(this.sonPageStu == 'add') {
  859. this.handleData()
  860. this.basicForm.stAllotMaterialList = this.materialInfo
  861. this.basicForm.stAllotReceiveDeliverList = this.receiveInfo
  862. this.basicForm.stAllotReceiveExecuteList = this.priceList
  863. this.basicForm.stAllotReceiveExpenseList = this.resultList
  864. addOrder(this.basicForm).then(res => {
  865. if (res.code === 200) {
  866. this.$modal.msgSuccess("保存成功");
  867. this.$emit('jugislist', true)
  868. let queryParams = {
  869. pageNum: 1,
  870. pageSize: 5
  871. }
  872. this.$emit('refresh', queryParams)
  873. }
  874. })
  875. } else if (this.sonPageStu == 'edit') {
  876. this.basicForm.stAllotMaterialList = this.materialInfo
  877. this.basicForm.stAllotReceiveDeliverList = this.receiveInfo
  878. this.basicForm.stAllotReceiveExecuteList = this.priceList
  879. this.basicForm.stAllotReceiveExpenseList = this.resultList
  880. editOrder(this.basicForm).then(res => {
  881. if (res.code === 200) {
  882. this.$modal.msgSuccess("编辑成功");
  883. this.back()
  884. }
  885. })
  886. }
  887. } else {
  888. this.$modal.msgWarning("明细行不能为空");
  889. }
  890. },
  891. back() {
  892. this.$emit('jugislist', true)
  893. // let queryParams = {
  894. // pageNum: 1,
  895. // pageSize: 5
  896. // }
  897. // this.$emit('refresh', queryParams)
  898. },
  899. // 如果需要回显则调用详情接口
  900. getDetails(row) {
  901. getOrderDetail(row.id).then(res => {
  902. if (res.code === 200) {
  903. this.basicForm = res.data
  904. this.materialInfo = res.data.stAllotMaterialList
  905. this.receiveInfo = res.data.stAllotReceiveDeliverList
  906. this.priceList = res.data.stAllotReceiveExecuteList
  907. this.resultList = res.data.stAllotReceiveExpenseList
  908. if(this.basicForm.deliveryInventoryOrg) { this.reBackRefer('ORG_PARAM', this.basicForm.deliveryInventoryOrg, '调出库存组织') }
  909. if(this.basicForm.storageInventoryOrg) { this.reBackRefer('ORG_PARAM', this.basicForm.storageInventoryOrg, '调入库存组织') }
  910. if(this.basicForm.businessPersonal) { this.reBackRefer('CONTACTS_PARAM', this.basicForm.businessPersonal) }
  911. if(this.basicForm.deliveryDept) { this.reBackRefer('DEPT_PARAM', this.basicForm.deliveryDept) }
  912. if(this.basicForm.currency) { this.reBackRefer('CURRENCY_PARAM', this.basicForm.currency) }
  913. if(this.basicForm.storageWarehouse) { this.reBackRefer('WAREHOUSE_PARAM', this.basicForm.storageWarehouse, '调入仓库') }
  914. if(this.basicForm.deliveryWarehouse) { this.reBackRefer('WAREHOUSE_PARAM', this.basicForm.deliveryWarehouse, '调出仓库') }
  915. if(this.basicForm.liacenter) { this.reBackRefer('LIACENTER_PARAM', this.basicForm.liacenter) }
  916. // 控制先选调出库存组织和调入库存组织再选调出部门和调入调出仓库
  917. this.controlCk()
  918. }
  919. })
  920. },
  921. // 回显参照框
  922. reBackRefer(type, id, title) {
  923. getRefer({ type: type, id: id, title: title }).then(res => {
  924. if (type == 'ORG_PARAM' && title == '调出库存组织') {
  925. this.chuOrgOptions = res.rows
  926. }
  927. if (type == 'ORG_PARAM' && title == '调入库存组织') {
  928. this.ruOrgOptions = res.rows
  929. }
  930. if (type == 'CONTACTS_PARAM') {
  931. this.manOptions = res.rows
  932. }
  933. if (type == 'DEPT_PARAM') {
  934. this.deptOptions = res.rows
  935. }
  936. if (type == 'CURRENCY_PARAM') {
  937. this.currencyOptions = res.rows
  938. }
  939. if (type == 'LIACENTER_PARAM') {
  940. this.liacenterOptions = res.rows
  941. }
  942. if (type == 'WAREHOUSE_PARAM' && title == '调入仓库') {
  943. this.ruHouseOptions = res.rows
  944. }
  945. if (type == 'WAREHOUSE_PARAM' && title == '调出仓库') {
  946. this.chuHouseOptions = res.rows
  947. }
  948. if (type == 'UNIT_PARAM') {
  949. this.materialInfo[this.tableIndex].unitCode = res.rows[0].code
  950. }
  951. })
  952. },
  953. addLine() {
  954. const newLine = {
  955. rowno: null,
  956. demandCode: null,
  957. material: null,
  958. materialCode: null,
  959. materialName: null,
  960. deliveryCode: null,
  961. storageCode: null,
  962. specification: null,
  963. manufacturer: null,
  964. originPlace: null,
  965. originPlaceName: null,
  966. model: null,
  967. unit: null,
  968. unitCode: null,
  969. unitName: null,
  970. deliveryWarehouseName: null,
  971. qty: null,
  972. mainUnit: null,
  973. mainUnitName: null,
  974. equation: '1/1',
  975. mainQty: null,
  976. rate: '0.00',
  977. storageWarehouseName: null,
  978. deliveryAllocationName: null,
  979. deliveryAllocation: null,
  980. storageDept: null,
  981. storageDeptName: null,
  982. storageAllocationName: null,
  983. storageAllocation: null,
  984. patchNo: null,
  985. producBatch: null,
  986. manufactureDate: null,
  987. periodEndDate: null,
  988. allotDate: null,
  989. ratifyCode: null,
  990. registration: null,
  991. productCode: null,
  992. commonCode: null,
  993. drug: null,
  994. ruleDetail: null,
  995. marketingApprovalPersonal: null,
  996. production: null,
  997. pi: null,
  998. classify: null,
  999. customerLogistic: null,
  1000. customerLogisticName: null
  1001. }
  1002. this.materialInfo.push(newLine)
  1003. },
  1004. delLine(index) {
  1005. console.log('删除行:', index)
  1006. this.materialInfo.splice(index, 1)
  1007. },
  1008. chooseRefer(type, isPage, title, pkOrg, isDirectStore, gubFlag) {
  1009. this.referCondition.type = type
  1010. this.referCondition.isPage = isPage
  1011. this.referCondition.title = title
  1012. this.referCondition.pkOrg = pkOrg
  1013. this.referCondition.isDirectStore = isDirectStore
  1014. this.referCondition.gubFlag = gubFlag
  1015. this.$refs.refer.init(this.referCondition)
  1016. },
  1017. selectionsToInput(selection) {
  1018. if (this.referCondition.title == '调出库存组织') {
  1019. this.chuOrgOptions = selection
  1020. this.basicForm.deliveryInventoryOrg = selection[0].id
  1021. this.basicForm.deliveryInventoryOrgCode = selection[0].code
  1022. this.basicForm.deliveryInventoryOrgName = selection[0].name
  1023. // 清空调出仓库,部门
  1024. this.basicForm.deliveryWarehouse = ''
  1025. this.basicForm.deliveryWarehouseCode = ''
  1026. this.basicForm.deliveryWarehouseName = ''
  1027. this.basicForm.deliveryDept = ''
  1028. this.basicForm.deliveryDeptName = ''
  1029. // 选择调入库存组织时判断调拨方式
  1030. if (this.basicForm.storageInventoryOrg == this.basicForm.deliveryInventoryOrg) {
  1031. this.basicForm.allotType = '4'
  1032. } else {
  1033. this.basicForm.allotType = '2'
  1034. }
  1035. }
  1036. if (this.referCondition.title == '调入库存组织') {
  1037. this.ruOrgOptions = selection
  1038. this.basicForm.storageInventoryOrg = selection[0].id
  1039. this.basicForm.storageInventory = selection[0].code
  1040. this.basicForm.storageInventoryOrgName = selection[0].name
  1041. this.basicForm.onRouteAffilliation = selection[0].name
  1042. // 选择调入库存组织清空仓库
  1043. this.basicForm.storageWarehouse = ''
  1044. this.basicForm.storageWarehouseName = ''
  1045. // 选择调入库存组织时判断调拨方式
  1046. if (this.basicForm.storageInventoryOrg == this.basicForm.deliveryInventoryOrg) {
  1047. this.basicForm.allotType = '4'
  1048. } else {
  1049. this.basicForm.allotType = '2'
  1050. }
  1051. }
  1052. if (this.referCondition.title == '调出业务员') {
  1053. this.manOptions = selection
  1054. this.basicForm.businessPersonal = selection[0].code
  1055. this.basicForm.businessPersonalName = selection[0].name
  1056. }
  1057. if (this.referCondition.title == '调出部门') {
  1058. this.deptOptions = selection
  1059. this.basicForm.deliveryDept = selection[0].id
  1060. this.basicForm.deliveryDeptName = selection[0].name
  1061. }
  1062. if (this.referCondition.title == '币种') {
  1063. this.currencyOptions = selection
  1064. this.basicForm.currency = selection[0].id
  1065. this.basicForm.currencyName = selection[0].name
  1066. }
  1067. if (this.referCondition.title == '调入仓库') {
  1068. this.ruHouseOptions = selection
  1069. this.basicForm.storageWarehouse = selection[0].id
  1070. this.basicForm.storageWarehouseName = selection[0].name
  1071. console.log('1111', selection[0].csFlag)
  1072. // 清空调入货位
  1073. this.materialInfo.forEach(item => {
  1074. item.storageAllocation = null
  1075. item.storageAllocationName = null
  1076. })
  1077. if(selection[0].csFlag == 'N') {
  1078. this.isDRCk = true
  1079. } else {
  1080. this.isDRCk = false
  1081. }
  1082. }
  1083. if (this.referCondition.title == '调出仓库') {
  1084. this.chuHouseOptions = selection
  1085. this.basicForm.deliveryWarehouse = selection[0].id
  1086. this.basicForm.deliveryWarehouseCode = selection[0].code
  1087. this.basicForm.deliveryWarehouseName = selection[0].name
  1088. console.log('2222', selection[0].csFlag)
  1089. // 清空调出货位
  1090. this.materialInfo.forEach(item => {
  1091. item.deliveryAllocation = null
  1092. item.deliveryAllocationName = null
  1093. })
  1094. if (selection[0].csFlag == 'N') {
  1095. this.isDCCk = true
  1096. } else {
  1097. this.isDCCk = false
  1098. }
  1099. }
  1100. if (this.referCondition.title == '调出货位') {
  1101. this.materialInfo[this.tableIndex].deliveryAllocationName = selection[0].name
  1102. this.materialInfo[this.tableIndex].deliveryAllocation = selection[0].id
  1103. }
  1104. if (this.referCondition.title == '调入货位') {
  1105. this.materialInfo[this.tableIndex].storageAllocationName = selection[0].name
  1106. this.materialInfo[this.tableIndex].storageAllocation = selection[0].id
  1107. }
  1108. if (this.referCondition.title == '调入部门') {
  1109. this.materialInfo[this.tableIndex].storageDeptName = selection[0].name
  1110. this.materialInfo[this.tableIndex].storageDept = selection[0].id
  1111. }
  1112. // 控制先选调出库存组织和调入库存组织再选调出部门和调入调出仓库
  1113. this.controlCk()
  1114. },
  1115. chooseTreeRefer(type, isPage, title) {
  1116. this.referCondition.type = type
  1117. this.referCondition.isPage = isPage
  1118. this.referCondition.title = title
  1119. this.$refs.tree.init(this.referCondition)
  1120. },
  1121. selectionsToInput2(selection) {
  1122. this.liacenterOptions.push(selection)
  1123. this.basicForm.liacenter = selection.id
  1124. this.basicForm.liacenterName = selection.name
  1125. },
  1126. // 明细行选择物料编码带出数据
  1127. chooseMaterial(index) {
  1128. console.log("🚀 ~ file: add.vue:790 ~ chooseMaterial ~ index:", index)
  1129. this.tableIndex = index
  1130. this.$refs.materialRefer.init()
  1131. },
  1132. selectMaterial(selection) {
  1133. console.log('选中的物料', selection)
  1134. this.materialInfo[this.tableIndex].material = selection[0].id
  1135. this.materialInfo[this.tableIndex].materialCode = selection[0].code
  1136. this.materialInfo[this.tableIndex].materialName = selection[0].name
  1137. this.materialInfo[this.tableIndex].specification = selection[0].specification
  1138. this.materialInfo[this.tableIndex].model = selection[0].model
  1139. this.materialInfo[this.tableIndex].originPlace = selection[0].originPlace
  1140. this.materialInfo[this.tableIndex].originPlaceName = selection[0].originPlaceName
  1141. this.materialInfo[this.tableIndex].unit = selection[0].unitId
  1142. this.materialInfo[this.tableIndex].mainUnit = selection[0].unitId
  1143. this.materialInfo[this.tableIndex].unitName = selection[0].unitIdName
  1144. this.materialInfo[this.tableIndex].mainUnitName = selection[0].unitIdName
  1145. this.materialInfo[this.tableIndex].manufacturer = selection[0].manufacturerIdName
  1146. this.materialInfo[this.tableIndex].marketingApprovalPersonal = selection[0].registrant
  1147. this.materialInfo[this.tableIndex].production = selection[0].productionPermit
  1148. // 根据物料单位id查询单位code
  1149. this.reBackRefer('UNIT_PARAM', selection[0].unitId)
  1150. },
  1151. // 明细行选择批次号
  1152. chooseBatch(index) {
  1153. this.tableIndex = index
  1154. this.referConditionMx.orgCode = this.basicForm.deliveryInventoryOrgCode
  1155. this.referConditionMx.materialCode = this.materialInfo[this.tableIndex].materialCode
  1156. this.referConditionMx.unitCode = this.materialInfo[this.tableIndex].unitCode
  1157. this.referConditionMx.warehouseCode = this.basicForm.deliveryWarehouseCode
  1158. this.$refs.batchRefer.init(this.referConditionMx)
  1159. },
  1160. selectBatch(selection) {
  1161. console.log('选中的批次号', selection)
  1162. },
  1163. // 明细行选择货位
  1164. chooseMxHW(index, type, isPage, title, stordocId) {
  1165. this.tableIndex = index
  1166. this.referCondition.type = type
  1167. this.referCondition.isPage = isPage
  1168. this.referCondition.title = title
  1169. this.referCondition.pkOrg = ''
  1170. this.referCondition.stordocId = stordocId
  1171. this.$refs.refer.init(this.referCondition)
  1172. },
  1173. // 明细行选择调入部门
  1174. chooseMxBM(index, type, isPage, title, pkOrg) {
  1175. this.tableIndex = index
  1176. this.referCondition.type = type
  1177. this.referCondition.isPage = isPage
  1178. this.referCondition.title = title
  1179. this.referCondition.pkOrg = pkOrg
  1180. this.$refs.refer.init(this.referCondition)
  1181. },
  1182. // 选择框彻底清空
  1183. clean(val) {
  1184. if (val == '调出库存组织') {
  1185. this.basicForm.deliveryInventoryOrg = ''
  1186. this.basicForm.deliveryInventoryOrgCode = ''
  1187. this.basicForm.deliveryInventoryOrgName = ''
  1188. }
  1189. if (val == '调入库存组织') {
  1190. this.basicForm.storageInventoryOrg = ''
  1191. this.basicForm.storageInventory = ''
  1192. this.basicForm.storageInventoryOrgName = ''
  1193. }
  1194. if (val == '调出业务员') {
  1195. this.basicForm.businessPersonal = ''
  1196. this.basicForm.businessPersonalName = ''
  1197. }
  1198. if (val == '调入仓库') {
  1199. this.basicForm.storageWarehouse = ''
  1200. this.basicForm.storageWarehouseName = ''
  1201. }
  1202. if (val == '调出仓库') {
  1203. this.basicForm.deliveryWarehouse = ''
  1204. this.basicForm.deliveryWarehouseCode = ''
  1205. this.basicForm.deliveryWarehouseName = ''
  1206. }
  1207. if (val == '利润中心') {
  1208. this.basicForm.liacenter = ''
  1209. this.basicForm.liacenterName = ''
  1210. }
  1211. },
  1212. // 明细选择框清空
  1213. cleanMx(index, val) {
  1214. if (val == '物料编码') {
  1215. this.materialInfo[index].material = ''
  1216. this.materialInfo[index].materialCode = ''
  1217. this.materialInfo[index].materialName = ''
  1218. this.materialInfo[index].specification = ''
  1219. this.materialInfo[index].model = ''
  1220. this.materialInfo[index].originPlace = ''
  1221. this.materialInfo[index].originPlaceName = ''
  1222. this.materialInfo[index].unit = ''
  1223. this.materialInfo[index].mainUnit = ''
  1224. this.materialInfo[index].unitName = ''
  1225. this.materialInfo[index].mainUnitName = ''
  1226. this.materialInfo[index].manufacturer = ''
  1227. this.materialInfo[index].marketingApprovalPersonal = ''
  1228. this.materialInfo[index].production = ''
  1229. this.materialInfo[index].unitCode = ''
  1230. }
  1231. if (val == '调出货位') {
  1232. this.materialInfo[index].deliveryAllocationName = ''
  1233. this.materialInfo[index].deliveryAllocation = ''
  1234. }
  1235. if (val == '调入部门') {
  1236. this.materialInfo[index].storageDeptName = ''
  1237. this.materialInfo[index].storageDept = ''
  1238. }
  1239. if (val == '调入货位') {
  1240. this.materialInfo[index].storageAllocationName = ''
  1241. this.materialInfo[index].storageAllocation = ''
  1242. }
  1243. },
  1244. }
  1245. }
  1246. </script>
  1247. <style lang="scss" scoped>
  1248. .btn_group {
  1249. width: 100%;
  1250. margin: 20px 0;
  1251. display: flex;
  1252. justify-content: center;
  1253. }
  1254. .btn_grooup {
  1255. margin-bottom: 10px;
  1256. display: flex;
  1257. justify-content: flex-end;
  1258. }
  1259. .hang {
  1260. margin: auto;
  1261. }
  1262. .hang ::v-deep .el-form-item__content{
  1263. margin-left: 0px !important;
  1264. }
  1265. </style>