inventoryTable.vue 65 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153
  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. isQueryEE: 1
  1467. });
  1468. } else {
  1469. return Promise.resolve({});
  1470. }
  1471. } catch (e) {
  1472. return Promise.resolve({});
  1473. }
  1474. },
  1475. setDeliveryDays(row, index, type, isAll) {
  1476. if (isAll) {
  1477. this.form.datasource.forEach((item, i) => {
  1478. let guaranteePeriodUnitName = this.guaranteePeriodUnit(
  1479. item.guaranteePeriodUnitCode
  1480. );
  1481. this.$set(
  1482. this.form.datasource[i],
  1483. 'guaranteePeriodDeadline',
  1484. guaranteePeriodUnitName != 'second'
  1485. ? this.setDay(
  1486. item.guaranteePeriod,
  1487. guaranteePeriodUnitName,
  1488. item
  1489. )
  1490. : ''
  1491. );
  1492. // }
  1493. });
  1494. return;
  1495. }
  1496. if (type == 'guaranteePeriod') {
  1497. let guaranteePeriodUnitName = this.guaranteePeriodUnit(
  1498. row.guaranteePeriodUnitCode
  1499. );
  1500. this.$set(
  1501. this.form.datasource[index],
  1502. 'guaranteePeriodDeadline',
  1503. guaranteePeriodUnitName != 'second'
  1504. ? this.setDay(row.guaranteePeriod, guaranteePeriodUnitName, row)
  1505. : ''
  1506. );
  1507. }
  1508. },
  1509. guaranteePeriodUnit(code) {
  1510. return code == 3
  1511. ? 'day'
  1512. : code == 4
  1513. ? 'month'
  1514. : code == 5
  1515. ? 'year'
  1516. : 'second';
  1517. },
  1518. setDay(addDay, dateType = 'day', item) {
  1519. let tiem =
  1520. this.contractBookType == 1
  1521. ? item.produceDeliveryDeadline
  1522. : item.customerExpectDeliveryDeadline;
  1523. return dayjs(tiem || new Date())
  1524. .add(addDay, dateType)
  1525. .format('YYYY-MM-DD');
  1526. },
  1527. // 返回列表数据
  1528. getTableValue() {
  1529. let comitDatasource = copyObj(this.form.datasource);
  1530. // console.log(comitDatasource)
  1531. // console.log(this.form.datasource)
  1532. // return
  1533. if (comitDatasource.length === 0) return [];
  1534. comitDatasource.forEach((v) => {
  1535. if (v.guaranteePeriodUnitCode) {
  1536. v.guaranteePeriodUnitName = this.getDictValue(
  1537. '保质期单位',
  1538. v.guaranteePeriodUnitCode
  1539. );
  1540. }
  1541. if (v.modelKey) {
  1542. v.modelKey = v.modelKey.toString();
  1543. }
  1544. if (v.colorKey) {
  1545. v.colorKey = v.colorKey.toString();
  1546. }
  1547. v.technicalDrawings = v.technicalDrawings ? v.technicalDrawings : [];
  1548. v.customerReqFiles = v.customerReqFiles || [];
  1549. v.industryArtFiles = v.industryArtFiles || [];
  1550. v.otherFiles = v.otherFiles || [];
  1551. });
  1552. return comitDatasource;
  1553. },
  1554. getPrice() {
  1555. return [this.allPrice, this.form.discountTotalPrice];
  1556. },
  1557. //改变数量
  1558. changeCount(row, index) {
  1559. if (!row) {
  1560. this.form.datasource.forEach((item, index) => {
  1561. this.$set(
  1562. this.form,
  1563. 'datasource[' + index + ']',
  1564. changeCount(item, this.countObj)
  1565. );
  1566. });
  1567. } else {
  1568. this.$set(
  1569. this.form,
  1570. 'datasource[' + index + ']',
  1571. changeCount(row, this.countObj)
  1572. );
  1573. }
  1574. this.getNotaxSinglePrice();
  1575. this.changeAll();
  1576. this.$forceUpdate();
  1577. },
  1578. changeAll() {
  1579. this.allPrice = getAllPrice(this.form.datasource) || 0;
  1580. if (this.isDiscountTotalPrice) {
  1581. this.form.discountTotalPrice = this.allPrice;
  1582. this.$emit('setDiscountTotalPrice', this.allPrice);
  1583. }
  1584. this.$emit('setCountAmount', this.allPrice);
  1585. },
  1586. setCustomerMark(customerMark) {
  1587. this.form.datasource.forEach((item) => {
  1588. item['customerMark'] = customerMark;
  1589. this.$forceUpdate();
  1590. });
  1591. },
  1592. //计算不含税单价
  1593. getNotaxSinglePrice() {
  1594. this.form.datasource.forEach((item, index) => {
  1595. if (item.singlePrice && item.taxRate) {
  1596. this.$set(
  1597. this.form.datasource[index],
  1598. 'notaxSinglePrice',
  1599. parseFloat(
  1600. (item.singlePrice / (1 + item.taxRate / 100)).toFixed(2)
  1601. )
  1602. );
  1603. } else {
  1604. this.$set(this.form.datasource[index], 'notaxSinglePrice', '');
  1605. }
  1606. });
  1607. },
  1608. //设置优惠后总金额修改产品单价
  1609. discountInputByOrder(val) {
  1610. this.form.discountTotalPrice = val;
  1611. // //获取优惠金额和总计的差价
  1612. this.form.datasource.forEach((item, index) => {
  1613. //获取折让单价
  1614. this.$set(
  1615. this.form.datasource[index],
  1616. 'discountSinglePrice',
  1617. this.getDiscountSinglePrice(item)
  1618. );
  1619. this.$set(
  1620. this.form.datasource[index],
  1621. 'discountTotalPrice',
  1622. this.getDiscountTotalPrice(item)
  1623. );
  1624. });
  1625. this.$emit('setDiscountTotalPrice', val);
  1626. this.$forceUpdate();
  1627. this.$refs.table.reRenderTable();
  1628. },
  1629. setAllValueChange({ key, value }) {
  1630. let indexS = this.selection.map((item) => item.key - 1);
  1631. indexS.forEach((i) => {
  1632. this.$set(this.form.datasource[i], key, value);
  1633. this.setDeliveryDays(this.form.datasource[i], i, 'guaranteePeriod');
  1634. });
  1635. },
  1636. //获取折让单价
  1637. getDiscountSinglePrice(row) {
  1638. let num =
  1639. (Number(this.form.discountTotalPrice) / Number(this.allPrice)) *
  1640. Number(row.singlePrice);
  1641. console.log(num, 'num');
  1642. return isNaN(num) ? '' : num;
  1643. },
  1644. //获取折让合计
  1645. getDiscountTotalPrice(row) {
  1646. let num = 0;
  1647. num = Number(row.discountSinglePrice) * Number(row.totalCount);
  1648. return isNaN(num) ? '' : num.toFixed(2);
  1649. },
  1650. orderNoChange(row, item) {
  1651. row['orderId'] = item.orderId;
  1652. },
  1653. //修改回显
  1654. async putTableValue(data) {
  1655. let productList =
  1656. (data &&
  1657. (data.quoteProductList || data.productList || data.detailList)) ||
  1658. [];
  1659. if (productList) {
  1660. let supplierObj = await this.getSupplierObj(productList, 'productId');
  1661. productList.forEach((item, index) => {
  1662. item['key'] = index + 1;
  1663. if (item.modelKey) {
  1664. item.modelKey = item.modelKey.split(',');
  1665. }
  1666. if (item.colorKey) {
  1667. item.colorKey = item.colorKey.split(',');
  1668. }
  1669. item.pricingWay =
  1670. item.pricingWay ||
  1671. data.pricingWay ||
  1672. data?.contractVO?.pricingWay;
  1673. item.guaranteePeriodUnitCode = item.guaranteePeriodUnitCode
  1674. ? item.guaranteePeriodUnitCode + ''
  1675. : '';
  1676. let guaranteePeriodUnitName = this.guaranteePeriodUnit(
  1677. item.guaranteePeriodUnitCode
  1678. );
  1679. if (item.guaranteePeriod && item.guaranteePeriodUnitCode) {
  1680. item['guaranteePeriodDeadline'] =
  1681. item['guaranteePeriodDeadline'] ||
  1682. guaranteePeriodUnitName != 'second'
  1683. ? this.setDay(
  1684. item.guaranteePeriod,
  1685. guaranteePeriodUnitName,
  1686. item
  1687. )
  1688. : '';
  1689. }
  1690. item.entrustedEnterpriseIdList = supplierObj[item.productId];
  1691. if (supplierObj[item.productId]?.length === 1) {
  1692. item.entrustedEnterpriseId = supplierObj[item.productId][0].id;
  1693. }
  1694. item['customerMark'] = item.customerMark || this.customerMark;
  1695. item['arrivalWay'] = item.arrivalWay || 1;
  1696. });
  1697. this.form.datasource = productList;
  1698. let codeList = this.form.datasource
  1699. .filter((item) => item.productCode)
  1700. .map((item) => item.productCode);
  1701. //获取仓库库存
  1702. let inventoryTotalList = await getInventoryTotalAPI(codeList);
  1703. this.form.datasource
  1704. .filter((item) => item.productCode)
  1705. .forEach((item, index) => {
  1706. let find =
  1707. inventoryTotalList.find(
  1708. (key) => key.code == item.productCode
  1709. ) || {};
  1710. this.form.datasource;
  1711. this.$set(
  1712. this.form.datasource[index],
  1713. 'availableCountBase',
  1714. find.availableCountBase
  1715. );
  1716. });
  1717. if (this.isChangeCount) {
  1718. this.changeCount();
  1719. } else {
  1720. this.allPrice = data.totalAmount || data?.contractVO?.totalPrice;
  1721. }
  1722. if (this.isDiscountTotalPrice) {
  1723. this.form.discountTotalPrice =
  1724. data.payAmount || data?.contractVO?.discountTotalPrice;
  1725. }
  1726. this.$refs.table.reload();
  1727. }
  1728. },
  1729. //计算单重
  1730. //选择产品
  1731. handParent(row, index) {
  1732. let item = {
  1733. id: row?.productCode
  1734. };
  1735. if (row?.goodsId) {
  1736. this.handGoods(index);
  1737. return;
  1738. }
  1739. if (this.needProduce == 1 || this.needProduce == 2) {
  1740. this.$refs.productListRef.open(item, index);
  1741. } else {
  1742. this.$refs.selectStockLedgerDialogRef.open(item, index);
  1743. }
  1744. },
  1745. handGoods(index) {
  1746. this.$refs.commodityPriceListDialogRef.open(index);
  1747. },
  1748. //选择技术人回调
  1749. changeAnswer(obj, idx) {
  1750. this.$set(this.form.datasource[idx], 'technicalAnswerId', obj.id);
  1751. this.$set(this.form.datasource[idx], 'technicalAnswerName', obj.name);
  1752. },
  1753. handHead(row, index) {
  1754. let item = {
  1755. id: row.technicalAnswerId
  1756. };
  1757. this.$refs.headRef.open(item, index);
  1758. },
  1759. //选择产品回调
  1760. changeParent(obj, idx) {
  1761. obj.forEach((item, index) => {
  1762. let i = idx == -1 ? index : idx;
  1763. let row = JSON.parse(JSON.stringify(this.defaultForm));
  1764. row.key = this.form.datasource.length + 1;
  1765. let parasm = idx == -1 ? row : this.form.datasource[i];
  1766. console.log(this.defTaxRate, 'this.defTaxRate');
  1767. this.$set(parasm, 'taxRate', this.defTaxRate);
  1768. this.$set(parasm, 'productId', item.id);
  1769. this.$set(parasm, 'categoryName', item.name);
  1770. this.$set(parasm, 'productCategoryId', item.categoryLevelId);
  1771. this.$set(parasm, 'productBrand', item.brandNum);
  1772. this.$set(parasm, 'productCategoryName', item.categoryLevelPath);
  1773. this.$set(parasm, 'productCode', item.code);
  1774. this.$set(parasm, 'productName', item.name);
  1775. this.$set(parasm, 'modelType', item.modelType);
  1776. this.$set(parasm, 'availableCountBase', item.availableCountBase);
  1777. this.$set(parasm, 'measuringUnit', item.measuringUnit);
  1778. this.$set(parasm, 'specification', item.specification);
  1779. this.$set(parasm, 'weightUnit', item.weightUnit);
  1780. this.$set(parasm, 'singleWeight', item.netWeight);
  1781. this.$set(parasm, 'pricingWay', 1);
  1782. this.$set(parasm, 'goodsLevel', item.goodsLevel);
  1783. this.$set(parasm, 'guaranteePeriod', item.warrantyPeriod);
  1784. if (item.modelKey) {
  1785. this.$set(parasm, 'modelKey', item.modelKey.split(','));
  1786. }
  1787. if (item.colorKey) {
  1788. this.$set(parasm, 'colorKey', item.colorKey.split(','));
  1789. }
  1790. this.$set(
  1791. parasm,
  1792. 'guaranteePeriodUnitCode',
  1793. item.warrantyPeriodUnit ? item.warrantyPeriodUnit + '' : ''
  1794. );
  1795. if (item.warrantyPeriod && item.warrantyPeriodUnit) {
  1796. this.$set(
  1797. parasm,
  1798. 'guaranteePeriodDeadline',
  1799. this.setDay(
  1800. item.warrantyPeriod,
  1801. this.guaranteePeriodUnit(item.warrantyPeriodUnit),
  1802. {}
  1803. )
  1804. );
  1805. }
  1806. this.$set(
  1807. parasm,
  1808. 'packageDispositionList',
  1809. item.packageDispositionList
  1810. );
  1811. if (item.packageDispositionList?.length) {
  1812. this.$set(
  1813. parasm,
  1814. this.countObj.unitIdKey,
  1815. item.packageDispositionList[0].id
  1816. );
  1817. this.$set(
  1818. parasm,
  1819. this.countObj.unitKey,
  1820. item.packageDispositionList[0].conversionUnit
  1821. );
  1822. }
  1823. this.$set(parasm, 'arrivalWay', item.arrivalWay || 1);
  1824. this.$set(parasm, 'imgCode', item.imgCode);
  1825. this.$set(parasm, 'produceType', item.componentAttribute);
  1826. if (this.isOrderNo) {
  1827. this.$set(parasm, 'orderNo', this.orderOption[0]?.orderNo);
  1828. this.$set(parasm, 'orderId', this.orderOption[0]?.orderId);
  1829. }
  1830. if (this.isGoods && item.goodsId) {
  1831. this.$set(parasm, 'goodsId', item.goodsId);
  1832. this.$set(parasm, 'goodsPriceId', item.goodsPriceId);
  1833. this.$set(parasm, 'goodsPriceType', item.goodsPriceType);
  1834. this.$set(parasm, 'singlePrice', item.singlePrice);
  1835. this.$set(parasm, 'notaxSinglePrice', item.notaxSinglePrice);
  1836. this.$set(parasm, 'taxRate', item.taxRate);
  1837. this.$set(parasm, 'discountSinglePrice', item.singlePrice);
  1838. this.$set(parasm, 'totalCount', '');
  1839. }
  1840. if (this.isSupplier) {
  1841. this.$set(
  1842. parasm,
  1843. 'entrustedEnterpriseIdList',
  1844. item.entrustedEnterpriseIdList
  1845. );
  1846. this.$set(
  1847. parasm,
  1848. 'entrustedEnterpriseId',
  1849. item.entrustedEnterpriseId
  1850. );
  1851. }
  1852. this.$set(parasm, 'approvalNumber', item.extField?.approvalNumber);
  1853. this.$set(
  1854. parasm,
  1855. 'packingSpecification',
  1856. item.extField.packingSpecification
  1857. );
  1858. this.$set(parasm, 'customerMark', this.customerMark);
  1859. if (item.purchaseOrigins?.length > 0) {
  1860. item.purchaseOrigins = item.purchaseOrigins.map((val) => val + '');
  1861. }
  1862. this.$set(parasm, 'provenance', item.purchaseOrigins || []);
  1863. if (idx == -1) {
  1864. this.form.datasource.push(row);
  1865. }
  1866. });
  1867. this.changeCount();
  1868. },
  1869. replaceTable(obj, idx) {
  1870. obj.forEach(async (item, index) => {
  1871. let i = idx == -1 ? index : idx;
  1872. let row = JSON.parse(JSON.stringify(this.defaultForm));
  1873. row.key = this.form.datasource.length + 1;
  1874. let parasm = idx == -1 ? row : this.form.datasource[i];
  1875. this.$set(parasm, 'customerMark', this.customerMark);
  1876. this.$set(parasm, 'productId', item.productId);
  1877. this.$set(parasm, 'categoryName', item.productName);
  1878. this.$set(parasm, 'productCategoryId', item.categoryLevelId);
  1879. this.$set(parasm, 'productBrand', item.productBrand);
  1880. this.$set(parasm, 'productCategoryName', item.categoryLevelPath);
  1881. this.$set(parasm, 'productCode', item.productCode);
  1882. this.$set(parasm, 'productName', item.productName);
  1883. this.$set(parasm, 'modelType', item.categoryModel);
  1884. this.$set(parasm, 'availableCountBase', item.measureQuantity);
  1885. this.$set(parasm, 'measuringUnit', item.measuringUnit);
  1886. this.$set(parasm, 'specification', item.specification);
  1887. this.$set(parasm, 'weightUnit', item.weightUnit);
  1888. this.$set(parasm, 'singleWeight', item.weight);
  1889. this.$set(parasm, 'pricingWay', 1);
  1890. this.$set(parasm, 'arrivalWay', item.arrivalWay || 1);
  1891. this.$set(parasm, 'batchNo', item.batchNo);
  1892. this.$set(parasm, 'imgCode', '');
  1893. this.$set(parasm, 'produceType', item.componentAttribute);
  1894. let goodsData = await getGoodsByCategoryId(item.productId);
  1895. goodsData = goodsData.filter((item) => item.approvalStatus == 2);
  1896. if (goodsData?.length) {
  1897. let goodsPriceList = goodsData[0]?.goodsPriceList[0];
  1898. this.$set(parasm, 'goodsId', goodsData[0].id);
  1899. this.$set(parasm, 'goodsPriceId', goodsPriceList.id);
  1900. this.$set(parasm, 'goodsPriceType', goodsPriceList.priceType);
  1901. this.$set(parasm, 'singlePrice', goodsPriceList.unitPrice);
  1902. this.$set(
  1903. parasm,
  1904. 'notaxSinglePrice',
  1905. goodsPriceList.excludeTaxPrice
  1906. );
  1907. this.$set(parasm, 'taxRate', goodsPriceList.taxRate);
  1908. this.$set(parasm, 'discountSinglePrice', goodsPriceList.unitPrice);
  1909. this.$set(parasm, 'totalCount', '');
  1910. }
  1911. if (item.modelKey) {
  1912. this.$set(parasm, 'modelKey', item.modelKey.split(','));
  1913. }
  1914. if (item.colorKey) {
  1915. this.$set(parasm, 'colorKey', item.colorKey.split(','));
  1916. }
  1917. if (this.isSupplier) {
  1918. this.$set(
  1919. parasm,
  1920. 'entrustedEnterpriseIdList',
  1921. item.entrustedEnterpriseIdList
  1922. );
  1923. this.$set(
  1924. parasm,
  1925. 'entrustedEnterpriseId',
  1926. item.entrustedEnterpriseId
  1927. );
  1928. }
  1929. this.$set(parasm, 'approvalNumber', item.extField?.approvalNumber);
  1930. this.$set(
  1931. parasm,
  1932. 'packingSpecification',
  1933. item.extField.packingSpecification
  1934. );
  1935. this.$set(
  1936. parasm,
  1937. 'packageDispositionList',
  1938. item.packageDispositionList
  1939. );
  1940. if (item.packageDispositionList?.length) {
  1941. this.$set(
  1942. parasm,
  1943. this.countObj.unitIdKey,
  1944. item.packageDispositionList[0].id
  1945. );
  1946. this.$set(
  1947. parasm,
  1948. this.countObj.unitKey,
  1949. item.packageDispositionList[0].conversionUnit
  1950. );
  1951. }
  1952. this.$set(parasm, 'customerMark', this.customerMark);
  1953. if (item.purchaseOrigins?.length > 0) {
  1954. item.purchaseOrigins = item.purchaseOrigins.map((val) => val + '');
  1955. }
  1956. this.$set(parasm, 'provenance', item.purchaseOrigins || []);
  1957. if (idx == -1) {
  1958. this.form.datasource.push(row);
  1959. }
  1960. });
  1961. },
  1962. remove(index) {
  1963. this.form.datasource.splice(index, 1);
  1964. this.setSort();
  1965. this.changeAll();
  1966. },
  1967. // 重新排序
  1968. setSort() {
  1969. this.form.datasource.forEach((n, index) => {
  1970. n.key = index + 1;
  1971. });
  1972. },
  1973. // 添加
  1974. handlAdd() {
  1975. let item = JSON.parse(JSON.stringify(this.defaultForm));
  1976. item.key = this.form.datasource.length + 1;
  1977. item.customerMark = this.customerMark;
  1978. this.form.datasource.push(item);
  1979. },
  1980. validateForm(callback) {
  1981. // let singleWeightData = {};
  1982. // this.form.datasource.forEach((item) => {
  1983. // if (item.pricingWay == 2 && !item.singleWeight) {
  1984. // singleWeightData['name'] = item.productName;
  1985. // console.log(singleWeightData, 'singleWeightData');
  1986. // }
  1987. // });
  1988. // if (singleWeightData.name) {
  1989. // this.$message.warning(
  1990. // singleWeightData.name + '计价方式为按重量计费,单重不能为空'
  1991. // );
  1992. // callback(false);
  1993. // }
  1994. //开始表单校验
  1995. this.$refs.form.validate((valid, obj) => {
  1996. if (obj) {
  1997. let messages = Object.keys(obj).map((key) => obj[key][0]);
  1998. if (messages.length > 0) {
  1999. this.$message.warning(messages[0].message);
  2000. }
  2001. }
  2002. callback(valid);
  2003. });
  2004. },
  2005. goodsPriceTypeChange(row, index) {
  2006. if (row.goodsId) {
  2007. getGoodsPriceByCondition({
  2008. id: row.goodsId,
  2009. priceType: row.goodsPriceType
  2010. }).then((res) => {
  2011. if (res.id) {
  2012. this.$set(this.form.datasource[index], 'goodsPriceId', res.id);
  2013. this.$set(
  2014. this.form.datasource[index],
  2015. 'goodsPriceType',
  2016. res.priceType
  2017. );
  2018. this.$set(
  2019. this.form.datasource[index],
  2020. 'singlePrice',
  2021. res.unitPrice
  2022. );
  2023. this.$set(
  2024. this.form.datasource[index],
  2025. 'notaxSinglePrice',
  2026. res.excludeTaxPrice
  2027. );
  2028. this.$set(this.form.datasource[index], 'taxRate', res.taxRate);
  2029. this.$set(
  2030. this.form.datasource[index],
  2031. 'discountSinglePrice',
  2032. res.unitPrice
  2033. );
  2034. }
  2035. this.changeCount(row, index);
  2036. });
  2037. }
  2038. },
  2039. save() {
  2040. this.$emit('save');
  2041. }
  2042. }
  2043. };
  2044. </script>
  2045. <style lang="scss" scoped>
  2046. .headbox {
  2047. display: flex;
  2048. justify-content: space-between;
  2049. align-items: center;
  2050. .amount {
  2051. font-size: 14px;
  2052. font-weight: bold;
  2053. padding-right: 30px;
  2054. }
  2055. }
  2056. .time-form .el-form-item {
  2057. margin-bottom: 0 !important;
  2058. }
  2059. ::v-deep .period {
  2060. display: flex;
  2061. .borderleftnone {
  2062. .el-input--medium .el-input__inner {
  2063. border-top-right-radius: 0;
  2064. border-bottom-right-radius: 0;
  2065. }
  2066. }
  2067. .borderrightnone {
  2068. .el-input--medium .el-input__inner {
  2069. border-top-left-radius: 0;
  2070. border-bottom-left-radius: 0;
  2071. }
  2072. }
  2073. }
  2074. ::v-deep .time-form tbody > tr:hover > td {
  2075. background-color: transparent !important;
  2076. }
  2077. ::v-deep .time-form .el-table tr {
  2078. background-color: #ffffff;
  2079. }
  2080. .pricebox {
  2081. display: flex;
  2082. justify-content: flex-start;
  2083. align-items: center;
  2084. font-weight: bold;
  2085. }
  2086. </style>