inventoryTable.vue 65 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152
  1. <template>
  2. <el-form ref="form" :model="form" :rules="rules">
  3. <ele-pro-table
  4. ref="table"
  5. :needPage="false"
  6. :columns="columns"
  7. :datasource="form.datasource"
  8. class="time-form"
  9. height="300"
  10. full-height="calc(100vh - 76px)"
  11. @columns-change="handleColumnChange"
  12. :cache-key="cacheKeyUrl"
  13. :selection.sync="selection"
  14. >
  15. <!-- 表头工具栏 -->
  16. <template v-slot:toolbar>
  17. <div class="headbox">
  18. <div>
  19. <el-button
  20. size="small"
  21. type="primary"
  22. icon="el-icon-plus"
  23. class="ele-btn-icon"
  24. @click="handParent('', -1)"
  25. >
  26. 新增
  27. </el-button>
  28. <el-button
  29. size="small"
  30. type="primary"
  31. icon="el-icon-plus"
  32. class="ele-btn-icon"
  33. v-if="isGoods"
  34. @click="handGoods(-1)"
  35. >
  36. 选择商品
  37. </el-button>
  38. <el-button
  39. size="small"
  40. type="primary"
  41. icon="el-icon-plus"
  42. class="ele-btn-icon"
  43. v-if="isTemporary"
  44. @click="handlAdd"
  45. >
  46. 新增临时产品
  47. </el-button>
  48. <el-button
  49. size="small"
  50. type="primary"
  51. class="ele-btn-icon"
  52. @click="save"
  53. v-if="isDrawer"
  54. >
  55. 保存
  56. </el-button>
  57. <setAllValue
  58. :disabled="!selection.length"
  59. title="客户期望交期"
  60. @success="setAllValueChange"
  61. valueKey="customerExpectDeliveryDeadline"
  62. />
  63. <setAllValue
  64. :disabled="!selection.length"
  65. title="生产交付交期"
  66. valueKey="produceDeliveryDeadline"
  67. @success="setAllValueChange"
  68. />
  69. </div>
  70. <div class="pricebox">
  71. <span class="amount">总计:{{ allPrice }}元</span>
  72. <el-form-item
  73. style="width: 300px"
  74. v-if="isDiscountTotalPrice"
  75. label="优惠后总金额:"
  76. prop="discountTotalPrice"
  77. :rules="{
  78. required: true,
  79. message: '请输入优惠后总金额',
  80. trigger: 'change'
  81. }"
  82. >
  83. <el-input
  84. type="number"
  85. :min="0"
  86. :max="allPrice"
  87. :disabled="!allPrice"
  88. v-model="form.discountTotalPrice"
  89. style="width: 180px"
  90. placeholder="请输入"
  91. @input="discountInputByOrder(form.discountTotalPrice)"
  92. >
  93. <template slot="append">元</template>
  94. </el-input>
  95. </el-form-item>
  96. </div>
  97. </div>
  98. </template>
  99. <template v-slot:productName="{ row, $index }">
  100. <el-form-item
  101. :prop="'datasource.' + $index + '.productName'"
  102. :rules="{
  103. required: true,
  104. message: '请输入',
  105. trigger: 'change'
  106. }"
  107. >
  108. <el-input
  109. :disabled="!!row.productCode"
  110. v-model="row.productName"
  111. placeholder="请输入"
  112. style="width: 60%; margin-right: 10px"
  113. ></el-input>
  114. <el-button
  115. size="small"
  116. type="primary"
  117. @click.native="handParent(row, $index)"
  118. >选择
  119. </el-button>
  120. </el-form-item>
  121. </template>
  122. <template v-slot:entrustedEnterpriseId="scope">
  123. <el-form-item prop="entrustedEnterpriseId">
  124. <el-select
  125. v-model="scope.row['entrustedEnterpriseId']"
  126. clearable
  127. filterable
  128. >
  129. <el-option
  130. v-for="i in scope.row.entrustedEnterpriseIdList"
  131. :key="i.id"
  132. :value="i.id"
  133. :label="i.name"
  134. ></el-option>
  135. </el-select>
  136. </el-form-item>
  137. </template>
  138. <template v-slot:headerCustomerMark="{ column }">
  139. <span :class="isCustomerMark ? 'is-required' : ''">{{
  140. column.label
  141. }}</span>
  142. </template>
  143. <template v-slot:customerMark="{ row, $index }">
  144. <el-form-item
  145. :prop="'datasource.' + $index + '.customerMark'"
  146. :rules="{
  147. required: isCustomerMark ? true : false,
  148. message: '请输入客户代号',
  149. trigger: 'change'
  150. }"
  151. >
  152. <el-input v-model="row.customerMark" placeholder="请输入"></el-input>
  153. </el-form-item>
  154. </template>
  155. <!-- <template v-slot:headerSupplierMark="{ column }">
  156. <span :class="isSupplierMark ? 'is-required' : ''">{{
  157. column.label
  158. }}</span>
  159. </template>
  160. <template v-slot:supplierMark="{ row, $index }">
  161. <el-form-item
  162. :prop="'datasource.' + $index + '.supplierMark'"
  163. :rules="{
  164. required: isSupplierMark ? true : false,
  165. message: '请输入',
  166. trigger: 'change'
  167. }"
  168. >
  169. <el-input v-model="row.supplierMark" placeholder="请输入"></el-input>
  170. </el-form-item>
  171. </template> -->
  172. <template v-slot:headerProductName="{ column }">
  173. <span class="is-required">{{ column.label }}</span>
  174. </template>
  175. <template v-slot:productCode="scope">
  176. <el-form-item :prop="'datasource.' + scope.$index + '.productCode'">
  177. <el-input v-model="scope.row.productCode" :disabled="true"></el-input>
  178. </el-form-item>
  179. </template>
  180. <template v-slot:productCategoryName="scope">
  181. <el-form-item
  182. :prop="'datasource.' + scope.$index + '.productCategoryName'"
  183. >
  184. <el-input v-model="scope.row.productCategoryName" disabled></el-input>
  185. </el-form-item>
  186. </template>
  187. <!-- <template v-slot:totalCount="scope">
  188. <el-form-item
  189. :prop="'datasource.' + scope.$index + '.totalCount'"
  190. :rules="{
  191. required: isTotalCount ? true : false,
  192. message: '请输入数量',
  193. trigger: 'change'
  194. }"
  195. >
  196. <el-input
  197. v-model="scope.row.totalCount"
  198. type="number"
  199. placeholder="请输入"
  200. @input="changeCount(scope.row, scope.$index)"
  201. ></el-input>
  202. </el-form-item>
  203. </template> -->
  204. <template v-slot:headerTotalCount="{ column }">
  205. <span :class="{ 'is-required': isTotalCount }">{{ column.label }}</span>
  206. </template>
  207. <template v-slot:totalPrice="scope">
  208. <el-form-item :prop="'datasource.' + scope.$index + '.totalPrice'">
  209. {{ (Number(scope.row.totalPrice) || 0).toFixed(2) }}元
  210. </el-form-item>
  211. </template>
  212. <template v-slot:productBrand="scope">
  213. <el-form-item :prop="'datasource.' + scope.$index + '.productBrand'">
  214. <el-input
  215. v-model="scope.row.productBrand"
  216. :disabled="!!scope.row.productCode"
  217. ></el-input>
  218. </el-form-item>
  219. </template>
  220. <template v-slot:modelType="scope">
  221. <el-form-item :prop="'datasource.' + scope.$index + '.modelType'">
  222. <el-input
  223. v-model="scope.row.modelType"
  224. :disabled="!!scope.row.productCode"
  225. ></el-input>
  226. </el-form-item>
  227. </template>
  228. <template v-slot:specification="scope">
  229. <el-form-item :prop="'datasource.' + scope.$index + '.specification'">
  230. <el-input
  231. v-model="scope.row.specification"
  232. :disabled="!!scope.row.productCode"
  233. ></el-input>
  234. </el-form-item>
  235. </template>
  236. <template v-slot:headerGuaranteePeriod="{ column }">
  237. <span :class="{ 'is-required': contractBookType == 1 }">{{
  238. column.label
  239. }}</span>
  240. </template>
  241. <template v-slot:guaranteePeriod="scope">
  242. <div class="period">
  243. <div class="borderleftnone">
  244. <el-form-item
  245. :prop="'datasource.' + scope.$index + '.guaranteePeriod'"
  246. :rules="{
  247. pattern: numberReg,
  248. message: '请输入有效期',
  249. trigger: 'blur'
  250. }"
  251. >
  252. <el-input
  253. v-model="scope.row.guaranteePeriod"
  254. @change="
  255. setDeliveryDays(scope.row, scope.$index, 'guaranteePeriod')
  256. "
  257. placeholder="请输入"
  258. ></el-input>
  259. </el-form-item>
  260. </div>
  261. <div class="borderrightnone">
  262. <DictSelection
  263. dictName="质保期单位"
  264. clearable
  265. v-model="scope.row.guaranteePeriodUnitCode"
  266. @change="
  267. setDeliveryDays(scope.row, scope.$index, 'guaranteePeriod')
  268. "
  269. :isOne="scope.$index === 0"
  270. >
  271. </DictSelection>
  272. </div>
  273. </div>
  274. </template>
  275. <template v-slot:measuringUnit="scope">
  276. <el-form-item :prop="'datasource.' + scope.$index + '.measuringUnit'">
  277. <el-input
  278. v-model="scope.row.measuringUnit"
  279. :disabled="!!scope.row.productCode"
  280. placeholder="请输入"
  281. ></el-input>
  282. </el-form-item>
  283. </template>
  284. <template v-slot:remark="scope">
  285. <el-form-item :prop="'datasource.' + scope.$index + '.remark'">
  286. <el-input
  287. v-model="scope.row.remark"
  288. type="textarea"
  289. placeholder="请输入"
  290. ></el-input>
  291. </el-form-item>
  292. </template>
  293. <template v-slot:singlePrice="scope">
  294. <el-form-item
  295. :prop="'datasource.' + scope.$index + '.singlePrice'"
  296. :rules="{
  297. required: isSinglePrice ? true : false,
  298. message: '请输入单价',
  299. trigger: 'change'
  300. }"
  301. >
  302. <el-input
  303. v-model="scope.row.singlePrice"
  304. placeholder="请输入"
  305. @input="changeCount(scope.row, scope.$index)"
  306. type="number"
  307. >
  308. <template slot="append">元</template>
  309. </el-input>
  310. </el-form-item>
  311. </template>
  312. <!-- <template v-slot:notaxSinglePrice="scope">
  313. <el-form-item
  314. :prop="'datasource.' + scope.$index + '.notaxSinglePrice'"
  315. >
  316. <el-input
  317. v-model="scope.row.notaxSinglePrice"
  318. placeholder="请输入"
  319. type="number"
  320. >
  321. <template slot="append">元</template>
  322. </el-input>
  323. </el-form-item>
  324. </template> -->
  325. <template v-slot:taxRate="scope">
  326. <el-form-item :prop="'datasource.' + scope.$index + '.taxRate'">
  327. <el-input
  328. v-model="scope.row.taxRate"
  329. placeholder="请输入"
  330. type="number"
  331. @input="getNotaxSinglePrice"
  332. >
  333. <template slot="append">%</template>
  334. </el-input>
  335. </el-form-item>
  336. </template>
  337. <template v-slot:headerSinglePrice="{ column }">
  338. <span :class="isSinglePrice ? 'is-required' : ''">{{
  339. column.label
  340. }}</span>
  341. </template>
  342. <template v-slot:headerCustomerExpectDeliveryDeadline="{ column }">
  343. <span :class="isDate == 1 ? 'is-required' : ''">{{
  344. column.label
  345. }}</span>
  346. </template>
  347. <template v-slot:technicalAnswerName="{ row, $index }">
  348. <el-form-item :prop="'datasource.' + $index + '.technicalAnswerName'">
  349. <el-input
  350. v-model="row.technicalAnswerName"
  351. placeholder="请输入"
  352. @click.native="handHead(row, $index)"
  353. ></el-input>
  354. </el-form-item>
  355. </template>
  356. <template v-slot:technicalParams="scope">
  357. <el-form-item :prop="'datasource.' + scope.$index + '.technicalParams'">
  358. <el-input
  359. type="textarea"
  360. v-model="scope.row.technicalParams"
  361. placeholder="请输入"
  362. ></el-input>
  363. </el-form-item>
  364. </template>
  365. <template v-slot:technicalDrawings="scope">
  366. <el-form-item
  367. :prop="'datasource.' + scope.$index + '.technicalDrawings'"
  368. >
  369. <fileMain v-model="scope.row.technicalDrawings"></fileMain>
  370. </el-form-item>
  371. </template>
  372. <template v-slot:customerReqFiles="scope">
  373. <el-form-item
  374. :prop="'datasource.' + scope.$index + '.customerReqFiles'"
  375. >
  376. <fileMain v-model="scope.row.customerReqFiles"></fileMain>
  377. </el-form-item>
  378. </template>
  379. <template v-slot:industryArtFiles="scope">
  380. <el-form-item
  381. :prop="'datasource.' + scope.$index + '.industryArtFiles'"
  382. :rules="{
  383. required: false,
  384. message: '请输入',
  385. trigger: 'change'
  386. }"
  387. >
  388. <fileMain v-model="scope.row.industryArtFiles"></fileMain>
  389. </el-form-item>
  390. </template>
  391. <template v-slot:otherFiles="scope">
  392. <el-form-item :prop="'datasource.' + scope.$index + '. otherFiles'">
  393. <fileMain v-model="scope.row.otherFiles"></fileMain>
  394. </el-form-item>
  395. </template>
  396. <template v-slot:headerProduceDeliveryDeadline="{ column }">
  397. <span
  398. :class="isProduceDeliveryDeadline && isDate == 1 ? 'is-required' : ''"
  399. >{{ column.label }}</span
  400. >
  401. </template>
  402. <template v-slot:produceDeliveryDeadline="scope">
  403. <el-form-item
  404. :prop="'datasource.' + scope.$index + '.produceDeliveryDeadline'"
  405. :rules="{
  406. required: isProduceDeliveryDeadline && isDate == 1 ? true : false,
  407. message: '选择生产交付交期',
  408. trigger: 'change'
  409. }"
  410. >
  411. <el-date-picker
  412. style="width: 140px"
  413. value-format="yyyy-MM-dd"
  414. v-model="scope.row.produceDeliveryDeadline"
  415. @change="
  416. setDeliveryDays(scope.row, scope.$index, 'guaranteePeriod')
  417. "
  418. type="date"
  419. placeholder="选择日期"
  420. >
  421. </el-date-picker>
  422. </el-form-item>
  423. </template>
  424. <template v-slot:customerExpectDeliveryDeadline="scope">
  425. <el-form-item
  426. v-if="scope.row.arrivalWay == 1"
  427. :rules="{
  428. required: isDate == 1 ? true : false,
  429. message:
  430. contractBookType == 1 ? '请选择客户期望交期' : '请选择交付日期',
  431. trigger: 'change'
  432. }"
  433. :prop="
  434. 'datasource.' + scope.$index + '.customerExpectDeliveryDeadline'
  435. "
  436. >
  437. <el-date-picker
  438. style="width: 140px"
  439. v-model="scope.row.customerExpectDeliveryDeadline"
  440. value-format="yyyy-MM-dd"
  441. @change="
  442. setDeliveryDays(scope.row, scope.$index, 'guaranteePeriod')
  443. "
  444. type="date"
  445. placeholder="选择日期"
  446. >
  447. </el-date-picker>
  448. </el-form-item>
  449. <el-form-item v-if="scope.row.arrivalWay == 2">
  450. <el-link
  451. type="primary"
  452. :underline="false"
  453. @click.native="handleMethod(scope.row, scope.$index)"
  454. >
  455. 设置分批时间
  456. </el-link>
  457. </el-form-item>
  458. </template>
  459. <template v-slot:provenance="scope">
  460. <el-form-item :prop="'datasource.' + scope.$index + '.provenance'">
  461. <DictSelection
  462. dictName="产地"
  463. clearable
  464. v-model="scope.row.provenance"
  465. collapse-tags
  466. multiple
  467. :isOne="scope.$index === 0"
  468. >
  469. </DictSelection>
  470. </el-form-item>
  471. </template>
  472. <template v-slot:guaranteePeriodDeadline="scope">
  473. <el-form-item
  474. :prop="'datasource.' + scope.$index + '.guaranteePeriodDeadline'"
  475. >
  476. <el-date-picker
  477. style="width: 140px"
  478. v-model="scope.row.guaranteePeriodDeadline"
  479. type="date"
  480. value-format="yyyy-MM-dd"
  481. placeholder="选择日期"
  482. >
  483. </el-date-picker>
  484. </el-form-item>
  485. </template>
  486. <template v-slot:singleWeight="scope">
  487. <el-form-item :prop="'datasource.' + scope.$index + '.singleWeight'">
  488. <el-input
  489. v-model="scope.row.singleWeight"
  490. @input="changeCount(scope.row, scope.$index)"
  491. placeholder="请输入"
  492. ></el-input>
  493. </el-form-item>
  494. </template>
  495. <template v-slot:technologyRouteName="scope">
  496. <el-form-item
  497. :prop="'datasource.' + scope.$index + '.technologyRouteName'"
  498. :rules="{
  499. required: false,
  500. message: '请选择',
  501. trigger: 'change'
  502. }"
  503. >
  504. <el-input
  505. v-model="scope.row.technologyRouteName"
  506. placeholder="请选择"
  507. @click.native="openVersion(scope.$index)"
  508. ></el-input>
  509. </el-form-item>
  510. </template>
  511. <template v-slot:pricingWay="scope">
  512. <el-form-item :prop="'datasource.' + scope.$index + '.pricingWay'">
  513. <el-select
  514. v-model="scope.row.pricingWay"
  515. placeholder="请选择"
  516. :rules="{
  517. required: true,
  518. message: '请选择计价方式',
  519. trigger: 'change'
  520. }"
  521. >
  522. <el-option
  523. v-for="item in pricingWayList"
  524. :key="item.id"
  525. :label="item.name"
  526. :value="item.id"
  527. @click.native="changeCount(scope.row, scope.$index)"
  528. >
  529. </el-option>
  530. </el-select>
  531. </el-form-item>
  532. </template>
  533. <template v-slot:headerPricingWay="{ column }">
  534. <span class="is-required">{{ column.label }}</span>
  535. </template>
  536. <template v-slot:taskName="scope">
  537. <el-form-item :prop="'datasource.' + scope.$index + '.taskName'">
  538. <el-input
  539. v-model="scope.row.taskName"
  540. placeholder="请选择"
  541. style="width: 60%; margin-right: 10px"
  542. disabled
  543. ></el-input>
  544. <el-button
  545. v-if="scope.row.productCode"
  546. size="small"
  547. type="primary"
  548. @click.native="handleTaskinstance(scope.row, scope.$index)"
  549. >选择
  550. </el-button>
  551. </el-form-item>
  552. </template>
  553. <template v-slot:arrivalWay="scope">
  554. <el-form-item :prop="'datasource.' + scope.$index + '.arrivalWay'">
  555. <el-select
  556. v-model="scope.row.arrivalWay"
  557. clearable
  558. style="width: 100%"
  559. >
  560. <el-option
  561. v-for="item in arrivalWayList"
  562. :key="item.value"
  563. :label="item.label"
  564. :value="item.value"
  565. >
  566. </el-option>
  567. </el-select>
  568. </el-form-item>
  569. </template>
  570. <template v-slot:batchNo="scope">
  571. <el-form-item
  572. :prop="'datasource.' + scope.$index + '.batchNo'"
  573. :rules="[
  574. {
  575. required: isBatchNo == 1 ? true : false,
  576. message: '请输入批号',
  577. trigger: 'blur'
  578. }
  579. ]"
  580. >
  581. <el-input
  582. v-model="scope.row.batchNo"
  583. placeholder="请输入"
  584. v-no-chinese
  585. >
  586. </el-input>
  587. </el-form-item>
  588. </template>
  589. <template v-slot:headerBatchNo="{ column }">
  590. <span :class="isBatchNo == 1 ? 'is-required' : ''">{{
  591. column.label
  592. }}</span>
  593. </template>
  594. <template v-slot:orderNo="{ row, $index }">
  595. <el-form-item :prop="'datasource.' + $index + '.orderNo'">
  596. <el-select v-model="row.orderNo" style="width: 100%">
  597. <el-option
  598. :label="item.orderNo"
  599. :value="item.orderNo"
  600. @click.native="orderNoChange(row, item)"
  601. v-for="(item, index) in orderOption"
  602. :key="index"
  603. ></el-option>
  604. </el-select>
  605. </el-form-item>
  606. </template>
  607. <template v-slot:goodsLevel="{ row, $index }">
  608. <el-form-item :prop="'datasource.' + $index + '.goodsLevel'">
  609. <el-select v-model="row.goodsLevel" style="width: 100%">
  610. <el-option
  611. :label="item.label"
  612. :value="item.value"
  613. v-for="(item, index) in levelList"
  614. :key="index"
  615. ></el-option>
  616. </el-select>
  617. </el-form-item>
  618. </template>
  619. <template v-slot:goodsPriceType="{ row, $index }">
  620. <el-form-item :prop="'datasource.' + $index + '.goodsPriceType'">
  621. <DictSelection
  622. dictName="商品价格类型"
  623. clearable
  624. v-model="row.goodsPriceType"
  625. @change="goodsPriceTypeChange(row, $index)"
  626. :isOne="$index === 0"
  627. >
  628. </DictSelection>
  629. </el-form-item>
  630. </template>
  631. <template v-slot:saleCount="scope">
  632. <el-form-item
  633. :prop="'datasource.' + scope.$index + '.' + countObj.countKey"
  634. :rules="{
  635. required: isTotalCount ? true : false,
  636. message: '请输入数量',
  637. trigger: 'change'
  638. }"
  639. >
  640. <el-input
  641. v-model="scope.row[countObj.countKey]"
  642. placeholder="请输入"
  643. type="number"
  644. :min="0"
  645. @input="changeCount(scope.row, scope.$index)"
  646. >
  647. </el-input>
  648. </el-form-item>
  649. </template>
  650. <template v-slot:saleUnit="scope">
  651. <el-form-item
  652. :prop="'datasource.' + scope.$index + '.' + countObj.unitIdKey"
  653. >
  654. <el-select
  655. v-model="scope.row[countObj.unitIdKey]"
  656. style="width: 100%"
  657. @change="changeCount(scope.row, scope.$index)"
  658. >
  659. <el-option
  660. :label="item.conversionUnit"
  661. :value="item.id"
  662. @click.native="packingChange(item, scope.$index)"
  663. v-for="(item, index) in scope.row.packageDispositionList"
  664. :key="index"
  665. ></el-option>
  666. </el-select>
  667. </el-form-item>
  668. </template>
  669. <template v-slot:modelKey="scope">
  670. <el-form-item :prop="'datasource.' + scope.$index + '.' + 'modelKey'">
  671. <DictSelection
  672. dictName="物品机型"
  673. clearable
  674. v-model="scope.row.modelKey"
  675. :isOne="scope.$index === 0"
  676. filterable
  677. allow-create
  678. default-first-option
  679. multiple
  680. >
  681. </DictSelection>
  682. </el-form-item>
  683. </template>
  684. <template v-slot:colorKey="scope">
  685. <el-form-item :prop="'datasource.' + scope.$index + '.' + 'colorKey'">
  686. <DictSelection
  687. dictName="物品颜色"
  688. clearable
  689. v-model="scope.row.colorKey"
  690. :isOne="scope.$index === 0"
  691. filterable
  692. allow-create
  693. default-first-option
  694. multiple
  695. >
  696. </DictSelection>
  697. </el-form-item>
  698. </template>
  699. <!-- 操作列 -->
  700. <template v-slot:action="scope">
  701. <el-popconfirm
  702. class="ele-action"
  703. title="确定要删除吗?"
  704. @confirm="remove(scope.$index)"
  705. >
  706. <template v-slot:reference>
  707. <el-link type="danger" :underline="false" icon="el-icon-delete">
  708. 删除
  709. </el-link>
  710. </template>
  711. </el-popconfirm>
  712. </template>
  713. </ele-pro-table>
  714. <product-list
  715. ref="productListRef"
  716. classType="1"
  717. :is-get-inventory-total="true"
  718. @changeParent="changeParent"
  719. :isSupplier="isSupplier"
  720. :isSalesRecord="isSalesRecord"
  721. ></product-list>
  722. <head-list ref="headRef" @changeParent="changeAnswer"></head-list>
  723. <ProductionVersion
  724. ref="versionRefs"
  725. @changeProduct="changeProduct"
  726. ></ProductionVersion>
  727. <taskinstance-dialog
  728. ref="taskinstanceDialogRef"
  729. v-if="taskinstanceDialogFlag"
  730. @saveTaskInstance="saveTaskInstance"
  731. :visible.sync="taskinstanceDialogFlag"
  732. ></taskinstance-dialog>
  733. <timeDialog
  734. @chooseTime="chooseTime"
  735. ref="timeDialogRef"
  736. :isBatch="true"
  737. ></timeDialog>
  738. <selectStockLedgerDialog
  739. ref="selectStockLedgerDialogRef"
  740. @changeParent="replaceTable"
  741. :isSupplier="isSupplier"
  742. ></selectStockLedgerDialog>
  743. <commodityPriceListDialog
  744. ref="commodityPriceListDialogRef"
  745. @changeParent="changeParent"
  746. ></commodityPriceListDialog>
  747. </el-form>
  748. </template>
  749. <script>
  750. import { numberReg } from 'ele-admin';
  751. import productList from '@/BIZComponents/product-list.vue';
  752. import dictMixins from '@/mixins/dictMixins';
  753. import fileUpload from '@/components/upload/fileUpload';
  754. import headList from '@/BIZComponents/user-select/user-select.vue';
  755. import ProductionVersion from '@/components/ProductionVersion2/index.vue';
  756. import { getInventoryTotalAPI } from '@/api/wms';
  757. // import fileMain from '@/components/addDoc/index.vue';
  758. import { pricingWayList, lbjtList } from '@/enum/dict.js';
  759. import { changeCount, getAllPrice } from '@/BIZComponents/setProduct.js';
  760. import { contactQueryByCategoryIdsAPI } from '@/api/saleManage/contact';
  761. import taskinstanceDialog from '@/BIZComponents/procedure/taskinstanceDialog.vue';
  762. import timeDialog from '@/components/timeDialog/index.vue';
  763. import { copyObj } from '@/utils/util';
  764. import selectStockLedgerDialog from '@/BIZComponents/selectStockLedger/selectStockLedgerDialog.vue'; //库存台账
  765. import setAllValue from '@/BIZComponents/setAllValue.vue'; //批量修改
  766. import tabMixins from '@/mixins/tableColumnsMixin';
  767. import commodityPriceListDialog from '@/views/commodityManagement/commodityPriceList/components/commodityPriceListDialog.vue';
  768. const dayjs = require('dayjs');
  769. import { levelList } from '@/enum/dict.js';
  770. import {
  771. getGoodsPriceByCondition,
  772. getGoodsByCategoryId
  773. } from '@/api/goodsManage/index';
  774. import { parameterGetByCode } from '@/api/main/index.js';
  775. export default {
  776. mixins: [dictMixins, tabMixins],
  777. components: {
  778. // fileMain,
  779. productList,
  780. fileUpload,
  781. headList,
  782. ProductionVersion,
  783. taskinstanceDialog,
  784. timeDialog,
  785. selectStockLedgerDialog,
  786. commodityPriceListDialog,
  787. setAllValue
  788. },
  789. props: {
  790. pageName: {
  791. default: '',
  792. type: String
  793. },
  794. isDiscountTotalPrice: {
  795. default: false,
  796. type: Boolean
  797. },
  798. isGuaranteePeriod: {
  799. default: true,
  800. type: Boolean
  801. },
  802. customerMark: {
  803. default: '',
  804. type: String
  805. },
  806. isContractId: {
  807. type: Boolean,
  808. default: false
  809. },
  810. isSinglePrice: {
  811. //单价必填
  812. type: Boolean,
  813. default: true
  814. },
  815. isTotalCount: {
  816. //数量必填
  817. type: Boolean,
  818. default: true
  819. },
  820. isCustomerMark: {
  821. //客户代号必填
  822. type: Boolean,
  823. default: false
  824. },
  825. isDiscount: {
  826. //折让
  827. type: Boolean,
  828. default: true
  829. },
  830. isProduceDeliveryDeadline: {
  831. //生产交付交期必填
  832. type: Boolean,
  833. default: false
  834. },
  835. isDrawer: {
  836. type: Boolean,
  837. default: false
  838. },
  839. isChangeCount: {
  840. //默认计算
  841. type: Boolean,
  842. default: true
  843. },
  844. contractBookType: {
  845. //合同类型 1销售 2采购
  846. type: [String, Number],
  847. default: 1
  848. },
  849. // isSupplierMark: {
  850. // //客户代号必填
  851. // type: Boolean,
  852. // default: false
  853. // },
  854. isTemporary: {
  855. //临时
  856. type: Boolean,
  857. default: false
  858. },
  859. isSupplier: {
  860. //供应商
  861. type: Boolean,
  862. default: false
  863. },
  864. isSalesRecord: {
  865. default: ''
  866. },
  867. isArrivalWay: {
  868. //分批到货时间
  869. type: Boolean,
  870. default: false
  871. },
  872. //订单类型
  873. needProduce: {
  874. type: [String, Number],
  875. default: 1
  876. },
  877. cacheKeyUrl: '',
  878. //是否显示订单编码
  879. isOrderNo: {
  880. type: Boolean,
  881. default: false
  882. },
  883. isBatchNo: {
  884. type: Boolean, //批次号是否必填
  885. default: false
  886. },
  887. orderOption: {
  888. default: () => {
  889. return [];
  890. }
  891. },
  892. //是否商品
  893. isGoods: {
  894. type: Boolean,
  895. default: false
  896. },
  897. defTaxRate: {
  898. type: Number,
  899. default: 0
  900. },
  901. countObj: {
  902. type: Object,
  903. default: () => {
  904. return {
  905. countKey: 'saleCount',
  906. unitKey: 'saleUnit',
  907. unitIdKey: 'saleUnitId'
  908. };
  909. }
  910. }
  911. },
  912. data() {
  913. const defaultForm = {
  914. key: null,
  915. endTime: '',
  916. isFirst: 0,
  917. name: '',
  918. startTime: '',
  919. workHour: '',
  920. guaranteePeriodUnitCode: '',
  921. technicalDrawings: [],
  922. arrivalWay: 1
  923. };
  924. return {
  925. levelList,
  926. taskinstanceDialogFlag: false,
  927. allPrice: 0,
  928. numberReg,
  929. defaultForm,
  930. form: {
  931. datasource: [],
  932. discountTotalPrice: 0
  933. },
  934. isDate: 1,
  935. pricingWayList,
  936. curIndex: '',
  937. rules: {},
  938. dictList: {},
  939. arrivalWayList: [
  940. { label: '一次性到货', value: 1 },
  941. { label: '分批到货', value: 2 }
  942. ],
  943. columnsVersion: 1,
  944. selection: []
  945. };
  946. },
  947. computed: {
  948. canHandl() {
  949. return this.form.datasource.length;
  950. },
  951. columns() {
  952. let columnsVersion = this.columnsVersion;
  953. let orderColumn = {
  954. width: 1,
  955. show: false
  956. };
  957. if (this.isOrderNo) {
  958. orderColumn = {
  959. minWidth: 200,
  960. prop: 'orderNo',
  961. slot: 'orderNo',
  962. label: '订单编码',
  963. showOverflowTooltip: true,
  964. align: 'center'
  965. };
  966. }
  967. return [
  968. {
  969. width: 45,
  970. type: 'index',
  971. columnKey: 'index',
  972. align: 'center',
  973. fixed: 'left'
  974. },
  975. {
  976. label: '选择',
  977. width: 45,
  978. type: 'selection',
  979. columnKey: 'selection',
  980. align: 'center',
  981. fixed: 'left'
  982. },
  983. orderColumn,
  984. {
  985. width: 280,
  986. prop: 'productName',
  987. label: '名称',
  988. slot: 'productName',
  989. headerSlot: 'headerProductName',
  990. align: 'center',
  991. fixed: 'left'
  992. },
  993. {
  994. width: 120,
  995. prop: 'productCode',
  996. label: '编码',
  997. slot: 'productCode',
  998. align: 'center'
  999. },
  1000. {
  1001. width: 200,
  1002. prop: 'productCategoryName',
  1003. label: '类型',
  1004. slot: 'productCategoryName',
  1005. align: 'center'
  1006. },
  1007. {
  1008. width: 120,
  1009. prop: 'specification',
  1010. label: '规格',
  1011. slot: 'specification',
  1012. align: 'center'
  1013. },
  1014. {
  1015. width: 200,
  1016. prop: 'customerMark',
  1017. label: this.contractBookType == 1 ? '客户代号' : '供应商代号',
  1018. slot: 'customerMark',
  1019. headerSlot: 'headerCustomerMark',
  1020. align: 'center'
  1021. },
  1022. {
  1023. minWidth: 240,
  1024. prop: 'taskName',
  1025. label: '工序',
  1026. slot: 'taskName',
  1027. align: 'center'
  1028. },
  1029. {
  1030. minWidth: 160,
  1031. prop: 'productionCodes',
  1032. label: '生产编号',
  1033. align: 'center'
  1034. },
  1035. this.isCustomerMark
  1036. ? {
  1037. minWidth: 120,
  1038. prop: 'entrustedEnterpriseId',
  1039. label: '受托企业',
  1040. slot: 'entrustedEnterpriseId',
  1041. show: this.isCustomerMark,
  1042. align: 'center'
  1043. }
  1044. : {
  1045. width: 1
  1046. },
  1047. {
  1048. width: 150,
  1049. prop: 'saleCount',
  1050. label: '数量',
  1051. slot: 'saleCount',
  1052. headerSlot: 'headerTotalCount',
  1053. align: 'center'
  1054. },
  1055. {
  1056. width: 150,
  1057. prop: 'saleUnit',
  1058. label: '单位',
  1059. slot: 'saleUnit',
  1060. // headerSlot: 'headerTotalCount',
  1061. align: 'center'
  1062. },
  1063. {
  1064. width: 120,
  1065. prop: 'packingSpecification',
  1066. align: 'center',
  1067. label: '包装规格',
  1068. showOverflowTooltip: true
  1069. },
  1070. {
  1071. width: 150,
  1072. prop: 'totalCount',
  1073. label: '计量数量',
  1074. // slot: 'totalCount',
  1075. headerSlot: 'headerTotalCount',
  1076. align: 'center'
  1077. },
  1078. {
  1079. width: 120,
  1080. prop: 'measuringUnit',
  1081. label: '计量单位',
  1082. slot: 'measuringUnit',
  1083. align: 'center'
  1084. },
  1085. // {
  1086. // width: 160,
  1087. // prop: 'pricingWay',
  1088. // label: '计价方式',
  1089. // headerSlot: 'headerPricingWay',
  1090. // slot: 'pricingWay',
  1091. // align: 'center'
  1092. // },
  1093. {
  1094. minWidth: 120,
  1095. prop: 'goodsLevel',
  1096. label: '物品级别',
  1097. slot: 'goodsLevel',
  1098. align: 'center'
  1099. },
  1100. {
  1101. width: 160,
  1102. prop: 'goodsPriceType',
  1103. label: '价格类型',
  1104. slot: 'goodsPriceType',
  1105. align: 'center'
  1106. },
  1107. {
  1108. width: 200,
  1109. prop: 'singlePrice',
  1110. label: '单价',
  1111. slot: 'singlePrice',
  1112. headerSlot: 'headerSinglePrice',
  1113. align: 'center'
  1114. },
  1115. {
  1116. width: 160,
  1117. prop: 'taxRate',
  1118. label: '税率',
  1119. slot: 'taxRate',
  1120. align: 'center'
  1121. },
  1122. {
  1123. width: 180,
  1124. prop: 'notaxSinglePrice',
  1125. label: '不含税单价',
  1126. slot: 'notaxSinglePrice',
  1127. align: 'center'
  1128. },
  1129. this.isDiscount
  1130. ? {
  1131. width: 160,
  1132. prop: 'discountSinglePrice',
  1133. label: '折让单价',
  1134. align: 'center',
  1135. show: this.isDiscount,
  1136. formatter: (_row, _column, cellValue) => {
  1137. return _row.discountSinglePrice
  1138. ? Number(_row.discountSinglePrice).toFixed(2)
  1139. : '';
  1140. }
  1141. }
  1142. : {
  1143. width: 1
  1144. },
  1145. {
  1146. width: 120,
  1147. prop: 'totalPrice',
  1148. label: '合计',
  1149. slot: 'totalPrice',
  1150. align: 'center'
  1151. },
  1152. this.isDiscount
  1153. ? {
  1154. width: 160,
  1155. prop: 'discountTotalPrice',
  1156. label: '折让合计',
  1157. align: 'center',
  1158. show: this.isDiscount,
  1159. formatter: (_row, _column, cellValue) => {
  1160. return _row.discountTotalPrice
  1161. ? Number(_row.discountTotalPrice).toFixed(2)
  1162. : '';
  1163. }
  1164. }
  1165. : {
  1166. width: 1
  1167. },
  1168. {
  1169. width: 110,
  1170. prop: 'batchNo',
  1171. label: '批次号',
  1172. slot: 'batchNo',
  1173. headerSlot: 'headerBatchNo',
  1174. align: 'center'
  1175. },
  1176. {
  1177. width: 120,
  1178. prop: 'availableCountBase',
  1179. label: '库存数量',
  1180. slot: 'availableCountBase',
  1181. align: 'center'
  1182. },
  1183. {
  1184. prop: 'provenance',
  1185. label: '产地',
  1186. slot: 'provenance',
  1187. align: 'center',
  1188. showOverflowTooltip: true,
  1189. minWidth: 200
  1190. // show:this.contractBookType==2
  1191. },
  1192. {
  1193. width: 120,
  1194. prop: 'singleWeight',
  1195. label: '单重',
  1196. slot: 'singleWeight',
  1197. headerSlot: 'headerSingleWeight',
  1198. align: 'center'
  1199. },
  1200. {
  1201. width: 120,
  1202. prop: 'totalWeight',
  1203. label: '总重',
  1204. slot: 'totalWeight',
  1205. align: 'center'
  1206. },
  1207. {
  1208. width: 120,
  1209. prop: 'weightUnit',
  1210. label: '重量单位',
  1211. slot: 'weightUnit',
  1212. align: 'center'
  1213. },
  1214. {
  1215. width: 160,
  1216. prop: 'productBrand',
  1217. label: '牌号',
  1218. slot: 'productBrand',
  1219. align: 'center'
  1220. },
  1221. {
  1222. width: 120,
  1223. prop: 'modelType',
  1224. label: '型号',
  1225. slot: 'modelType',
  1226. align: 'center'
  1227. },
  1228. {
  1229. width: 160,
  1230. prop: 'modelKey',
  1231. label: '机型',
  1232. slot: 'modelKey',
  1233. align: 'center'
  1234. },
  1235. {
  1236. width: 160,
  1237. prop: 'colorKey',
  1238. label: '颜色',
  1239. slot: 'colorKey',
  1240. align: 'center'
  1241. },
  1242. {
  1243. width: 120,
  1244. prop: 'produceType',
  1245. align: 'center',
  1246. label: '属性类型',
  1247. showOverflowTooltip: true,
  1248. formatter: (row, column) => {
  1249. if (row.produceType) {
  1250. return row.produceType
  1251. .map((item) => {
  1252. return lbjtList[item];
  1253. })
  1254. .toString();
  1255. }
  1256. }
  1257. },
  1258. this.isArrivalWay
  1259. ? {
  1260. width: 160,
  1261. prop: 'arrivalWay',
  1262. label: '到货方式',
  1263. slot: 'arrivalWay',
  1264. align: 'center',
  1265. show: this.isArrivalWay
  1266. }
  1267. : {
  1268. width: 1
  1269. },
  1270. {
  1271. width: 160,
  1272. prop: 'customerExpectDeliveryDeadline',
  1273. label: this.contractBookType == 1 ? '客户期望交期' : '交付日期',
  1274. slot: 'customerExpectDeliveryDeadline',
  1275. headerSlot: 'headerCustomerExpectDeliveryDeadline',
  1276. align: 'center'
  1277. },
  1278. this.contractBookType == 1
  1279. ? {
  1280. width: 160,
  1281. prop: 'produceDeliveryDeadline',
  1282. label: '生产交付交期',
  1283. slot: 'produceDeliveryDeadline',
  1284. headerSlot: 'headerProduceDeliveryDeadline',
  1285. show: this.contractBookType == 1,
  1286. align: 'center'
  1287. }
  1288. : {
  1289. width: 1
  1290. },
  1291. {
  1292. width: 200,
  1293. prop: 'guaranteePeriod',
  1294. label: '有效期',
  1295. slot: 'guaranteePeriod',
  1296. // headerSlot: 'headerGuaranteePeriod',
  1297. align: 'center'
  1298. },
  1299. this.isGuaranteePeriod
  1300. ? {
  1301. width: 200,
  1302. prop: 'guaranteePeriodDeadline',
  1303. label: '有效期截止日期',
  1304. slot: 'guaranteePeriodDeadline',
  1305. show: this.isGuaranteePeriod,
  1306. align: 'center'
  1307. }
  1308. : {
  1309. width: 1
  1310. },
  1311. {
  1312. width: 120,
  1313. prop: 'imgCode',
  1314. align: 'center',
  1315. label: '图号/件号',
  1316. showOverflowTooltip: true
  1317. },
  1318. // {
  1319. // width: 120,
  1320. // prop: 'approvalNumber',
  1321. // align: 'center',
  1322. // label: '批准文号',
  1323. // showOverflowTooltip: true
  1324. // },
  1325. {
  1326. width: 220,
  1327. prop: 'customerReqFiles',
  1328. label: '客户需求',
  1329. slot: 'customerReqFiles',
  1330. align: 'center'
  1331. },
  1332. {
  1333. width: 130,
  1334. prop: 'technicalAnswerName',
  1335. label: '技术答疑人',
  1336. slot: 'technicalAnswerName',
  1337. align: 'center'
  1338. },
  1339. {
  1340. width: 220,
  1341. prop: 'technicalParams',
  1342. label: '技术参数',
  1343. slot: 'technicalParams',
  1344. align: 'center'
  1345. },
  1346. {
  1347. width: 240,
  1348. prop: 'technicalDrawings',
  1349. label: '技术图纸',
  1350. slot: 'technicalDrawings',
  1351. align: 'center'
  1352. },
  1353. {
  1354. width: 120,
  1355. prop: 'drawingVersion',
  1356. label: '图纸版本',
  1357. align: 'center'
  1358. },
  1359. {
  1360. width: 240,
  1361. prop: 'technologyRouteName',
  1362. label: '工艺路线',
  1363. slot: 'technologyRouteName',
  1364. align: 'center'
  1365. },
  1366. {
  1367. width: 240,
  1368. prop: 'industryArtFiles',
  1369. label: '工艺附件',
  1370. slot: 'industryArtFiles',
  1371. align: 'center'
  1372. },
  1373. {
  1374. width: 240,
  1375. prop: 'otherFiles',
  1376. label: '其他附件',
  1377. slot: 'otherFiles',
  1378. align: 'center'
  1379. },
  1380. {
  1381. width: 220,
  1382. prop: 'remark',
  1383. label: '备注',
  1384. slot: 'remark',
  1385. align: 'center'
  1386. },
  1387. {
  1388. columnKey: 'action',
  1389. label: '操作',
  1390. width: 120,
  1391. align: 'center',
  1392. resizable: false,
  1393. slot: 'action',
  1394. fixed: 'right',
  1395. showOverflowTooltip: true
  1396. }
  1397. ];
  1398. }
  1399. },
  1400. created() {
  1401. // this.requestDict('保质期单位');
  1402. // this.requestDict('产地');
  1403. // this.requestDict('商品价格类型');
  1404. parameterGetByCode({
  1405. code: 'eom_inventoryTable_customerExpectDeliveryDeadline'
  1406. }).then((res) => {
  1407. if (res.value) {
  1408. this.isDate = res.value;
  1409. }
  1410. });
  1411. },
  1412. methods: {
  1413. packingChange(item, index) {
  1414. this.$set(
  1415. this.form.datasource[index],
  1416. this.countObj.unitKey,
  1417. item.conversionUnit
  1418. );
  1419. },
  1420. openVersion(index) {
  1421. this.$refs.versionRefs.open(index);
  1422. },
  1423. //设置分批到货时间
  1424. handleMethod(row, index) {
  1425. this.$refs.timeDialogRef.open(row, index);
  1426. },
  1427. chooseTime({ arrivalBatch, index }) {
  1428. this.$set(
  1429. this.form.datasource[index],
  1430. 'arrivalBatch',
  1431. copyObj(arrivalBatch)
  1432. );
  1433. },
  1434. //工艺路线
  1435. changeProduct(data, index) {
  1436. this.$set(
  1437. this.form.datasource[index],
  1438. 'technologyRouteName',
  1439. data.name
  1440. );
  1441. this.$set(this.form.datasource[index], 'technologyRouteId', data.id);
  1442. },
  1443. handleTaskinstance(row, index) {
  1444. this.taskinstanceDialogFlag = true;
  1445. this.$nextTick(() => {
  1446. this.$refs.taskinstanceDialogRef.open(row, index);
  1447. });
  1448. },
  1449. saveTaskInstance(row = {}) {
  1450. this.$set(this.form.datasource[row.index], 'taskId', row.id);
  1451. this.$set(this.form.datasource[row.index], 'taskName', row.name);
  1452. this.$set(
  1453. this.form.datasource[row.index],
  1454. 'routingId',
  1455. row.produceRoutingId
  1456. );
  1457. },
  1458. async getSupplierObj(productList, queryName) {
  1459. try {
  1460. let categoryIds = productList
  1461. .filter((item) => item.productId)
  1462. .map((item) => item.productId);
  1463. if (categoryIds.length > 0) {
  1464. return await contactQueryByCategoryIdsAPI({
  1465. categoryIds,
  1466. });
  1467. } else {
  1468. return Promise.resolve({});
  1469. }
  1470. } catch (e) {
  1471. return Promise.resolve({});
  1472. }
  1473. },
  1474. setDeliveryDays(row, index, type, isAll) {
  1475. if (isAll) {
  1476. this.form.datasource.forEach((item, i) => {
  1477. let guaranteePeriodUnitName = this.guaranteePeriodUnit(
  1478. item.guaranteePeriodUnitCode
  1479. );
  1480. this.$set(
  1481. this.form.datasource[i],
  1482. 'guaranteePeriodDeadline',
  1483. guaranteePeriodUnitName != 'second'
  1484. ? this.setDay(
  1485. item.guaranteePeriod,
  1486. guaranteePeriodUnitName,
  1487. item
  1488. )
  1489. : ''
  1490. );
  1491. // }
  1492. });
  1493. return;
  1494. }
  1495. if (type == 'guaranteePeriod') {
  1496. let guaranteePeriodUnitName = this.guaranteePeriodUnit(
  1497. row.guaranteePeriodUnitCode
  1498. );
  1499. this.$set(
  1500. this.form.datasource[index],
  1501. 'guaranteePeriodDeadline',
  1502. guaranteePeriodUnitName != 'second'
  1503. ? this.setDay(row.guaranteePeriod, guaranteePeriodUnitName, row)
  1504. : ''
  1505. );
  1506. }
  1507. },
  1508. guaranteePeriodUnit(code) {
  1509. return code == 3
  1510. ? 'day'
  1511. : code == 4
  1512. ? 'month'
  1513. : code == 5
  1514. ? 'year'
  1515. : 'second';
  1516. },
  1517. setDay(addDay, dateType = 'day', item) {
  1518. let tiem =
  1519. this.contractBookType == 1
  1520. ? item.produceDeliveryDeadline
  1521. : item.customerExpectDeliveryDeadline;
  1522. return dayjs(tiem || new Date())
  1523. .add(addDay, dateType)
  1524. .format('YYYY-MM-DD');
  1525. },
  1526. // 返回列表数据
  1527. getTableValue() {
  1528. let comitDatasource = copyObj(this.form.datasource);
  1529. // console.log(comitDatasource)
  1530. // console.log(this.form.datasource)
  1531. // return
  1532. if (comitDatasource.length === 0) return [];
  1533. comitDatasource.forEach((v) => {
  1534. if (v.guaranteePeriodUnitCode) {
  1535. v.guaranteePeriodUnitName = this.getDictValue(
  1536. '保质期单位',
  1537. v.guaranteePeriodUnitCode
  1538. );
  1539. }
  1540. if (v.modelKey) {
  1541. v.modelKey = v.modelKey.toString();
  1542. }
  1543. if (v.colorKey) {
  1544. v.colorKey = v.colorKey.toString();
  1545. }
  1546. v.technicalDrawings = v.technicalDrawings ? v.technicalDrawings : [];
  1547. v.customerReqFiles = v.customerReqFiles || [];
  1548. v.industryArtFiles = v.industryArtFiles || [];
  1549. v.otherFiles = v.otherFiles || [];
  1550. });
  1551. return comitDatasource;
  1552. },
  1553. getPrice() {
  1554. return [this.allPrice, this.form.discountTotalPrice];
  1555. },
  1556. //改变数量
  1557. changeCount(row, index) {
  1558. if (!row) {
  1559. this.form.datasource.forEach((item, index) => {
  1560. this.$set(
  1561. this.form,
  1562. 'datasource[' + index + ']',
  1563. changeCount(item, this.countObj)
  1564. );
  1565. });
  1566. } else {
  1567. this.$set(
  1568. this.form,
  1569. 'datasource[' + index + ']',
  1570. changeCount(row, this.countObj)
  1571. );
  1572. }
  1573. this.getNotaxSinglePrice();
  1574. this.changeAll();
  1575. this.$forceUpdate();
  1576. },
  1577. changeAll() {
  1578. this.allPrice = getAllPrice(this.form.datasource) || 0;
  1579. if (this.isDiscountTotalPrice) {
  1580. this.form.discountTotalPrice = this.allPrice;
  1581. this.$emit('setDiscountTotalPrice', this.allPrice);
  1582. }
  1583. this.$emit('setCountAmount', this.allPrice);
  1584. },
  1585. setCustomerMark(customerMark) {
  1586. this.form.datasource.forEach((item) => {
  1587. item['customerMark'] = customerMark;
  1588. this.$forceUpdate();
  1589. });
  1590. },
  1591. //计算不含税单价
  1592. getNotaxSinglePrice() {
  1593. this.form.datasource.forEach((item, index) => {
  1594. if (item.singlePrice && item.taxRate) {
  1595. this.$set(
  1596. this.form.datasource[index],
  1597. 'notaxSinglePrice',
  1598. parseFloat(
  1599. (item.singlePrice / (1 + item.taxRate / 100)).toFixed(2)
  1600. )
  1601. );
  1602. } else {
  1603. this.$set(this.form.datasource[index], 'notaxSinglePrice', '');
  1604. }
  1605. });
  1606. },
  1607. //设置优惠后总金额修改产品单价
  1608. discountInputByOrder(val) {
  1609. this.form.discountTotalPrice = val;
  1610. // //获取优惠金额和总计的差价
  1611. this.form.datasource.forEach((item, index) => {
  1612. //获取折让单价
  1613. this.$set(
  1614. this.form.datasource[index],
  1615. 'discountSinglePrice',
  1616. this.getDiscountSinglePrice(item)
  1617. );
  1618. this.$set(
  1619. this.form.datasource[index],
  1620. 'discountTotalPrice',
  1621. this.getDiscountTotalPrice(item)
  1622. );
  1623. });
  1624. this.$emit('setDiscountTotalPrice', val);
  1625. this.$forceUpdate();
  1626. this.$refs.table.reRenderTable();
  1627. },
  1628. setAllValueChange({ key, value }) {
  1629. let indexS = this.selection.map((item) => item.key - 1);
  1630. indexS.forEach((i) => {
  1631. this.$set(this.form.datasource[i], key, value);
  1632. this.setDeliveryDays(this.form.datasource[i], i, 'guaranteePeriod');
  1633. });
  1634. },
  1635. //获取折让单价
  1636. getDiscountSinglePrice(row) {
  1637. let num =
  1638. (Number(this.form.discountTotalPrice) / Number(this.allPrice)) *
  1639. Number(row.singlePrice);
  1640. console.log(num, 'num');
  1641. return isNaN(num) ? '' : num;
  1642. },
  1643. //获取折让合计
  1644. getDiscountTotalPrice(row) {
  1645. let num = 0;
  1646. num = Number(row.discountSinglePrice) * Number(row.totalCount);
  1647. return isNaN(num) ? '' : num.toFixed(2);
  1648. },
  1649. orderNoChange(row, item) {
  1650. row['orderId'] = item.orderId;
  1651. },
  1652. //修改回显
  1653. async putTableValue(data) {
  1654. let productList =
  1655. (data &&
  1656. (data.quoteProductList || data.productList || data.detailList)) ||
  1657. [];
  1658. if (productList) {
  1659. let supplierObj = await this.getSupplierObj(productList, 'productId');
  1660. productList.forEach((item, index) => {
  1661. item['key'] = index + 1;
  1662. if (item.modelKey) {
  1663. item.modelKey = item.modelKey.split(',');
  1664. }
  1665. if (item.colorKey) {
  1666. item.colorKey = item.colorKey.split(',');
  1667. }
  1668. item.pricingWay =
  1669. item.pricingWay ||
  1670. data.pricingWay ||
  1671. data?.contractVO?.pricingWay;
  1672. item.guaranteePeriodUnitCode = item.guaranteePeriodUnitCode
  1673. ? item.guaranteePeriodUnitCode + ''
  1674. : '';
  1675. let guaranteePeriodUnitName = this.guaranteePeriodUnit(
  1676. item.guaranteePeriodUnitCode
  1677. );
  1678. if (item.guaranteePeriod && item.guaranteePeriodUnitCode) {
  1679. item['guaranteePeriodDeadline'] =
  1680. item['guaranteePeriodDeadline'] ||
  1681. guaranteePeriodUnitName != 'second'
  1682. ? this.setDay(
  1683. item.guaranteePeriod,
  1684. guaranteePeriodUnitName,
  1685. item
  1686. )
  1687. : '';
  1688. }
  1689. item.entrustedEnterpriseIdList = supplierObj[item.productId];
  1690. if (supplierObj[item.productId]?.length === 1) {
  1691. item.entrustedEnterpriseId = supplierObj[item.productId][0].id;
  1692. }
  1693. item['customerMark'] = item.customerMark || this.customerMark;
  1694. item['arrivalWay'] = item.arrivalWay || 1;
  1695. });
  1696. this.form.datasource = productList;
  1697. let codeList = this.form.datasource
  1698. .filter((item) => item.productCode)
  1699. .map((item) => item.productCode);
  1700. //获取仓库库存
  1701. let inventoryTotalList = await getInventoryTotalAPI(codeList);
  1702. this.form.datasource
  1703. .filter((item) => item.productCode)
  1704. .forEach((item, index) => {
  1705. let find =
  1706. inventoryTotalList.find(
  1707. (key) => key.code == item.productCode
  1708. ) || {};
  1709. this.form.datasource;
  1710. this.$set(
  1711. this.form.datasource[index],
  1712. 'availableCountBase',
  1713. find.availableCountBase
  1714. );
  1715. });
  1716. if (this.isChangeCount) {
  1717. this.changeCount();
  1718. } else {
  1719. this.allPrice = data.totalAmount || data?.contractVO?.totalPrice;
  1720. }
  1721. if (this.isDiscountTotalPrice) {
  1722. this.form.discountTotalPrice =
  1723. data.payAmount || data?.contractVO?.discountTotalPrice;
  1724. }
  1725. this.$refs.table.reload();
  1726. }
  1727. },
  1728. //计算单重
  1729. //选择产品
  1730. handParent(row, index) {
  1731. let item = {
  1732. id: row?.productCode
  1733. };
  1734. if (row?.goodsId) {
  1735. this.handGoods(index);
  1736. return;
  1737. }
  1738. if (this.needProduce == 1 || this.needProduce == 2) {
  1739. this.$refs.productListRef.open(item, index);
  1740. } else {
  1741. this.$refs.selectStockLedgerDialogRef.open(item, index);
  1742. }
  1743. },
  1744. handGoods(index) {
  1745. this.$refs.commodityPriceListDialogRef.open(index);
  1746. },
  1747. //选择技术人回调
  1748. changeAnswer(obj, idx) {
  1749. this.$set(this.form.datasource[idx], 'technicalAnswerId', obj.id);
  1750. this.$set(this.form.datasource[idx], 'technicalAnswerName', obj.name);
  1751. },
  1752. handHead(row, index) {
  1753. let item = {
  1754. id: row.technicalAnswerId
  1755. };
  1756. this.$refs.headRef.open(item, index);
  1757. },
  1758. //选择产品回调
  1759. changeParent(obj, idx) {
  1760. obj.forEach((item, index) => {
  1761. let i = idx == -1 ? index : idx;
  1762. let row = JSON.parse(JSON.stringify(this.defaultForm));
  1763. row.key = this.form.datasource.length + 1;
  1764. let parasm = idx == -1 ? row : this.form.datasource[i];
  1765. console.log(this.defTaxRate, 'this.defTaxRate');
  1766. this.$set(parasm, 'taxRate', this.defTaxRate);
  1767. this.$set(parasm, 'productId', item.id);
  1768. this.$set(parasm, 'categoryName', item.name);
  1769. this.$set(parasm, 'productCategoryId', item.categoryLevelId);
  1770. this.$set(parasm, 'productBrand', item.brandNum);
  1771. this.$set(parasm, 'productCategoryName', item.categoryLevelPath);
  1772. this.$set(parasm, 'productCode', item.code);
  1773. this.$set(parasm, 'productName', item.name);
  1774. this.$set(parasm, 'modelType', item.modelType);
  1775. this.$set(parasm, 'availableCountBase', item.availableCountBase);
  1776. this.$set(parasm, 'measuringUnit', item.measuringUnit);
  1777. this.$set(parasm, 'specification', item.specification);
  1778. this.$set(parasm, 'weightUnit', item.weightUnit);
  1779. this.$set(parasm, 'singleWeight', item.netWeight);
  1780. this.$set(parasm, 'pricingWay', 1);
  1781. this.$set(parasm, 'goodsLevel', item.goodsLevel);
  1782. this.$set(parasm, 'guaranteePeriod', item.warrantyPeriod);
  1783. if (item.modelKey) {
  1784. this.$set(parasm, 'modelKey', item.modelKey.split(','));
  1785. }
  1786. if (item.colorKey) {
  1787. this.$set(parasm, 'colorKey', item.colorKey.split(','));
  1788. }
  1789. this.$set(
  1790. parasm,
  1791. 'guaranteePeriodUnitCode',
  1792. item.warrantyPeriodUnit ? item.warrantyPeriodUnit + '' : ''
  1793. );
  1794. if (item.warrantyPeriod && item.warrantyPeriodUnit) {
  1795. this.$set(
  1796. parasm,
  1797. 'guaranteePeriodDeadline',
  1798. this.setDay(
  1799. item.warrantyPeriod,
  1800. this.guaranteePeriodUnit(item.warrantyPeriodUnit),
  1801. {}
  1802. )
  1803. );
  1804. }
  1805. this.$set(
  1806. parasm,
  1807. 'packageDispositionList',
  1808. item.packageDispositionList
  1809. );
  1810. if (item.packageDispositionList?.length) {
  1811. this.$set(
  1812. parasm,
  1813. this.countObj.unitIdKey,
  1814. item.packageDispositionList[0].id
  1815. );
  1816. this.$set(
  1817. parasm,
  1818. this.countObj.unitKey,
  1819. item.packageDispositionList[0].conversionUnit
  1820. );
  1821. }
  1822. this.$set(parasm, 'arrivalWay', item.arrivalWay || 1);
  1823. this.$set(parasm, 'imgCode', item.imgCode);
  1824. this.$set(parasm, 'produceType', item.componentAttribute);
  1825. if (this.isOrderNo) {
  1826. this.$set(parasm, 'orderNo', this.orderOption[0]?.orderNo);
  1827. this.$set(parasm, 'orderId', this.orderOption[0]?.orderId);
  1828. }
  1829. if (this.isGoods && item.goodsId) {
  1830. this.$set(parasm, 'goodsId', item.goodsId);
  1831. this.$set(parasm, 'goodsPriceId', item.goodsPriceId);
  1832. this.$set(parasm, 'goodsPriceType', item.goodsPriceType);
  1833. this.$set(parasm, 'singlePrice', item.singlePrice);
  1834. this.$set(parasm, 'notaxSinglePrice', item.notaxSinglePrice);
  1835. this.$set(parasm, 'taxRate', item.taxRate);
  1836. this.$set(parasm, 'discountSinglePrice', item.singlePrice);
  1837. this.$set(parasm, 'totalCount', '');
  1838. }
  1839. if (this.isSupplier) {
  1840. this.$set(
  1841. parasm,
  1842. 'entrustedEnterpriseIdList',
  1843. item.entrustedEnterpriseIdList
  1844. );
  1845. this.$set(
  1846. parasm,
  1847. 'entrustedEnterpriseId',
  1848. item.entrustedEnterpriseId
  1849. );
  1850. }
  1851. this.$set(parasm, 'approvalNumber', item.extField?.approvalNumber);
  1852. this.$set(
  1853. parasm,
  1854. 'packingSpecification',
  1855. item.extField.packingSpecification
  1856. );
  1857. this.$set(parasm, 'customerMark', this.customerMark);
  1858. if (item.purchaseOrigins?.length > 0) {
  1859. item.purchaseOrigins = item.purchaseOrigins.map((val) => val + '');
  1860. }
  1861. this.$set(parasm, 'provenance', item.purchaseOrigins || []);
  1862. if (idx == -1) {
  1863. this.form.datasource.push(row);
  1864. }
  1865. });
  1866. this.changeCount();
  1867. },
  1868. replaceTable(obj, idx) {
  1869. obj.forEach(async (item, index) => {
  1870. let i = idx == -1 ? index : idx;
  1871. let row = JSON.parse(JSON.stringify(this.defaultForm));
  1872. row.key = this.form.datasource.length + 1;
  1873. let parasm = idx == -1 ? row : this.form.datasource[i];
  1874. this.$set(parasm, 'customerMark', this.customerMark);
  1875. this.$set(parasm, 'productId', item.productId);
  1876. this.$set(parasm, 'categoryName', item.productName);
  1877. this.$set(parasm, 'productCategoryId', item.categoryLevelId);
  1878. this.$set(parasm, 'productBrand', item.productBrand);
  1879. this.$set(parasm, 'productCategoryName', item.categoryLevelPath);
  1880. this.$set(parasm, 'productCode', item.productCode);
  1881. this.$set(parasm, 'productName', item.productName);
  1882. this.$set(parasm, 'modelType', item.categoryModel);
  1883. this.$set(parasm, 'availableCountBase', item.measureQuantity);
  1884. this.$set(parasm, 'measuringUnit', item.measuringUnit);
  1885. this.$set(parasm, 'specification', item.specification);
  1886. this.$set(parasm, 'weightUnit', item.weightUnit);
  1887. this.$set(parasm, 'singleWeight', item.weight);
  1888. this.$set(parasm, 'pricingWay', 1);
  1889. this.$set(parasm, 'arrivalWay', item.arrivalWay || 1);
  1890. this.$set(parasm, 'batchNo', item.batchNo);
  1891. this.$set(parasm, 'imgCode', '');
  1892. this.$set(parasm, 'produceType', item.componentAttribute);
  1893. let goodsData = await getGoodsByCategoryId(item.productId);
  1894. goodsData = goodsData.filter((item) => item.approvalStatus == 2);
  1895. if (goodsData?.length) {
  1896. let goodsPriceList = goodsData[0]?.goodsPriceList[0];
  1897. this.$set(parasm, 'goodsId', goodsData[0].id);
  1898. this.$set(parasm, 'goodsPriceId', goodsPriceList.id);
  1899. this.$set(parasm, 'goodsPriceType', goodsPriceList.priceType);
  1900. this.$set(parasm, 'singlePrice', goodsPriceList.unitPrice);
  1901. this.$set(
  1902. parasm,
  1903. 'notaxSinglePrice',
  1904. goodsPriceList.excludeTaxPrice
  1905. );
  1906. this.$set(parasm, 'taxRate', goodsPriceList.taxRate);
  1907. this.$set(parasm, 'discountSinglePrice', goodsPriceList.unitPrice);
  1908. this.$set(parasm, 'totalCount', '');
  1909. }
  1910. if (item.modelKey) {
  1911. this.$set(parasm, 'modelKey', item.modelKey.split(','));
  1912. }
  1913. if (item.colorKey) {
  1914. this.$set(parasm, 'colorKey', item.colorKey.split(','));
  1915. }
  1916. if (this.isSupplier) {
  1917. this.$set(
  1918. parasm,
  1919. 'entrustedEnterpriseIdList',
  1920. item.entrustedEnterpriseIdList
  1921. );
  1922. this.$set(
  1923. parasm,
  1924. 'entrustedEnterpriseId',
  1925. item.entrustedEnterpriseId
  1926. );
  1927. }
  1928. this.$set(parasm, 'approvalNumber', item.extField?.approvalNumber);
  1929. this.$set(
  1930. parasm,
  1931. 'packingSpecification',
  1932. item.extField.packingSpecification
  1933. );
  1934. this.$set(
  1935. parasm,
  1936. 'packageDispositionList',
  1937. item.packageDispositionList
  1938. );
  1939. if (item.packageDispositionList?.length) {
  1940. this.$set(
  1941. parasm,
  1942. this.countObj.unitIdKey,
  1943. item.packageDispositionList[0].id
  1944. );
  1945. this.$set(
  1946. parasm,
  1947. this.countObj.unitKey,
  1948. item.packageDispositionList[0].conversionUnit
  1949. );
  1950. }
  1951. this.$set(parasm, 'customerMark', this.customerMark);
  1952. if (item.purchaseOrigins?.length > 0) {
  1953. item.purchaseOrigins = item.purchaseOrigins.map((val) => val + '');
  1954. }
  1955. this.$set(parasm, 'provenance', item.purchaseOrigins || []);
  1956. if (idx == -1) {
  1957. this.form.datasource.push(row);
  1958. }
  1959. });
  1960. },
  1961. remove(index) {
  1962. this.form.datasource.splice(index, 1);
  1963. this.setSort();
  1964. this.changeAll();
  1965. },
  1966. // 重新排序
  1967. setSort() {
  1968. this.form.datasource.forEach((n, index) => {
  1969. n.key = index + 1;
  1970. });
  1971. },
  1972. // 添加
  1973. handlAdd() {
  1974. let item = JSON.parse(JSON.stringify(this.defaultForm));
  1975. item.key = this.form.datasource.length + 1;
  1976. item.customerMark = this.customerMark;
  1977. this.form.datasource.push(item);
  1978. },
  1979. validateForm(callback) {
  1980. // let singleWeightData = {};
  1981. // this.form.datasource.forEach((item) => {
  1982. // if (item.pricingWay == 2 && !item.singleWeight) {
  1983. // singleWeightData['name'] = item.productName;
  1984. // console.log(singleWeightData, 'singleWeightData');
  1985. // }
  1986. // });
  1987. // if (singleWeightData.name) {
  1988. // this.$message.warning(
  1989. // singleWeightData.name + '计价方式为按重量计费,单重不能为空'
  1990. // );
  1991. // callback(false);
  1992. // }
  1993. //开始表单校验
  1994. this.$refs.form.validate((valid, obj) => {
  1995. if (obj) {
  1996. let messages = Object.keys(obj).map((key) => obj[key][0]);
  1997. if (messages.length > 0) {
  1998. this.$message.warning(messages[0].message);
  1999. }
  2000. }
  2001. callback(valid);
  2002. });
  2003. },
  2004. goodsPriceTypeChange(row, index) {
  2005. if (row.goodsId) {
  2006. getGoodsPriceByCondition({
  2007. id: row.goodsId,
  2008. priceType: row.goodsPriceType
  2009. }).then((res) => {
  2010. if (res.id) {
  2011. this.$set(this.form.datasource[index], 'goodsPriceId', res.id);
  2012. this.$set(
  2013. this.form.datasource[index],
  2014. 'goodsPriceType',
  2015. res.priceType
  2016. );
  2017. this.$set(
  2018. this.form.datasource[index],
  2019. 'singlePrice',
  2020. res.unitPrice
  2021. );
  2022. this.$set(
  2023. this.form.datasource[index],
  2024. 'notaxSinglePrice',
  2025. res.excludeTaxPrice
  2026. );
  2027. this.$set(this.form.datasource[index], 'taxRate', res.taxRate);
  2028. this.$set(
  2029. this.form.datasource[index],
  2030. 'discountSinglePrice',
  2031. res.unitPrice
  2032. );
  2033. }
  2034. this.changeCount(row, index);
  2035. });
  2036. }
  2037. },
  2038. save() {
  2039. this.$emit('save');
  2040. }
  2041. }
  2042. };
  2043. </script>
  2044. <style lang="scss" scoped>
  2045. .headbox {
  2046. display: flex;
  2047. justify-content: space-between;
  2048. align-items: center;
  2049. .amount {
  2050. font-size: 14px;
  2051. font-weight: bold;
  2052. padding-right: 30px;
  2053. }
  2054. }
  2055. .time-form .el-form-item {
  2056. margin-bottom: 0 !important;
  2057. }
  2058. ::v-deep .period {
  2059. display: flex;
  2060. .borderleftnone {
  2061. .el-input--medium .el-input__inner {
  2062. border-top-right-radius: 0;
  2063. border-bottom-right-radius: 0;
  2064. }
  2065. }
  2066. .borderrightnone {
  2067. .el-input--medium .el-input__inner {
  2068. border-top-left-radius: 0;
  2069. border-bottom-left-radius: 0;
  2070. }
  2071. }
  2072. }
  2073. ::v-deep .time-form tbody > tr:hover > td {
  2074. background-color: transparent !important;
  2075. }
  2076. ::v-deep .time-form .el-table tr {
  2077. background-color: #ffffff;
  2078. }
  2079. .pricebox {
  2080. display: flex;
  2081. justify-content: flex-start;
  2082. align-items: center;
  2083. font-weight: bold;
  2084. }
  2085. </style>