add.vue 49 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063
  1. <template>
  2. <div id="addDemandList">
  3. <span>基本信息</span>
  4. <el-form :model="basicForm" :rules="basicRules" ref="basic" label-width="auto">
  5. <el-row :gutter="10">
  6. <el-col :span="1.5">
  7. <el-form-item label="编码">
  8. <el-input
  9. v-model="basicForm.code"
  10. size="small"
  11. disabled
  12. style="width: 200px"
  13. />
  14. </el-form-item>
  15. </el-col>
  16. <el-col :span="1.5">
  17. <el-form-item label="组织" prop="org" :rules="{ required: true, message: '请选择组织', trigger: 'blur' }">
  18. <el-select clearable size="small" v-model="basicForm.org" :disabled="sonDisable" @focus="chooseOrg('ORG_PARAM', true, '选择组织')" style="width: 200px">
  19. <el-option v-for="item in orgOptions" :key="item.id" :label="item.name" :value="item.id" />
  20. </el-select>
  21. </el-form-item>
  22. </el-col>
  23. <el-col :span="1.5">
  24. <el-form-item label="需求处理方式">
  25. <el-select disabled v-model="basicForm.demandBusinessType" size="small" style="width: 200px">
  26. <el-option v-for="dict in dict.type.sys_processing_mode" :key="dict.value" :label="dict.label" :value="dict.value">
  27. </el-option>
  28. </el-select>
  29. </el-form-item>
  30. </el-col>
  31. <el-col :span="1.5">
  32. <el-form-item label="单据状态">
  33. <el-select disabled v-model="basicForm.status" size="small" style="width: 200px">
  34. <el-option v-for="dict in dict.type.sys_status" :key="dict.value" :label="dict.label" :value="dict.value">
  35. </el-option>
  36. </el-select>
  37. </el-form-item>
  38. </el-col>
  39. <el-col :span="1.5">
  40. <el-form-item label="需求客户" prop="customer" :rules="{ required: true, message: '请选择需求客户', trigger: 'blur' }">
  41. <el-select clearable size="small" v-model="basicForm.customer" :disabled="sonDisable" @clear="cleanCustomer" @focus="chooseOrg('CUSTOMER_PARAM', true, '选择客户')" style="width: 200px">
  42. <el-option v-for="item in customerOptions" :key="item.id" :label="item.name" :value="item.id" />
  43. </el-select>
  44. </el-form-item>
  45. </el-col>
  46. <el-col :span="1.5">
  47. <el-form-item label="需求客户名称">
  48. <el-input disabled v-model="basicForm.customerName" size="small" style="width: 200px"></el-input>
  49. </el-form-item>
  50. </el-col>
  51. <el-col :span="1.5">
  52. <el-form-item label="客户负责人">
  53. <el-input disabled v-model="basicForm.customerPrincipal" size="small" style="width: 200px"></el-input>
  54. </el-form-item>
  55. </el-col>
  56. <el-col :span="1.5">
  57. <el-form-item label="需求人员">
  58. <el-select clearable size="small" v-model="basicForm.demandPersonal" :disabled="sonDisable" @focus="chooseOrg('CONTACTS_PARAM', true, '需求人员')" style="width: 200px">
  59. <el-option v-for="item in personOptions" :key="item.id" :label="item.name" :value="item.code" />
  60. </el-select>
  61. </el-form-item>
  62. </el-col>
  63. <el-col :span="1.5">
  64. <el-form-item label="需求部门">
  65. <el-select clearable v-model="basicForm.demandDept" size="small" :disabled="sonDisable" @focus="chooseOrg('DEPT_PARAM', true, '需求部门')" style="width: 200px">
  66. <el-option
  67. v-for="item in deptOptions"
  68. :key="item.id"
  69. :label="item.name"
  70. :value="item.id">
  71. </el-option>
  72. </el-select>
  73. </el-form-item>
  74. </el-col>
  75. <el-col :span="1.5">
  76. <el-form-item label="需求日期" prop="demandDate" :rules="{ required: true, message: '请选择需求日期', trigger: 'blur' }">
  77. <el-date-picker
  78. v-model="basicForm.demandDate"
  79. :disabled="sonDisable"
  80. clearable
  81. type="date"
  82. value-format="yyyy-MM-dd"
  83. size="small"
  84. style="width: 200px"
  85. >
  86. </el-date-picker>
  87. </el-form-item>
  88. </el-col>
  89. <el-col :span="1.5">
  90. <el-form-item label="单据来源">
  91. <el-select v-model="basicForm.source" disabled size="small" style="width: 200px">
  92. <el-option v-for="dict in dict.type.sys_bill_source" :key="dict.value" :label="dict.label" :value="dict.value">
  93. </el-option>
  94. </el-select>
  95. </el-form-item>
  96. </el-col>
  97. <el-col :span="1.5">
  98. <el-form-item label="业务类型">
  99. <el-select clearable v-model="basicForm.billType" @change="changeBillType" :disabled="sonDisable" size="small" style="width: 200px">
  100. <el-option v-for=" dict in dict.type.sys_business" :key="dict.value" :label="dict.label" :value="dict.value">
  101. </el-option>
  102. </el-select>
  103. </el-form-item>
  104. </el-col>
  105. <el-col :span="1.5">
  106. <el-form-item label="是否客户指定">
  107. <el-select clearable v-model="basicForm.isSpeical" :disabled="sonDisable" size="small" style="width: 200px">
  108. <el-option v-for=" item in options" :key="item.value" :label="item.label" :value="item.value">
  109. </el-option>
  110. </el-select>
  111. </el-form-item>
  112. </el-col>
  113. <!-- <el-col :span="1.5">
  114. <el-form-item label="是否处理需求">
  115. <el-input
  116. v-model="basicForm.isProcess"
  117. size="small"
  118. placeholder=""
  119. clearable
  120. style="width: 200px"
  121. />
  122. </el-form-item>
  123. </el-col> -->
  124. <el-col :span="1.5">
  125. <el-form-item label="备注">
  126. <el-input
  127. v-model.trim="basicForm.remark"
  128. size="small"
  129. :disabled="sonDisable"
  130. clearable
  131. style="width: 200px"
  132. />
  133. </el-form-item>
  134. </el-col>
  135. </el-row>
  136. <span>明细信息</span>
  137. <el-card>
  138. <div class="btn_grooup">
  139. <el-button type="primary" size="small" @click="addLine" v-if="!sonDisable">增行</el-button>
  140. <el-button type="primary" size="small" v-if="!sonDisable">批量调整</el-button>
  141. <el-button type="primary" size="small" v-if="sonPageStu == 'check' || sonPageStu == 'edit'" @click="showReserved">货权预留单</el-button>
  142. </div>
  143. <el-table
  144. :data="basicForm.puDemandItemList"
  145. fit
  146. max-height="300"
  147. @selection-change="handleSelectionChange"
  148. >
  149. <el-table-column show-overflow-tooltip type="selection"/>
  150. <el-table-column show-overflow-tooltip label="序号" type="index" align="center"/>
  151. <el-table-column show-overflow-tooltip label="行状态" align="center" prop="status" :formatter="hangStatus" width="150px"/>
  152. <el-table-column show-overflow-tooltip label="行号" align="center" prop="rowNo" />
  153. <!-- <el-table-column show-overflow-tooltip label="业务部门名称" align="center" width="180px"/> -->
  154. <!-- <el-table-column show-overflow-tooltip label="业务部门" align="center" width="180px"/> -->
  155. <el-table-column show-overflow-tooltip label="需求客户" align="center" prop="demandCustomerName" width="200px"/>
  156. <el-table-column show-overflow-tooltip label="一级品类" align="center" prop="materialClassifyOneName" width="180px">
  157. <template slot-scope="scope">
  158. <el-form-item class="hang">
  159. <el-input readonly size="small" v-model="scope.row.materialClassifyOneName"/>
  160. </el-form-item>
  161. </template>
  162. </el-table-column>
  163. <el-table-column show-overflow-tooltip label="二级品类" align="center" prop="materialClassifyTwoName" width="180px">
  164. <template slot-scope="scope">
  165. <el-form-item class="hang">
  166. <el-input readonly size="small" v-model="scope.row.materialClassifyTwoName"/>
  167. </el-form-item>
  168. </template>
  169. </el-table-column>
  170. <el-table-column show-overflow-tooltip label="三级品类" align="center" prop="materialClassifyThreeName" width="180px">
  171. <template slot-scope="scope">
  172. <el-form-item class="hang">
  173. <el-input readonly size="small" v-model="scope.row.materialClassifyThreeName"/>
  174. </el-form-item>
  175. </template>
  176. </el-table-column>
  177. <el-table-column show-overflow-tooltip label="四级品类" align="center" prop="materialClassifyFourName" width="180px">
  178. <template slot-scope="scope">
  179. <el-form-item class="hang">
  180. <el-input readonly size="small" v-model="scope.row.materialClassifyFourName"/>
  181. </el-form-item>
  182. </template>
  183. </el-table-column>
  184. <el-table-column show-overflow-tooltip label="采购员名称" align="center" prop="buyerName" width="120px"/>
  185. <el-table-column show-overflow-tooltip label="采购员" align="center" prop="buyer"/>
  186. <el-table-column show-overflow-tooltip label="物料编码" align="center" prop="materialCode" width="230px">
  187. <template slot-scope="scope">
  188. <el-form-item class="hang" :prop="'puDemandItemList.' + scope.$index + '.' + 'materialCode'" :rules="{ required: true, message: '请选择物料编码', trigger: 'blur' }">
  189. <el-input clearable :disabled="sonDisable" size="small" v-model="scope.row.materialCode" @focus="chooseMaterial(scope.$index)">
  190. <el-button size="small" :disabled="sonDisable" slot="append" icon="el-icon-more" @click="chooseMaterial(scope.$index)"></el-button>
  191. </el-input>
  192. </el-form-item>
  193. </template>
  194. </el-table-column>
  195. <el-table-column show-overflow-tooltip label="物料名称" align="center" prop="materialName" width="230px" />
  196. <el-table-column show-overflow-tooltip label="规格" align="center" prop="specification" />
  197. <el-table-column show-overflow-tooltip label="型号" align="center" prop="model"/>
  198. <el-table-column show-overflow-tooltip label="单位" align="center" prop="unitName"/>
  199. <el-table-column show-overflow-tooltip label="生产厂家/代理人" align="center" prop="manufacturerName" width="230px"/>
  200. <el-table-column show-overflow-tooltip label="注册人" align="center" prop="registrant" width="150px"/>
  201. <el-table-column show-overflow-tooltip label="采购周期" align="center" prop="puPeriod" width="150px">
  202. <template slot-scope="scope">
  203. <el-form-item class="hang">
  204. <el-input clearable :readonly="sonDisable" size="small" v-model="scope.row.puPeriod"/>
  205. </el-form-item>
  206. </template>
  207. </el-table-column>
  208. <el-table-column show-overflow-tooltip label="有效期" align="center" prop="expiry" width="120px"/>
  209. <el-table-column show-overflow-tooltip label="有效期单位" align="center" prop="expiryUnit" width="120px"/>
  210. <el-table-column show-overflow-tooltip label="最小包装" align="center" prop="minPackage" width="120px"/>
  211. <el-table-column show-overflow-tooltip label="最小订货量" align="center" prop="minOrderQty" width="120px"/>
  212. <el-table-column show-overflow-tooltip label="最小批量" align="center" prop="minBatch" width="120px"/>
  213. <el-table-column show-overflow-tooltip label="安全库存" align="center" prop="safeStock" width="120px">
  214. <template slot-scope="scope">
  215. <el-form-item class="hang">
  216. <el-input clearable :readonly="sonDisable" size="small" v-model="scope.row.safeStock"/>
  217. </el-form-item>
  218. </template>
  219. </el-table-column>
  220. <el-table-column show-overflow-tooltip label="预留比例" align="center" prop="reservedProportion" width="150px">
  221. <template slot-scope="scope">
  222. <el-form-item class="hang">
  223. <el-select clearable :disabled="sonDisable" size="small" v-model="scope.row.reservedProportion" @change="getYLSL(scope)">
  224. <el-option v-for=" dict in dict.type.sys_reserve_ratio" :key="dict.value" :label="dict.label" :value="dict.value">
  225. </el-option>
  226. </el-select>
  227. <!-- <el-input v-model="scope.row.reservedProportion"/> -->
  228. </el-form-item>
  229. </template>
  230. </el-table-column>
  231. <el-table-column show-overflow-tooltip label="预留周期" align="center" prop="reservedPeriod" width="150px">
  232. <template slot-scope="scope">
  233. <el-form-item class="hang">
  234. <el-input clearable :readonly="sonDisable" size="small" v-model="scope.row.reservedPeriod"/>
  235. </el-form-item>
  236. </template>
  237. </el-table-column>
  238. <el-table-column show-overflow-tooltip label="预留数量" align="center" prop="reservedQty" width="150px">
  239. <template slot-scope="scope">
  240. <el-form-item class="hang">
  241. <el-input readonly size="small" v-model="scope.row.reservedQty"/>
  242. </el-form-item>
  243. </template>
  244. </el-table-column>
  245. <el-table-column show-overflow-tooltip label="月均销量" align="center" prop="averageQtyMonth" width="120px"/>
  246. <el-table-column show-overflow-tooltip label="实际(业务)需求量" align="center" prop="qty" width="120px">
  247. <template slot-scope="scope">
  248. <el-form-item class="hang" :prop="'puDemandItemList.' + scope.$index + '.' + 'qty'" :rules="{ required: true, message: '请填写实际(业务)需求量', trigger: 'blur' }">
  249. <el-input clearable :readonly="sonDisable" size="small" v-model="scope.row.qty" @input="getYLSL(scope)"/>
  250. </el-form-item>
  251. </template>
  252. </el-table-column>
  253. <el-table-column show-overflow-tooltip label="需求可用周期" align="center" prop="demandPeriod" width="120px"/>
  254. <el-table-column show-overflow-tooltip label="集团预测分类" align="center" prop="forecastClassify" width="120px"/>
  255. <el-table-column show-overflow-tooltip label="交货日期" align="center" prop="deliveryDate" width="230px">
  256. <template slot-scope="scope">
  257. <el-form-item class="hang" :prop="'puDemandItemList.' + scope.$index + '.' + 'deliveryDate'" :rules="{ required: true, message: '请填写交货日期', trigger: 'blur' }">
  258. <el-date-picker
  259. v-model="scope.row.deliveryDate"
  260. :readonly="sonDisable"
  261. clearable
  262. type="datetime"
  263. size="small"
  264. format="yyyy-MM-dd"
  265. value-format="yyyy-MM-dd HH:mm:ss"
  266. placeholder="选择日期">
  267. </el-date-picker>
  268. </el-form-item>
  269. </template>
  270. </el-table-column>
  271. <el-table-column show-overflow-tooltip label="补单标识" align="center" prop="isReplenishment" width="100px">
  272. <template slot-scope="scope">
  273. <el-form-item class="hang">
  274. <el-switch
  275. v-model="scope.row.isReplenishment"
  276. disabled
  277. active-value="Y"
  278. inactive-value="N"
  279. active-color="#13ce66"
  280. inactive-color="#a1a3a9">
  281. </el-switch>
  282. </el-form-item>
  283. </template>
  284. </el-table-column>
  285. <el-table-column show-overflow-tooltip label="批号锁定标识" align="center" prop="isBatchLock" width="100px">
  286. <template slot-scope="scope">
  287. <el-form-item class="hang">
  288. <el-switch
  289. v-model="scope.row.isBatchLock"
  290. :disabled="sonDisable"
  291. active-value="Y"
  292. inactive-value="N"
  293. active-color="#13ce66"
  294. inactive-color="#a1a3a9">
  295. </el-switch>
  296. </el-form-item>
  297. </template>
  298. </el-table-column>
  299. <el-table-column show-overflow-tooltip label="业务备注" align="center" prop="remark" width="150px">
  300. <template slot-scope="scope">
  301. <el-form-item class="hang">
  302. <el-input clearable :readonly="sonDisable" size="small" v-model="scope.row.remark"/>
  303. </el-form-item>
  304. </template>
  305. </el-table-column>
  306. <el-table-column show-overflow-tooltip label="采购备注" align="center" prop="puRemark" width="150px"/>
  307. <!-- <el-table-column show-overflow-tooltip label="末级供应仓库存量" align="center" prop="lastWarehouseQty" /> -->
  308. <el-table-column show-overflow-tooltip label="调拨占有量" align="center" prop="superiorAllotQty" width="150px"/>
  309. <el-table-column show-overflow-tooltip label="最终净需求量" align="center" prop="resDemandQty" width="150px">
  310. <template slot-scope="scope">
  311. <el-form-item class="hang">
  312. <el-input clearable :readonly="sonDisable" size="small" v-model="scope.row.resDemandQty"/>
  313. </el-form-item>
  314. </template>
  315. </el-table-column>
  316. <el-table-column show-overflow-tooltip label="收货仓库" align="center" prop="deliveryWarehouseName" width="200px">
  317. <template slot-scope="scope">
  318. <el-form-item class="hang">
  319. <el-input clearable :disabled="sonDisable" size="small" v-model="scope.row.deliveryWarehouseName" @clear="clearHang(scope.$index, '选择收货仓库')" @focus="chooseDept(scope.$index, 'WAREHOUSE_PARAM', true, '选择收货仓库')">
  320. <el-button size="small" :disabled="sonDisable" slot="append" icon="el-icon-more" @click="chooseDept(scope.$index, 'WAREHOUSE_PARAM', true, '选择收货仓库')"></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="deliveryAllocationName" width="200px">
  326. <template slot-scope="scope">
  327. <el-form-item class="hang">
  328. <el-input clearable :disabled="sonDisable" size="small" v-model="scope.row.deliveryAllocationName" @clear="clearHang(scope.$index, '选择收货货位')" @focus="choosehuoWei(scope.$index, 'ALLOCATION_PARAM', true, '选择收货货位', scope.row.deliveryWarehouse)">
  329. <el-button size="small" :disabled="sonDisable" slot="append" icon="el-icon-more" @click="choosehuoWei(scope.$index, 'ALLOCATION_PARAM', true, '选择收货货位', scope.row.deliveryWarehouse)"></el-button>
  330. </el-input>
  331. </el-form-item>
  332. </template>
  333. </el-table-column>
  334. <!-- <el-table-column show-overflow-tooltip label="收货货位编码" align="center" prop="deliveryAllocation" width="200px"/> -->
  335. <el-table-column show-overflow-tooltip label="末级供应仓库" align="center" prop="lastWarehouseName" width="200px"/>
  336. <el-table-column show-overflow-tooltip label="末级供应货位" align="center" prop="lastAllocationName" width="200px"/>
  337. <el-table-column show-overflow-tooltip label="紧急标识" align="center" prop="isUrgency" width="100px">
  338. <template slot-scope="scope">
  339. <el-form-item class="hang">
  340. <el-switch
  341. v-model="scope.row.isUrgency"
  342. disabled
  343. active-value="Y"
  344. inactive-value="N"
  345. active-color="#13ce66"
  346. inactive-color="#a1a3a9">
  347. </el-switch>
  348. </el-form-item>
  349. </template>
  350. </el-table-column>
  351. <el-table-column show-overflow-tooltip label="默认采购组织" align="center" prop="purOrgName" width="200px"/>yu
  352. <el-table-column show-overflow-tooltip label="默认采购组织编码" align="center" prop="puOrg" width="200px"/>
  353. <!-- <el-table-column show-overflow-tooltip label="末级供应调拨待入量" align="center" prop="lastStockQty" width="150px"/> -->
  354. <!-- <el-table-column show-overflow-tooltip label="上级供应中心现存量" align="center" prop="superiorCenterQty" width="200px"/> -->
  355. <!-- <el-table-column show-overflow-tooltip label="上级库存被调拨占用量" align="center" prop="superiorAllotQty" width="200px"/> -->
  356. <el-table-column show-overflow-tooltip label="可用量" align="center" prop="availableQty"/>
  357. <el-table-column show-overflow-tooltip label="调拨状态" align="center" prop="statusAllot" width="100px">
  358. <template slot-scope="scope">
  359. <el-form-item class="hang">
  360. <el-switch
  361. v-model="scope.row.statusAllot"
  362. :disabled="sonDisable"
  363. active-value="Y"
  364. inactive-value="N"
  365. active-color="#13ce66"
  366. inactive-color="#a1a3a9">
  367. </el-switch>
  368. </el-form-item>
  369. </template>
  370. </el-table-column>
  371. <el-table-column show-overflow-tooltip label="补单供应商编码" align="center" prop="additionalSupplier" width="200px">
  372. <template slot-scope="scope">
  373. <el-form-item class="hang" :prop="'puDemandItemList.' + scope.$index + '.' + 'additionalSupplier'" :rules="{ required: isBDXQ, message: '请选择补单供应商', trigger: 'blur' }">
  374. <el-input clearable :disabled="sonDisable || BDZT" size="small" v-model="scope.row.additionalSupplier" @clear="clearHang(scope.$index, '选择补单供应商')" @focus="chooseDept(scope.$index, 'SUPPLIER_PARAM', true, '选择补单供应商')">
  375. <el-button size="small" :disabled="sonDisable || BDZT" slot="append" icon="el-icon-more" @click="chooseDept(scope.$index, 'SUPPLIER_PARAM', true, '选择补单供应商')"></el-button>
  376. </el-input>
  377. </el-form-item>
  378. </template>
  379. </el-table-column>
  380. <el-table-column show-overflow-tooltip label="补单供应商名称" align="center" prop="additionalSupplierName" width="200px">
  381. <template slot-scope="scope">
  382. <el-form-item class="hang">
  383. <el-input readonly size="small" v-model="scope.row.additionalSupplierName"/>
  384. </el-form-item>
  385. </template>
  386. </el-table-column>
  387. <!-- <el-table-column show-overflow-tooltip label="周期单位" align="center" prop="periodUnit" width="150px">
  388. <template slot-scope="scope">
  389. <el-form-item class="hang">
  390. <el-select clearable :disabled="sonDisable" size="small" v-model="scope.row.periodUnit">
  391. <el-option v-for=" dict in dict.type.sys_period_unit" :key="dict.value" :label="dict.label" :value="dict.value">
  392. </el-option>
  393. </el-select>
  394. </el-form-item>
  395. </template>
  396. </el-table-column> -->
  397. <el-table-column show-overflow-tooltip label="末级供应库存组织" align="center" prop="superiorStockOrgName" width="200px"></el-table-column>
  398. <el-table-column show-overflow-tooltip label="中心仓可用量" align="center" prop="centralWarehouseQty" width="200px"/>
  399. <el-table-column show-overflow-tooltip label="调拨单号" align="center" prop="allotCode"></el-table-column>
  400. <el-table-column show-overflow-tooltip label="收货地址" align="center" prop="deliveryAddressName" width="200px">
  401. <template slot-scope="scope">
  402. <el-form-item class="hang">
  403. <el-input clearable :disabled="sonDisable" size="small" v-model="scope.row.deliveryAddressName" @clear="clearHang(scope.$index, '选择收货地址')" @focus="chooseDept(scope.$index, 'ADDRESS_PARAM', true, '选择收货地址')">
  404. <el-button size="small" :disabled="sonDisable" slot="append" icon="el-icon-more" @click="chooseDept(scope.$index, 'ADDRESS_PARAM', true, '选择收货地址')"></el-button>
  405. </el-input>
  406. </el-form-item>
  407. </template>
  408. </el-table-column>
  409. <el-table-column show-overflow-tooltip label="收货地址编码" align="center" prop="deliveryAddress" width="200px"></el-table-column>
  410. <el-table-column show-overflow-tooltip label="联系人" align="center" prop="contacts"/>
  411. <el-table-column show-overflow-tooltip label="联系人电话" align="center" prop="contactsPhone" width="200px"/>
  412. <el-table-column show-overflow-tooltip label="详细地址" align="center" prop="address" width="200px"/>
  413. <el-table-column show-overflow-tooltip label="价格类型" align="center" prop="priceType" width="150px">
  414. <template slot-scope="scope">
  415. <el-form-item class="hang" :prop="'puDemandItemList.' + scope.$index + '.' + 'priceType'" :rules="{ required: true, message: '请选择价格类型', trigger: 'blur' }">
  416. <el-select clearable :disabled="sonDisable" size="small" v-model="scope.row.priceType">
  417. <el-option v-for=" dict in dict.type.sys_price_type" :key="dict.value" :label="dict.label" :value="dict.value">
  418. </el-option>
  419. </el-select>
  420. <!-- <el-input v-model="scope.row.periodUnit"/> -->
  421. </el-form-item>
  422. </template>
  423. </el-table-column>
  424. <el-table-column
  425. fixed="right"
  426. label="操作"
  427. align="center"
  428. >
  429. <template slot-scope="scope">
  430. <el-button type="text" size="small" :disabled="sonDisable" @click="delLine(scope.$index, scope.row)">删除</el-button>
  431. </template>
  432. </el-table-column>
  433. </el-table>
  434. </el-card>
  435. </el-form>
  436. <div class="btn_group">
  437. <el-col :span="1.5">
  438. <el-button type="primary" size="small" plain @click="copy" v-if="sonPageStu == 'check'">复制</el-button>
  439. </el-col>
  440. <el-col :span="1.5">
  441. <el-button type="primary" size="small" plain @click="save" v-if="sonPageStu == 'add' || sonPageStu == 'edit'">保存</el-button>
  442. </el-col>
  443. <el-col :span="1.5" style="margin: 0 10px;">
  444. <el-button type="primary" size="small" plain @click="submit" v-if="sonPageStu == 'check' && (row.status == '0' || row.status == '3')">提交</el-button>
  445. </el-col>
  446. <el-col :span="1.5">
  447. <el-button size="small" plain @click="back">返回</el-button>
  448. </el-col>
  449. <Reserved v-if="dialog.config" :isVisible="dialog.config" :info="row" @updateReserved="updateReserved"/>
  450. <Refers ref="refer" @doSubmit="selectionsToInput" :single="true"/>
  451. <popDialog ref="materialRefer" @doSubmit="selectMaterial" :single="true" />
  452. </div>
  453. </div>
  454. </template>
  455. <script>
  456. import Reserved from './reserved.vue'
  457. import Refers from '@/components/Refers/refers.vue'
  458. import {addDemand,getDemandDetail, getDemandSonDetail, editDemand, submitDemand, queryMan } from '@/api/purchase/purchaseDemand.js'
  459. // 用于回显参照框数据
  460. import {getRefer} from '@/api/purchase/basic.js'
  461. // 明细行选择物料参照
  462. import popDialog from '@/components/PopDialog/index.vue'
  463. export default {
  464. name: 'addDemandList',
  465. props: ['pageStu','row', 'disable'],
  466. dicts: ['sys_processing_mode', 'sys_status', 'sys_bill_source', 'sys_business','sys_reserve_ratio', 'sys_period_unit', 'sys_price_type'],
  467. components: {
  468. Reserved,
  469. Refers,
  470. popDialog
  471. },
  472. model: {
  473. prop: 'isList',
  474. event: 'jugislist'
  475. },
  476. data() {
  477. return {
  478. // 不能直接改变props传来的值
  479. sonPageStu: this.pageStu,
  480. sonDisable: this.disable,
  481. // BDZT是补单供应商是否可以编辑条件
  482. BDZT: true,
  483. dialog: {
  484. config: false
  485. },
  486. basicForm: {
  487. code: '',
  488. org: '',
  489. orgName: '',
  490. demandBusinessType: '1',
  491. status: '0',
  492. customer: '',
  493. customerName: '',
  494. customerCode: '',
  495. customerPrincipal: '',
  496. demandPersonal: '',
  497. demandDept: '',
  498. demandDate: '',
  499. source: '4',
  500. billType: '',
  501. isSpeical: '',
  502. isProcess: '',
  503. isMonthleyCalculate: '',
  504. remark: '',
  505. puDemandItemList: []
  506. },
  507. options: [{
  508. value: 'Y', label: '是',
  509. }, {
  510. value: 'N', label: '否'
  511. }],
  512. basicRules: {},
  513. tableList: [],
  514. referCondition: {
  515. type: '',
  516. isPage: true,
  517. title: '',
  518. },
  519. // referCondition: {
  520. // type: '',
  521. // isPage: true,
  522. // title: '',
  523. // },
  524. tableIndex: null,
  525. orgOptions: [],
  526. personOptions: [],
  527. deptOptions: [],
  528. customerOptions: [],
  529. isBDXQ: false,
  530. // 刷新表格数据
  531. refreshData: 0
  532. }
  533. },
  534. created() {
  535. if(this.pageStu == 'check') {
  536. console.log('数据', this.row)
  537. this.getDetails(this.row)
  538. } else if(this.pageStu == 'edit') {
  539. this.getDetails(this.row)
  540. }
  541. },
  542. methods: {
  543. // 更改业务类型调整明细行内补单或紧急标识
  544. changeBillType() {
  545. if (this.basicForm.billType == 'BDXQ' && this.basicForm.puDemandItemList.length != 0) {
  546. this.isBDXQ = true
  547. this.BDZT = false
  548. this.basicForm.puDemandItemList.forEach(item => {item.isReplenishment = 'Y'})
  549. } else {
  550. this.isBDXQ = false
  551. this.BDZT = true
  552. this.basicForm.puDemandItemList.forEach(item => {
  553. item.isReplenishment = 'N'
  554. item.additionalSupplier = null
  555. item.additionalSupplierName = null
  556. })
  557. }
  558. if (this.basicForm.billType == 'JJXQ' && this.basicForm.puDemandItemList.length != 0) {
  559. this.basicForm.puDemandItemList.forEach(item => {item.isUrgency = 'Y'})
  560. } else {
  561. this.basicForm.puDemandItemList.forEach(item => { item.isUrgency = 'N' })
  562. }
  563. },
  564. hangStatus(row) {
  565. switch (row.status) {
  566. case '0':
  567. return '需补货'
  568. case '1':
  569. return '待计划确认'
  570. case '2':
  571. return '计划已确认'
  572. case '3':
  573. return '计划已审核'
  574. case '4':
  575. return '行关闭'
  576. case '5':
  577. return '总供应可满足'
  578. }
  579. },
  580. // 获取预留数量
  581. getYLSL(scope) {
  582. scope.row.reservedQty = scope.row.reservedProportion.replace('%', '') / 100 * scope.row.qty
  583. },
  584. copy() {
  585. this.$modal.msgSuccess("复制成功");
  586. this.sonPageStu = 'add'
  587. this.sonDisable = false
  588. this.getDetails(this.row)
  589. this.basicForm.id = ''
  590. this.basicForm.code = ''
  591. this.basicForm.createBy = ''
  592. },
  593. handleData() {
  594. console.log('222')
  595. // 复制新增把id,编码,创建人置为空,子表去掉id
  596. this.basicForm.id = ''
  597. this.basicForm.code = ''
  598. this.basicForm.createBy = ''
  599. if (this.basicForm.puDemandItemList.length !== 0) {
  600. this.basicForm.puDemandItemList.forEach(item => {
  601. if (item.id) {
  602. delete item.id
  603. }
  604. if (item.demandId) {
  605. delete item.demandId
  606. }
  607. })
  608. }
  609. },
  610. async save() {
  611. if(this.basicForm.puDemandItemList.length !== 0) {
  612. this.$refs['basic'].validate((valid) => {
  613. if(valid) {
  614. if(this.sonPageStu == 'add') {
  615. this.handleData()
  616. addDemand(this.basicForm).then(res => {
  617. console.log(333)
  618. if (res.code === 200) {
  619. this.$modal.msgSuccess("保存成功");
  620. this.back()
  621. }
  622. })
  623. } else if (this.sonPageStu == 'edit') {
  624. editDemand(this.basicForm).then(res => {
  625. if (res.code === 200) {
  626. this.$modal.msgSuccess("编辑成功");
  627. this.back()
  628. }
  629. })
  630. }
  631. }
  632. })
  633. } else {
  634. this.$modal.msgWarning("明细信息不能为空!");
  635. }
  636. },
  637. submit() {
  638. submitDemand(this.basicForm).then(res => {
  639. if (res.code === 200) {
  640. this.$modal.msgSuccess("提交成功");
  641. this.back()
  642. }
  643. })
  644. },
  645. // 增行
  646. addLine() {
  647. const newLine = {
  648. contacts: null,
  649. id: null,
  650. demandId: null,
  651. status: null,
  652. businessDept: null,
  653. businessDeptName: null,
  654. materialCategory: null,
  655. buyer: null,
  656. buyerName: null,
  657. mateiralClassifyOne: null,
  658. materialClassifyOneName: null,
  659. materialClassifyTwo: null,
  660. materialClassifyTwoName: null,
  661. materialClassifyThree: null,
  662. materialClassifyThreeName: null,
  663. materialClassifyFour: null,
  664. materialClassifyFourName: null,
  665. materialCode: null,
  666. material: null,
  667. materialName: null,
  668. classifyId: null,
  669. specification: null,
  670. unit: null,
  671. unitName: null,
  672. manufacturerName: null,
  673. registrant: null,
  674. puPeriod: null,
  675. expiryUnit: null,
  676. expiry: null,
  677. minPackage: null,
  678. minOrderQty: null,
  679. minBatch: null,
  680. safeStock: null,
  681. averageQtyMonth: null,
  682. qty: null,
  683. adjustmentPersonal: null,
  684. adjustmentTime: null,
  685. manualRegulation: null,
  686. updateCause: null,
  687. reservedProportion: null,
  688. reservedPeriod: null,
  689. reservedQty: null,
  690. demandPeriod: null,
  691. forecastClassify: null,
  692. deliveryDate: null,
  693. isUrgency: this.basicForm.billType == 'JJXQ' ? 'Y' : 'N',
  694. isReplenishment: this.basicForm.billType == 'BDXQ'? 'Y': 'N',
  695. isBatchLock: 'N',
  696. remark: null,
  697. puRemark: null,
  698. lastWarehouseQty: null,
  699. resDemandQty: null,
  700. lastWarehouse: null,
  701. lastWarehouseName: null,
  702. deliveryWarehouse: null,
  703. deliveryWarehouseName: null,
  704. lastAllocation: null,
  705. lastAllocationName: null,
  706. deliveryAllocation: null,
  707. deliveryAllocationName: null,
  708. passageOn: null,
  709. puOrg: null,
  710. purOrgName: null,
  711. lastStockQty: null,
  712. superiorCenterQty: null,
  713. superiorAllotQty: null,
  714. availableQty: null,
  715. statusAllot: 'N',
  716. additionalSupplier: null,
  717. additionalSupplierName: null,
  718. periodUnit: null,
  719. demandCustomer: this.basicForm.customer,
  720. demandCustomerName: this.basicForm.customerName,
  721. businessDept: this.basicForm.demandDept,
  722. businessDeptName: null,
  723. lastStockOrg: null,
  724. lastStockOrgName: null,
  725. superiorStockOrg: null,
  726. superiorStockOrgName: null,
  727. allotCode: null,
  728. deliveryAddress: null,
  729. deliveryAddressName: null,
  730. contacts: null,
  731. contactsPhone: null,
  732. address: null,
  733. source: null,
  734. priceType: 'order',
  735. puManagerApprover: null,
  736. puManagerApproverName: null,
  737. processTime: null,
  738. affirmer: null,
  739. tenantId: null,
  740. revision: null,
  741. createBy: null,
  742. createByName: null,
  743. createTime: null,
  744. updateBy: null,
  745. updateByName: null,
  746. updateTime: null,
  747. delFlag: 0,
  748. // 新增字段
  749. model: null,
  750. storageCondition: null,
  751. transportationCondition: null,
  752. }
  753. this.basicForm.puDemandItemList.push(newLine)
  754. // 补单需求状态改变
  755. if (this.basicForm.billType == 'BDXQ') {
  756. this.BDZT = false
  757. } else {
  758. this.BDZT = true
  759. }
  760. },
  761. delLine(index) {
  762. console.log('删除行:', index)
  763. // this.basicForm.puDemandItemList = this.basicForm.puDemandItemList.filter(item => {
  764. // return item.id !== row.id
  765. // })
  766. this.basicForm.puDemandItemList.splice(index,1)
  767. },
  768. back() {
  769. this.$emit('jugislist', true)
  770. let queryParams = {
  771. pageNum: 1,
  772. pageSize: 10
  773. }
  774. this.$emit('refresh', queryParams)
  775. },
  776. // 如果需要回显则调用详情接口
  777. getDetails(row) {
  778. getDemandDetail(row.id).then(res => {
  779. if (res.code === 200) {
  780. // this.basicForm = res.data
  781. let reciveForm = res.data
  782. let params = {...{id: row.id}, ...{pageNum:1, pageSize: 10}}
  783. getDemandSonDetail(params).then(res => {
  784. if (res.code === 200) {
  785. reciveForm.puDemandItemList = res.data
  786. console.log('reciveForm',reciveForm)
  787. this.basicForm = reciveForm
  788. if(this.basicForm.org) { this.reBackRefer('ORG_PARAM', this.basicForm.org) }
  789. if(this.basicForm.customer) { this.reBackRefer('CUSTOMER_PARAM', this.basicForm.customer) }
  790. if(this.basicForm.demandPersonal) { this.reBackRefer('CONTACTS_PARAM', this.basicForm.demandPersonal) }
  791. if(this.basicForm.demandDept) { this.reBackRefer('DEPT_PARAM', this.basicForm.demandDept) }
  792. // 详情时将收货仓库id赋值给stordocId
  793. // 如果业务类型为补单需求,则明细内补单供应商编码可以编辑
  794. if(this.basicForm.billType == 'BDXQ') {
  795. this.BDZT = false
  796. this.isBDXQ = true
  797. } else {
  798. this.BDZT = true
  799. this.isBDXQ = false
  800. }
  801. }
  802. })
  803. }
  804. })
  805. },
  806. handleSelectionChange() {},
  807. // 点击预留单展示
  808. showReserved() {
  809. this.dialog.config = true
  810. },
  811. // 修改是否让页面显示与隐藏的事件
  812. updateReserved (val) {
  813. this.dialog.config = val
  814. },
  815. // 回显参照框
  816. reBackRefer(type, id) {
  817. getRefer({type: type, id: id}).then(res => {
  818. if(type == 'ORG_PARAM') {
  819. this.orgOptions = res.rows
  820. }
  821. if (type == 'CUSTOMER_PARAM') {
  822. this.customerOptions = res.rows
  823. }
  824. if (type == 'CONTACTS_PARAM') {
  825. this.personOptions = res.rows
  826. }
  827. if (type == 'DEPT_PARAM') {
  828. this.deptOptions = res.rows
  829. }
  830. })
  831. },
  832. chooseOrg(type, isPage, title) {
  833. this.referCondition.type = type
  834. this.referCondition.isPage = isPage
  835. this.referCondition.title = title
  836. this.$refs.refer.init(this.referCondition)
  837. },
  838. selectionsToInput(selection) {
  839. if(this.referCondition.type == 'ORG_PARAM' && this.referCondition.title == '选择组织') {
  840. this.orgOptions = selection
  841. this.basicForm.org = selection[0].id
  842. this.basicForm.orgName = selection[0].name
  843. }
  844. if(this.referCondition.type == 'CUSTOMER_PARAM' && this.referCondition.title == '选择客户') {
  845. this.customerOptions = selection
  846. this.basicForm.customer = selection[0].id
  847. this.basicForm.customerName = selection[0].name
  848. this.basicForm.customerCode = selection[0].code
  849. if(this.basicForm.puDemandItemList.length !== 0) {
  850. this.basicForm.puDemandItemList.forEach(item => {
  851. item.demandCustomerName = this.basicForm.customerName
  852. item.demandCustomer = this.basicForm.customer
  853. })
  854. }
  855. }
  856. if(this.referCondition.type == 'CONTACTS_PARAM') {
  857. this.personOptions = selection
  858. this.basicForm.demandPersonal = selection[0].code
  859. }
  860. if(this.referCondition.type == 'DEPT_PARAM') {
  861. this.deptOptions = selection
  862. this.basicForm.demandDept = selection[0].id
  863. }
  864. // if(this.referCondition.type == 'DEPT_PARAM') {
  865. // this.basicForm.puDemandItemList[this.tableIndex].businessDept = selection[0].code
  866. // this.basicForm.puDemandItemList[this.tableIndex].businessDeptName = selection[0].name
  867. // }
  868. if(this.referCondition.title == '选择收货仓库') {
  869. this.basicForm.puDemandItemList[this.tableIndex].deliveryWarehouse = selection[0].id
  870. this.basicForm.puDemandItemList[this.tableIndex].deliveryWarehouseName = selection[0].name
  871. this.basicForm.puDemandItemList[this.tableIndex].deliveryAllocation = null
  872. this.basicForm.puDemandItemList[this.tableIndex].deliveryAllocationName = null
  873. }
  874. if(this.referCondition.title == '选择收货货位') {
  875. this.basicForm.puDemandItemList[this.tableIndex].deliveryAllocation = selection[0].id
  876. this.basicForm.puDemandItemList[this.tableIndex].deliveryAllocationName = selection[0].name
  877. }
  878. if(this.referCondition.title == '选择补单供应商') {
  879. this.basicForm.puDemandItemList[this.tableIndex].additionalSupplier = selection[0].code
  880. this.basicForm.puDemandItemList[this.tableIndex].additionalSupplierName = selection[0].name
  881. }
  882. if(this.referCondition.title == '选择收货地址') {
  883. this.basicForm.puDemandItemList[this.tableIndex].deliveryAddressName = selection[0].name
  884. this.basicForm.puDemandItemList[this.tableIndex].deliveryAddress = selection[0].code
  885. this.basicForm.puDemandItemList[this.tableIndex].contacts = selection[0].contactsName
  886. this.basicForm.puDemandItemList[this.tableIndex].contactsPhone = selection[0].contactsPhone
  887. this.basicForm.puDemandItemList[this.tableIndex].address = selection[0].address
  888. }
  889. },
  890. // 明细行选择物料编码带出数据
  891. chooseMaterial(index) {
  892. console.log("🚀 ~ file: add.vue:790 ~ chooseMaterial ~ index:", index)
  893. this.tableIndex = index
  894. // 传0只展示同步NC了的物料
  895. this.$refs.materialRefer.init(0)
  896. },
  897. selectMaterial(selection) {
  898. console.log('选中的物料', selection)
  899. // 选择新物料时先清空行内其他信息
  900. this.basicForm.puDemandItemList[this.tableIndex].reservedProportion = null
  901. this.basicForm.puDemandItemList[this.tableIndex].reservedPeriod = null
  902. this.basicForm.puDemandItemList[this.tableIndex].reservedQty = null
  903. this.basicForm.puDemandItemList[this.tableIndex].qty = null
  904. this.basicForm.puDemandItemList[this.tableIndex].deliveryDate = null
  905. this.basicForm.puDemandItemList[this.tableIndex].remark = null
  906. this.basicForm.puDemandItemList[this.tableIndex].resDemandQty = null
  907. this.basicForm.puDemandItemList[this.tableIndex].deliveryWarehouse = null
  908. this.basicForm.puDemandItemList[this.tableIndex].deliveryWarehouseName = null
  909. this.basicForm.puDemandItemList[this.tableIndex].deliveryAllocation = null
  910. this.basicForm.puDemandItemList[this.tableIndex].deliveryAllocationName = null
  911. this.basicForm.puDemandItemList[this.tableIndex].additionalSupplier = null
  912. this.basicForm.puDemandItemList[this.tableIndex].additionalSupplierName = null
  913. this.basicForm.puDemandItemList[this.tableIndex].periodUnit = null
  914. this.basicForm.puDemandItemList[this.tableIndex].deliveryAddressName = null
  915. this.basicForm.puDemandItemList[this.tableIndex].deliveryAddress = null
  916. this.basicForm.puDemandItemList[this.tableIndex].contacts = null
  917. this.basicForm.puDemandItemList[this.tableIndex].contactsPhone = null
  918. this.basicForm.puDemandItemList[this.tableIndex].address = null
  919. this.basicForm.puDemandItemList[this.tableIndex].priceType = 'order'
  920. this.basicForm.puDemandItemList[this.tableIndex].lastWarehouseName = null
  921. this.basicForm.puDemandItemList[this.tableIndex].lastWarehouse = null
  922. this.basicForm.puDemandItemList[this.tableIndex].lastAllocation = null
  923. this.basicForm.puDemandItemList[this.tableIndex].lastAllocationName = null
  924. // 通过选择物料查询采购员
  925. queryMan(selection[0].id).then(res => {
  926. if(res.code === 200 && res.rows.length !== 0) {
  927. this.basicForm.puDemandItemList[this.tableIndex].buyer = res.rows[0].buyer
  928. this.basicForm.puDemandItemList[this.tableIndex].buyerName = res.rows[0].buyerName
  929. }
  930. })
  931. this.basicForm.puDemandItemList[this.tableIndex].businessDept = selection[0].businessDepartment
  932. this.basicForm.puDemandItemList[this.tableIndex].businessDeptName = selection[0].businessDepartmentName
  933. this.basicForm.puDemandItemList[this.tableIndex].materialCode = selection[0].code
  934. this.basicForm.puDemandItemList[this.tableIndex].material = selection[0].id
  935. this.basicForm.puDemandItemList[this.tableIndex].materialName = selection[0].name
  936. this.basicForm.puDemandItemList[this.tableIndex].classifyId = selection[0].classifyId
  937. this.basicForm.puDemandItemList[this.tableIndex].materialClassifyOneName = selection[0].oneClass
  938. this.basicForm.puDemandItemList[this.tableIndex].materialClassifyTwoName = selection[0].twoClass
  939. this.basicForm.puDemandItemList[this.tableIndex].materialClassifyThreeName = selection[0].threeClass
  940. this.basicForm.puDemandItemList[this.tableIndex].materialClassifyFourName = selection[0].fourClass
  941. this.basicForm.puDemandItemList[this.tableIndex].specification = selection[0].specification
  942. this.basicForm.puDemandItemList[this.tableIndex].model = selection[0].model
  943. this.basicForm.puDemandItemList[this.tableIndex].unit = selection[0].unitId
  944. this.basicForm.puDemandItemList[this.tableIndex].unitName = selection[0].unitIdName
  945. this.basicForm.puDemandItemList[this.tableIndex].registrant = selection[0].registrant
  946. this.basicForm.puDemandItemList[this.tableIndex].manufacturerName = selection[0].manufacturerIdName
  947. this.basicForm.puDemandItemList[this.tableIndex].puPeriod = selection[0].deliveryPeriod
  948. this.basicForm.puDemandItemList[this.tableIndex].expiry = selection[0].usefulLife
  949. this.basicForm.puDemandItemList[this.tableIndex].expiryUnit = selection[0].expiryUnitIdName
  950. // this.basicForm.puDemandItemList[this.tableIndex].minPackage = selection[0].usefulLife
  951. this.basicForm.puDemandItemList[this.tableIndex].minPackage = selection[0].minPackQty
  952. this.basicForm.puDemandItemList[this.tableIndex].minOrderQty = selection[0].minOrderQty
  953. this.basicForm.puDemandItemList[this.tableIndex].minBatch = selection[0].minBatchQty
  954. this.basicForm.puDemandItemList[this.tableIndex].safeStock = selection[0].safeStock
  955. this.basicForm.puDemandItemList[this.tableIndex].purOrgName = selection[0].purchasingOrganizationName
  956. this.basicForm.puDemandItemList[this.tableIndex].puOrg = selection[0].purchasingOrganization
  957. // 物料存储条件和运输条件
  958. this.basicForm.puDemandItemList[this.tableIndex].transportationCondition = selection[0].transportationCondition
  959. this.basicForm.puDemandItemList[this.tableIndex].storageCondition = selection[0].storageCondition
  960. },
  961. // 明细行选择业务部门参照带出业务部门数据
  962. chooseDept(index, type, isPage, title) {
  963. this.tableIndex = index
  964. this.referCondition.type = type
  965. this.referCondition.isPage = isPage
  966. this.referCondition.title = title
  967. this.$refs.refer.init(this.referCondition)
  968. },
  969. // 明细行选择业务部门参照带出业务部门数据
  970. choosehuoWei(index, type, isPage, title, stordocId) {
  971. this.tableIndex = index
  972. this.referCondition.type = type
  973. this.referCondition.isPage = isPage
  974. this.referCondition.title = title
  975. // 选择收货货位前先选择收货仓库
  976. if(stordocId) {
  977. this.referCondition.stordocId = stordocId
  978. this.$refs.refer.init(this.referCondition)
  979. } else {
  980. this.$modal.msgWarning("请先选择收货仓库");
  981. }
  982. },
  983. // 明细行清空收货仓库,货位,收货地址档案等
  984. clearHang(index, title) {
  985. if (title == '选择收货仓库') {
  986. this.basicForm.puDemandItemList[index].deliveryWarehouseName = null
  987. this.basicForm.puDemandItemList[index].deliveryWarehouse = null
  988. this.basicForm.puDemandItemList[index].deliveryAllocationName = null
  989. this.basicForm.puDemandItemList[index].deliveryAllocation = null
  990. }
  991. if (title == '选择收货货位') {
  992. this.basicForm.puDemandItemList[index].deliveryAllocationName = null
  993. this.basicForm.puDemandItemList[index].deliveryAllocation = null
  994. }
  995. if (title == '选择收货地址') {
  996. this.basicForm.puDemandItemList[index].deliveryAddressName = null
  997. this.basicForm.puDemandItemList[index].deliveryAddress = null
  998. this.basicForm.puDemandItemList[index].contacts = null
  999. this.basicForm.puDemandItemList[index].contactsPhone = null
  1000. this.basicForm.puDemandItemList[index].address = null
  1001. }
  1002. if (title == '选择补单供应商') {
  1003. this.basicForm.puDemandItemList[index].additionalSupplierName = null
  1004. this.basicForm.puDemandItemList[index].additionalSupplier = null
  1005. }
  1006. },
  1007. // 清除需求客户将明细行内也清空
  1008. cleanCustomer() {
  1009. this.basicForm.customer = ''
  1010. this.basicForm.customerName = ''
  1011. if (this.basicForm.puDemandItemList.length !== 0) {
  1012. this.basicForm.puDemandItemList.forEach(item => {
  1013. item.demandCustomerName = ''
  1014. item.demandCustomer = ''
  1015. })
  1016. }
  1017. },
  1018. }
  1019. }
  1020. </script>
  1021. <style lang="scss" scoped>
  1022. .btn_group {
  1023. width: 100%;
  1024. margin: 20px 0;
  1025. display: flex;
  1026. justify-content: center;
  1027. }
  1028. .btn_grooup {
  1029. margin-bottom: 10px;
  1030. display: flex;
  1031. justify-content: flex-end;
  1032. }
  1033. .hang {
  1034. margin: auto;
  1035. }
  1036. .hang ::v-deep .el-form-item__content{
  1037. margin-left: 0px !important;
  1038. }
  1039. </style>