home_form.vue 66 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766
  1. <template>
  2. <div class="detail-container">
  3. <el-page-header :content="listItem ? '编辑' : '新增'" @back="goBack" />
  4. <div class="main-title">
  5. <div class="title">工程订单</div>
  6. </div>
  7. <el-form
  8. ref="mainForm"
  9. :model="mainForm"
  10. :rules="mainFormRules"
  11. label-width="125px"
  12. size="small"
  13. label-position="right"
  14. >
  15. <el-row :gutter="20">
  16. <el-col :xs="24" :sm="12" :lg="8">
  17. <el-form-item label="工程订单" prop="orderNum">
  18. <el-input v-model="mainForm.orderNum" placeholder="系统自动生成" disabled />
  19. </el-form-item>
  20. </el-col>
  21. <el-col :xs="24" :sm="12" :lg="8" style="height: 51px">
  22. <el-form-item label="单据日期" prop="orderDate">
  23. <el-date-picker
  24. v-model="mainForm.orderDate"
  25. disabled
  26. type="date"
  27. value-format="yyyy-MM-dd"
  28. style="width: 100%"
  29. placeholder="系统自动生成"
  30. />
  31. </el-form-item>
  32. </el-col>
  33. <el-col :xs="24" :sm="12" :lg="8">
  34. <el-form-item label="销售类型" prop="saleType">
  35. <el-select
  36. v-model="mainForm.saleType"
  37. placeholder="选择销售类型"
  38. style="width: 100%"
  39. filterable
  40. clearable
  41. @change="changeSaleType"
  42. >
  43. <el-option v-for="item in salesTypeList" :key="item.id" :label="item.saleName" :value="item.id" />
  44. </el-select>
  45. </el-form-item>
  46. </el-col>
  47. <el-col :xs="24" :sm="12" :lg="8">
  48. <el-form-item label="经销商编码" prop="jxsNum">
  49. <el-input v-model="mainForm.jxsNum" placeholder="请输入经销商编码" disabled />
  50. </el-form-item>
  51. </el-col>
  52. <el-col :xs="24" :sm="12" :lg="16">
  53. <el-form-item label="经销商名称" prop="jxsName">
  54. <el-input v-model="mainForm.jxsName" placeholder="请输入经销商名称" disabled />
  55. </el-form-item>
  56. </el-col>
  57. <el-col :xs="24" :sm="12" :lg="8">
  58. <el-form-item label="工程登录编号" prop="loginNum">
  59. <div style="display: flex">
  60. <el-input v-model="mainForm.loginNum" placeholder="请引用工程登录" disabled />
  61. <el-button style="margin-left: 10px" @click="openShareDetail">引用</el-button>
  62. </div>
  63. </el-form-item>
  64. </el-col>
  65. <el-col :xs="24" :sm="12" :lg="8">
  66. <el-form-item label="项目类别" prop="enginName">
  67. <el-input v-model="mainForm.enginName" placeholder="请输入项目类别" :disabled="isDealer" />
  68. </el-form-item>
  69. </el-col>
  70. <el-col :xs="24" :sm="12" :lg="8">
  71. <el-form-item label="行业类别" prop="loginType">
  72. <el-input v-model="mainForm.loginType" :disabled="isDealer" placeholder="请输入行业类别" />
  73. </el-form-item>
  74. </el-col>
  75. <el-col :xs="24" :sm="12" :lg="8">
  76. <el-form-item label="跨区厂编号" prop="factoryNum">
  77. <el-input v-model="mainForm.factoryNum" placeholder="请输入跨区厂编号" :disabled="isDealer" />
  78. </el-form-item>
  79. </el-col>
  80. <el-col :xs="24" :sm="12" :lg="8">
  81. <el-form-item label="使用单位" prop="company">
  82. <el-input v-model="mainForm.company" placeholder="请输入使用单位" :disabled="isDealer" />
  83. </el-form-item>
  84. </el-col>
  85. <el-col :xs="24" :sm="12" :lg="8">
  86. <el-form-item label="业务员" prop="salesMan">
  87. <el-select
  88. v-model="mainForm.salesMan"
  89. placeholder="选择业务员"
  90. size="small"
  91. filterable
  92. clearable
  93. style="width: 100%"
  94. >
  95. <el-option
  96. v-for="item in salesmanList"
  97. :key="item.adminUserId"
  98. :label="item.nickName"
  99. :value="item.adminUserId"
  100. />
  101. </el-select>
  102. </el-form-item>
  103. </el-col>
  104. <el-col :xs="24" :sm="12" :lg="8">
  105. <el-form-item label="引用记录" prop="refCount">
  106. <el-input v-model="mainForm.refCount" placeholder="请输入引用记录" :disabled="isDealer" />
  107. </el-form-item>
  108. </el-col>
  109. <el-col :xs="24" :sm="12" :lg="8">
  110. <el-form-item label="第几次申报" prop="declareNo">
  111. <el-input v-model="mainForm.declareNo" placeholder="请输入第几次申报" :disabled="isDealer" />
  112. </el-form-item>
  113. </el-col>
  114. <el-col :xs="24" :sm="12" :lg="8">
  115. <el-form-item label="项目类型" prop="projectType">
  116. <el-input v-model="mainForm.projectType" placeholder="请输入项目类型" :disabled="isDealer" />
  117. </el-form-item>
  118. </el-col>
  119. <el-col :xs="24" :sm="12" :lg="8">
  120. <el-form-item label="区域" prop="regionWork">
  121. <el-input v-model="mainForm.regionWork" placeholder="请输入区域" :disabled="isDealer" />
  122. </el-form-item>
  123. </el-col>
  124. <el-col :xs="24" :sm="12" :lg="8">
  125. <el-form-item label="文件编号" prop="fileNum">
  126. <el-input v-model="mainForm.fileNum" placeholder="请输入文件编号" :disabled="isDealer" />
  127. </el-form-item>
  128. </el-col>
  129. <el-col :xs="24" :sm="12" :lg="8">
  130. <el-form-item label="购买单位" prop="refBuyUnitName">
  131. <el-input v-model="mainForm.refBuyUnitName" placeholder="请输入购买单位" :disabled="isDealer" />
  132. </el-form-item>
  133. </el-col>
  134. <el-col :xs="24" :sm="12" :lg="8">
  135. <el-form-item label="联系人" prop="contactMan">
  136. <el-input v-model="mainForm.contactMan" placeholder="请输入联系人" />
  137. </el-form-item>
  138. </el-col>
  139. <el-col :xs="24" :sm="12" :lg="8">
  140. <el-form-item label="固定电话" prop="tel">
  141. <el-input v-model="mainForm.tel" placeholder="请输入固定电话" />
  142. </el-form-item>
  143. </el-col>
  144. <el-col :xs="24" :sm="12" :lg="8">
  145. <el-form-item label="移动电话" prop="phone">
  146. <el-input v-model="mainForm.phone" placeholder="请输入移动电话" />
  147. </el-form-item>
  148. </el-col>
  149. <el-col :xs="24" :sm="16" :lg="16">
  150. <el-form-item label="安装地址" prop="address">
  151. <el-input v-model="mainForm.address" placeholder="请输入安装地址" :disabled="isDealer" />
  152. </el-form-item>
  153. </el-col>
  154. <el-col :xs="24" :sm="8" :lg="8">
  155. <el-form-item label="保证函" prop="refPromiseProvide">
  156. <el-select
  157. v-model="mainForm.refPromiseProvide"
  158. placeholder="选择保证函状态"
  159. :disabled="isDealer ? true : false"
  160. size="small"
  161. clearable
  162. style="width: 100%"
  163. >
  164. <el-option label="未保证" value="未保证" />
  165. <el-option label="已保证" value="已保证" />
  166. </el-select>
  167. </el-form-item>
  168. </el-col>
  169. <el-col :xs="24" :sm="24" :lg="24">
  170. <el-form-item label="项目说明" prop="projectRemark">
  171. <el-input v-model="mainForm.projectRemark" placeholder="请输入项目说明" :disabled="isDealer" />
  172. </el-form-item>
  173. </el-col>
  174. <el-col :xs="24" :sm="24" :lg="24">
  175. <el-form-item label="其他附件审批意见" prop="refOtherAnnexIdea">
  176. <el-input v-model="mainForm.refOtherAnnexIdea" placeholder="请输入其他附件审批意见" disabled />
  177. </el-form-item>
  178. </el-col>
  179. <el-col v-if="!isDealer" :xs="24" :sm="24" :lg="24">
  180. <el-form-item label="格力内部备注" prop="greeRemark">
  181. <el-input v-model="mainForm.greeRemark" placeholder="请输入格力内部备注" />
  182. </el-form-item>
  183. </el-col>
  184. <!-- <el-col :xs="24" :sm="24" :lg="24">
  185. <el-form-item label="格力回复" prop="greeReply">
  186. <el-input v-model="mainForm.greeReply" placeholder="请输入格力回复"></el-input>
  187. </el-form-item>
  188. </el-col> -->
  189. <el-col :xs="24" :sm="24" :lg="24">
  190. <el-form-item label="备注" prop="remark">
  191. <el-input v-model="mainForm.remark" placeholder="请输入备注" />
  192. </el-form-item>
  193. </el-col>
  194. <el-col :xs="24" :sm="12" :lg="8">
  195. <el-form-item label="制单人" prop="createMan">
  196. <el-input v-model="mainForm.createMan" placeholder="请输入制单人" disabled />
  197. </el-form-item>
  198. </el-col>
  199. <el-col :xs="24" :sm="12" :lg="8" style="height: 51px">
  200. <el-form-item label="制单日期" prop="createDate">
  201. <el-date-picker
  202. v-model="mainForm.createDate"
  203. disabled
  204. type="date"
  205. :default-value="getDate()"
  206. value-format="yyyy-MM-dd"
  207. style="width: 100%"
  208. placeholder="选择日期"
  209. />
  210. </el-form-item>
  211. </el-col>
  212. <el-col v-if="mainForm.examineRemark" :xs="24" :sm="24" :lg="24">
  213. <el-form-item label="审批说明" prop="examineRemark">
  214. <el-input v-model="mainForm.examineRemark" placeholder="请输入审批说明" disabled />
  215. </el-form-item>
  216. </el-col>
  217. </el-row>
  218. </el-form>
  219. <div class="main-title">
  220. <div class="title">货品信息</div>
  221. <div>
  222. <el-select v-model="warehouseValue" placeholder="请选择发货仓库" size="small" style="margin-right: 10px">
  223. <el-option v-for="(item, index) in warehouseList" :key="index" :label="item.name" :value="item.id" />
  224. </el-select>
  225. <el-button type="primary" size="small" icon="el-icon-search" @click="checkStock">检查库存</el-button>
  226. <el-divider direction="vertical" />
  227. <el-button type="primary" size="small" icon="el-icon-plus" @click="openDialog">添加货品</el-button>
  228. </div>
  229. </div>
  230. <div class="table" style="margin-top: 20px">
  231. <el-table
  232. :data="goodsList"
  233. element-loading-text="Loading"
  234. border
  235. fit
  236. highlight-current-row
  237. stripe
  238. max-height="400"
  239. show-summary
  240. :summary-method="$getSummaries"
  241. >
  242. <el-table-column align="center" label="序号" type="index" width="50" />
  243. <!-- <el-table-column align="center" label="引用记录" prop="useRefCount" min-width="160" show-overflow-tooltip></el-table-column> -->
  244. <el-table-column align="center" label="销售类型" prop="saleTypeName" min-width="120" show-overflow-tooltip />
  245. <el-table-column align="center" label="物料编码" prop="materialNumber" min-width="120" show-overflow-tooltip />
  246. <el-table-column
  247. align="center"
  248. label="产品编码"
  249. prop="materialOldNumber"
  250. min-width="120"
  251. show-overflow-tooltip
  252. />
  253. <el-table-column align="center" label="产品名称" prop="materialName" min-width="160" show-overflow-tooltip />
  254. <el-table-column align="center" label="规格型号" prop="specification" min-width="300" show-overflow-tooltip>
  255. <template slot-scope="scope">
  256. <el-input v-if="listItem" v-model="scope.row.specification" size="small" />
  257. <div v-else>{{ scope.row.specification }}</div>
  258. </template>
  259. </el-table-column>
  260. <el-table-column
  261. align="center"
  262. label="实装规格型号"
  263. prop="realSpecification"
  264. min-width="300"
  265. show-overflow-tooltip
  266. >
  267. <template slot-scope="scope">
  268. <el-input
  269. v-model="scope.row.realSpecification"
  270. :class="scope.row.realSpecification !== scope.row.specification ? 'input' : ''"
  271. size="small"
  272. readonly
  273. @click.native="getRealMaterData(scope.$index)"
  274. />
  275. </template>
  276. </el-table-column>
  277. <el-table-column align="center" label="数量" prop="qty" min-width="100" show-overflow-tooltip>
  278. <template slot-scope="scope">
  279. <el-input v-model="scope.row.qty" size="small" type="number" @mousewheel.native.prevent />
  280. </template>
  281. </el-table-column>
  282. <el-table-column align="center" label="单价" prop="price" min-width="100" show-overflow-tooltip>
  283. <template slot-scope="scope">
  284. <el-input v-model="scope.row.price" size="small" type="number" @mousewheel.native.prevent />
  285. </template>
  286. </el-table-column>
  287. <el-table-column align="center" label="订单金额" prop="dida" min-width="100" show-overflow-tooltip>
  288. <template slot-scope="scope">
  289. {{ scope.row.price * scope.row.qty }}
  290. </template>
  291. </el-table-column>
  292. <el-table-column align="center" label="工程登录数量" prop="enginNum" min-width="120" show-overflow-tooltip />
  293. <el-table-column align="center" label="现金钱包" prop="customerWalletId" min-width="160" show-overflow-tooltip>
  294. <template slot-scope="scope">
  295. <el-select
  296. v-model="scope.row.customerWalletId"
  297. placeholder="选择现金钱包"
  298. size="small"
  299. clearable
  300. @change="changeXjWallet(scope.$index)"
  301. >
  302. <el-option
  303. v-for="item in scope.row.wallets"
  304. :key="item.customerWalletId"
  305. :label="item.customerWalletName"
  306. :value="item.customerWalletId"
  307. />
  308. </el-select>
  309. </template>
  310. </el-table-column>
  311. <el-table-column align="center" label="返利类型" prop="customerWalletId2" min-width="160" show-overflow-tooltip>
  312. <template slot-scope="scope">
  313. <el-select
  314. v-model="scope.row.customerWalletId2"
  315. placeholder="选择返利类型"
  316. size="small"
  317. clearable
  318. @change="changeFlWallet(scope.$index)"
  319. >
  320. <el-option
  321. v-for="item in scope.row.rebateWallets"
  322. :key="item.customerWalletId"
  323. :label="item.customerWalletName"
  324. :value="item.customerWalletId"
  325. />
  326. </el-select>
  327. </template>
  328. </el-table-column>
  329. <el-table-column align="center" label="返利金额" min-width="100" show-overflow-tooltip prop="compute_flAmount">
  330. <template slot-scope="scope">
  331. {{ (scope.row.price * scope.row.qty * (scope.row.rebateRate * 100)) / 100 }}
  332. </template>
  333. </el-table-column>
  334. <el-table-column align="center" label="格力折扣" prop="ko" min-width="100" show-overflow-tooltip>
  335. <template slot-scope="scope">
  336. {{ scope.row.qty * scope.row.discAmount }}
  337. </template>
  338. </el-table-column>
  339. <el-table-column align="center" label="实付金额" min-width="100" show-overflow-tooltip prop="compute_sfAmount">
  340. <template slot-scope="scope">
  341. {{
  342. (scope.row.price * scope.row.qty * 100 -
  343. ((scope.row.price * scope.row.qty * (scope.row.rebateRate * 100)) / 100) * 100 -
  344. ((scope.row.qty * (scope.row.discAmount * 100)) / 100) * 100) /
  345. 100
  346. }}
  347. </template>
  348. </el-table-column>
  349. <el-table-column align="center" label="是否直调" prop="isDirectTransfer" min-width="100">
  350. <template slot-scope="scope">
  351. <el-checkbox v-model="scope.row.isDirectTransfer" />
  352. </template>
  353. </el-table-column>
  354. <el-table-column align="center" label="直调数量" prop="directTransferQty" min-width="100" />
  355. <el-table-column align="center" label="已发货数量" prop="hasSendQty" min-width="100" show-overflow-tooltip />
  356. <el-table-column align="center" label="已退数量" prop="retiredQty" min-width="100" show-overflow-tooltip />
  357. <el-table-column align="center" label="备注" prop="remark" min-width="160" show-overflow-tooltip>
  358. <template slot-scope="scope">
  359. <el-input v-model="scope.row.remark" size="small" />
  360. </template>
  361. </el-table-column>
  362. <el-table-column
  363. align="center"
  364. label="实装物料编号"
  365. prop="realMaterialNumber"
  366. min-width="150"
  367. show-overflow-tooltip
  368. >
  369. <template slot-scope="scope">
  370. <el-input
  371. v-model="scope.row.realMaterialNumber"
  372. :class="scope.row.realMaterialNumber !== scope.row.materialNumber ? 'input' : ''"
  373. size="small"
  374. readonly
  375. @click.native="getRealMaterData(scope.$index)"
  376. />
  377. </template>
  378. </el-table-column>
  379. <el-table-column
  380. align="center"
  381. label="实装厂产品编码"
  382. prop="realMaterialOldNumber"
  383. min-width="200"
  384. show-overflow-tooltip
  385. >
  386. <template slot-scope="scope">
  387. <el-input
  388. v-model="scope.row.realMaterialOldNumber"
  389. :class="scope.row.realMaterialOldNumber !== scope.row.materialOldNumber ? 'input' : ''"
  390. size="small"
  391. readonly
  392. @click.native="getRealMaterData(scope.$index)"
  393. />
  394. </template>
  395. </el-table-column>
  396. <el-table-column align="center" label="税率" prop="tax" min-width="100" show-overflow-tooltip />
  397. <!-- <el-table-column align="center" label="总仓库" prop="status1" min-width="100" show-overflow-tooltip>
  398. <template slot-scope="scope">
  399. <div>{{ scope.row.status1 | status1Filter }}</div>
  400. </template>
  401. </el-table-column> -->
  402. <el-table-column align="center" label="单位" prop="unit" min-width="100" show-overflow-tooltip />
  403. <el-table-column align="center" label="仓库状态" prop="status2" min-width="100" show-overflow-tooltip>
  404. <template slot-scope="scope">
  405. <div>{{ status2Filter(scope.row) }}</div>
  406. </template>
  407. </el-table-column>
  408. <!-- <el-table-column align="center" label="业务员" prop="serviceId" min-width="160" show-overflow-tooltip>
  409. <template slot-scope="scope">
  410. <el-select v-model="scope.row.serviceId" placeholder="选择业务员" size="small" clearable disabled>
  411. <el-option
  412. v-for="item in salesmanList"
  413. :key="item.adminUserId"
  414. :label="item.nickName"
  415. :value="item.adminUserId">
  416. </el-option>
  417. </el-select>
  418. </template>
  419. </el-table-column> -->
  420. <el-table-column align="center" label="操作" width="100" fixed="right">
  421. <template slot-scope="scope">
  422. <el-button type="text" @click="deleteItem(scope.$index)">删除</el-button>
  423. </template>
  424. </el-table-column>
  425. </el-table>
  426. </div>
  427. <div class="page-footer">
  428. <div class="footer">
  429. <el-button type="primary" :loading="formLoading" @click="clickSubmitForm(1)">保 存</el-button>
  430. <el-button type="primary" :loading="formLoading" @click="clickSubmitForm(2)">提交审核</el-button>
  431. <el-popconfirm v-if="!isDealer" title="确定关闭吗?" style="margin-left: 10px" @onConfirm="goBack">
  432. <el-button slot="reference">返回列表</el-button>
  433. </el-popconfirm>
  434. </div>
  435. </div>
  436. <!-- 工程登录列表 -->
  437. <el-dialog title="工程登录列表" :visible.sync="isShowDialog" width="70%" :close-on-click-modal="false">
  438. <el-form ref="screenForm" :model="screenForm" label-width="0" size="small" label-position="left">
  439. <el-row :gutter="20">
  440. <el-col :xs="24" :sm="12" :lg="6">
  441. <el-form-item prop="loginNum">
  442. <el-input v-model="screenForm.loginNum" placeholder="工程登录编号" />
  443. </el-form-item>
  444. </el-col>
  445. <el-col :xs="24" :sm="12" :lg="6">
  446. <el-form-item prop="enginName">
  447. <el-input v-model="screenForm.enginName" placeholder="工程类别" />
  448. </el-form-item>
  449. </el-col>
  450. <el-col :xs="24" :sm="12" :lg="6">
  451. <el-form-item prop="company">
  452. <el-input v-model="screenForm.company" placeholder="使用单位" />
  453. </el-form-item>
  454. </el-col>
  455. <el-col :xs="24" :sm="12" :lg="6" class="tr">
  456. <el-form-item label="">
  457. <el-button size="small" @click="resetScreenForm">清空</el-button>
  458. <el-button size="small" type="primary" @click="submitScreenForm">搜索</el-button>
  459. </el-form-item>
  460. </el-col>
  461. </el-row>
  462. </el-form>
  463. <div class="table" style="margin: 10px 0 20px">
  464. <el-table
  465. v-loading="dialogTable_listLoading"
  466. :data="dialogTable_dataList"
  467. element-loading-text="Loading"
  468. tooltip-effect="dark"
  469. style="width: 100%"
  470. max-height="270"
  471. >
  472. <el-table-column align="center" label="" width="100">
  473. <template slot-scope="scope">
  474. <el-button type="primary" size="small" @click="chooseItem(scope.row.recordNo, scope.row.userid)"
  475. >选择</el-button
  476. >
  477. </template>
  478. </el-table-column>
  479. <el-table-column align="center" prop="checkTime" label="工程登录日期" show-overflow-tooltip />
  480. <el-table-column align="center" prop="recordNo" label="工程登录编号" show-overflow-tooltip />
  481. <el-table-column align="center" prop="projectName" label="项目类别" show-overflow-tooltip />
  482. <el-table-column align="center" prop="useUnit" label="使用单位" show-overflow-tooltip />
  483. <el-table-column align="center" prop="organizationName" label="经销商" show-overflow-tooltip />
  484. </el-table>
  485. </div>
  486. <div class="pagination clearfix">
  487. <div class="fr">
  488. <el-pagination
  489. :current-page="dialogTable_currentPage"
  490. :page-size="dialogTable_pageSize"
  491. background
  492. layout="prev, pager, next"
  493. :total="dialogTable_listTotal"
  494. @current-change="dialogTableCurrentChange"
  495. />
  496. </div>
  497. </div>
  498. <div slot="footer" class="dialog-footer">
  499. <el-button @click="isShowDialog = false">关 闭</el-button>
  500. </div>
  501. </el-dialog>
  502. <el-dialog title="添加产品" :visible.sync="isShowGoodsDialog" width="80%">
  503. <el-form ref="goodsScreenForm" :model="goodsScreenForm" size="small" label-position="left">
  504. <el-row :gutter="20">
  505. <el-col :xs="12" :sm="6" :lg="6">
  506. <el-form-item prop="proNum">
  507. <el-input v-model="goodsScreenForm.proNum" placeholder="请输入产品编码" />
  508. </el-form-item>
  509. </el-col>
  510. <el-col :xs="12" :sm="6" :lg="6">
  511. <el-form-item prop="proName">
  512. <el-input v-model="goodsScreenForm.proName" placeholder="请输入产品名称" />
  513. </el-form-item>
  514. </el-col>
  515. <el-col :xs="12" :sm="6" :lg="6">
  516. <el-form-item prop="proModel">
  517. <el-input v-model="goodsScreenForm.proModel" placeholder="请输入产品型号" />
  518. </el-form-item>
  519. </el-col>
  520. <el-col :xs="12" :sm="6" :lg="6">
  521. <el-form-item prop="price1" style="display: flex">
  522. <el-input v-model="goodsScreenForm.price1" placeholder="请输入价格" style="width: 46%" />
  523. <span> - </span>
  524. <el-input v-model="goodsScreenForm.price2" placeholder="请输入价格" style="width: 46%" />
  525. </el-form-item>
  526. </el-col>
  527. <el-col :xs="24" :sm="24" :lg="24" class="tr">
  528. <el-form-item label="">
  529. <el-button size="small" @click="resetGoodsScreenForm">清空</el-button>
  530. <el-button size="small" type="primary" @click="submitGoodsScreenForm">搜索</el-button>
  531. </el-form-item>
  532. </el-col>
  533. </el-row>
  534. </el-form>
  535. <div class="tables">
  536. <div class="table">
  537. <el-table
  538. :data="leftGoodsList"
  539. element-loading-text="Loading"
  540. border
  541. fit
  542. highlight-current-row
  543. stripe
  544. height="400"
  545. @selection-change="leftSelectionChange"
  546. >
  547. <el-table-column align="center" type="selection" width="55" :selectable="checkboxSelect" />
  548. <el-table-column align="center" label="销售类型" prop="saleName" min-width="100" show-overflow-tooltip />
  549. <el-table-column align="center" label="产品编码" prop="number" min-width="100" show-overflow-tooltip />
  550. <el-table-column align="center" label="产品名称" prop="name" min-width="160" show-overflow-tooltip />
  551. <el-table-column
  552. align="center"
  553. label="产品型号"
  554. prop="specification"
  555. min-width="160"
  556. show-overflow-tooltip
  557. />
  558. <el-table-column align="center" label="产品价格" prop="batchPrice" min-width="80" show-overflow-tooltip />
  559. </el-table>
  560. <div class="pagination clearfix" style="margin-top: 10px">
  561. <div class="fr">
  562. <el-pagination
  563. :current-page="currentPage"
  564. :page-size="10"
  565. background
  566. layout="prev, pager, next"
  567. :total="listTotal"
  568. @current-change="handleTableCurrentChange"
  569. />
  570. </div>
  571. </div>
  572. </div>
  573. <div class="buttons">
  574. <el-button size="small" type="primary" @click="addAllGoods">全部添加</el-button>
  575. <el-button size="small" type="primary" @click="addGoods">添&emsp;加</el-button>
  576. <el-button size="small" type="danger" @click="deleteGoods">删&emsp;除</el-button>
  577. <el-button size="small" type="danger" @click="deleteAllGoods">全部删除</el-button>
  578. </div>
  579. <div class="table">
  580. <el-table
  581. :data="rightGoodsList"
  582. element-loading-text="Loading"
  583. border
  584. fit
  585. highlight-current-row
  586. stripe
  587. height="400"
  588. @selection-change="rightSelectionChange"
  589. >
  590. <el-table-column align="center" type="selection" width="55" />
  591. <el-table-column align="center" label="产品编码" prop="number" min-width="100" show-overflow-tooltip />
  592. <el-table-column align="center" label="产品名称" prop="name" min-width="160" show-overflow-tooltip />
  593. <el-table-column
  594. align="center"
  595. label="产品型号"
  596. prop="specification"
  597. min-width="160"
  598. show-overflow-tooltip
  599. />
  600. <el-table-column align="center" label="产品价格" prop="batchPrice" min-width="80" show-overflow-tooltip />
  601. </el-table>
  602. </div>
  603. </div>
  604. <span slot="footer" class="dialog-footer">
  605. <el-button @click="closeDialog">取 消</el-button>
  606. <el-button type="primary" @click="submitAddGoods">确 定</el-button>
  607. </span>
  608. </el-dialog>
  609. <el-dialog title="添加产品" :visible.sync="isSetMaterial" width="80%">
  610. <el-form ref="goodsScreenForm" :model="goodsScreenForm" size="small" label-position="left">
  611. <el-row :gutter="20">
  612. <el-col :xs="12" :sm="6" :lg="6">
  613. <el-form-item prop="proNum">
  614. <el-input v-model="goodsScreenForm.proNum" placeholder="请输入物料编码" />
  615. </el-form-item>
  616. </el-col>
  617. <el-col :xs="12" :sm="6" :lg="6">
  618. <el-form-item prop="proName">
  619. <el-input v-model="goodsScreenForm.proName" placeholder="请输入产品名称" />
  620. </el-form-item>
  621. </el-col>
  622. <el-col :xs="12" :sm="6" :lg="6">
  623. <el-form-item prop="proModel">
  624. <el-input v-model="goodsScreenForm.proModel" placeholder="请输入产品型号" />
  625. </el-form-item>
  626. </el-col>
  627. <el-col :xs="12" :sm="6" :lg="6">
  628. <el-form-item prop="price1" style="display: flex">
  629. <el-input v-model="goodsScreenForm.price1" placeholder="请输入价格" style="width: 46%" />
  630. <span> - </span>
  631. <el-input v-model="goodsScreenForm.price2" placeholder="请输入价格" style="width: 46%" />
  632. </el-form-item>
  633. </el-col>
  634. <el-col :xs="24" :sm="24" :lg="24" class="tr">
  635. <el-form-item label="">
  636. <el-button size="small" @click="resetGoodsScreenForm">清空</el-button>
  637. <el-button size="small" type="primary" @click="submitGoodsScreenForm">搜索</el-button>
  638. </el-form-item>
  639. </el-col>
  640. </el-row>
  641. </el-form>
  642. <div>
  643. <el-table :data="leftGoodsList" element-loading-text="Loading" border fit stripe height="400">
  644. <el-table-column align="center" width="55">
  645. <template slot-scope="scope">
  646. <el-radio v-model="currentRadio" :label="scope.row.id">{{ '' }}</el-radio>
  647. </template>
  648. </el-table-column>
  649. <el-table-column align="center" label="销售类型" prop="saleName" min-width="100" show-overflow-tooltip />
  650. <el-table-column align="center" label="物料编码" prop="number" min-width="100" show-overflow-tooltip />
  651. <el-table-column
  652. align="center"
  653. label="产品编码"
  654. prop="materialOldNumber"
  655. min-width="100"
  656. show-overflow-tooltip
  657. />
  658. <el-table-column align="center" label="产品名称" prop="name" min-width="160" show-overflow-tooltip />
  659. <el-table-column align="center" label="产品型号" prop="specification" min-width="160" show-overflow-tooltip />
  660. <el-table-column align="center" label="产品价格" prop="batchPrice" min-width="80" show-overflow-tooltip />
  661. </el-table>
  662. <div class="pagination clearfix" style="margin-top: 10px">
  663. <div class="fr">
  664. <el-pagination
  665. :current-page="currentPage"
  666. :page-size="10"
  667. background
  668. layout="prev, pager, next"
  669. :total="listTotal"
  670. @current-change="handleTableCurrentChange"
  671. />
  672. </div>
  673. </div>
  674. </div>
  675. <span slot="footer" class="dialog-footer">
  676. <el-button @click="closeDialog">取 消</el-button>
  677. <el-button type="primary" @click="submitPushGoods">确 定</el-button>
  678. </span>
  679. </el-dialog>
  680. </div>
  681. </template>
  682. <script>
  683. import {
  684. getOrderDetail,
  685. getHomeLoginList,
  686. getHomeLoginDetail,
  687. getWarehouseList,
  688. addHome,
  689. editHome,
  690. submitHome,
  691. checkStock,
  692. getRetailProductList
  693. } from '@/api/supply/engin'
  694. import { getDictList, getHomeTypeList, getSalesmanList } from '@/api/common'
  695. import { findElem } from '@/utils/util'
  696. let that
  697. export default {
  698. name: 'HomeForm',
  699. componentName: 'HomeForm',
  700. filters: {
  701. status1Filter(val) {
  702. const STOCK_ORDER_START = that.stockList.find(o => o.dictCode == 'STOCK_ORDER_START').dictValue
  703. const STOCK_ORDER_END = that.stockList.find(o => o.dictCode == 'STOCK_ORDER_END').dictValue
  704. const STOCK_ORDER_HAVE_START = that.stockList.find(o => o.dictCode == 'STOCK_ORDER_HAVE_START').dictValue
  705. const STOCK_ORDER_HAVE_END = that.stockList.find(o => o.dictCode == 'STOCK_ORDER_HAVE_END').dictValue
  706. const STOCK_ORDER_ALL_NUM = that.stockList.find(o => o.dictCode == 'STOCK_ORDER_ALL_NUM').dictValue
  707. if (val === '' || val === null || val === undefined) return '未检查'
  708. else if (val <= 0) return '无货'
  709. else if (val > STOCK_ORDER_START && val <= STOCK_ORDER_END) return val
  710. else if (val >= STOCK_ORDER_HAVE_START && val <= STOCK_ORDER_HAVE_END) return '有货'
  711. else if (val > STOCK_ORDER_ALL_NUM) return '充足'
  712. }
  713. },
  714. props: ['listItem'],
  715. data() {
  716. return {
  717. editId: '',
  718. mainForm: {
  719. customerId: '',
  720. orderNum: '',
  721. orderDate: '',
  722. type: '',
  723. jxsNum: '',
  724. jxsName: '',
  725. loginNum: '',
  726. enginName: '',
  727. loginType: '',
  728. promiseStatus: '',
  729. factoryNum: '',
  730. company: '',
  731. saleType: '',
  732. contactMan: '',
  733. tel: '',
  734. phone: '',
  735. address: '',
  736. declareNo: '',
  737. greeRemark: '',
  738. greeReply: '',
  739. remark: '',
  740. createMan: '',
  741. createDate: '',
  742. fileNum: '',
  743. loginUserId: '',
  744. salesMan: '',
  745. projectRemark: '',
  746. projectType: '',
  747. examineRemark: '',
  748. refCount: '',
  749. regionWork: '',
  750. examineStatus: '',
  751. refBuyUnitName: '',
  752. refPromiseProvide: '',
  753. refOtherAnnexIdea: ''
  754. },
  755. mainFormRules: {
  756. // orderDate: [{ required: true, message: '请选择单据日期', trigger: 'change' }],
  757. jxsNum: [{ required: true, message: '请输入经销商编码', trigger: 'blur' }],
  758. jxsName: [{ required: true, message: '请输入经销商名称', trigger: 'blur' }],
  759. loginNum: [{ required: true, message: '请输入工程登录编号', trigger: 'blur' }],
  760. // enginName: [{ required: true, message: '请输入项目类别', trigger: 'blur' }],
  761. // loginType: [{ required: true, message: '请输入行业类别', trigger: 'blur' }],
  762. company: [{ required: true, message: '请输入使用单位', trigger: 'blur' }],
  763. saleType: [{ required: true, message: '请选择销售类型', trigger: 'change' }],
  764. // contactMan: [{ required: true, message: '请输入联系人', trigger: 'blur' }],
  765. // tel: [{ required: true, message: '请输入固定电话', trigger: 'blur' }],
  766. // phone: [{ required: true, message: '请输入移动电话', trigger: 'blur' }],
  767. address: [{ required: true, message: '请输入安装地址', trigger: 'blur' }]
  768. },
  769. salesTypeList: [],
  770. // typeList: [],
  771. stockList: [],
  772. goodsList: [],
  773. isShowDialog: false, // 工程登录列表 - 弹窗
  774. screenForm: {
  775. loginNum: '',
  776. enginName: '',
  777. company: ''
  778. },
  779. dialogTable_dataList: null, // 工程登录列表 - 列表数据
  780. dialogTable_listLoading: true, // 工程登录列表 - 列表加载loading
  781. dialogTable_currentPage: 1, // 工程登录列表 - 当前页码
  782. dialogTable_pageSize: 10, // 工程登录列表 - 每页数量
  783. dialogTable_listTotal: 0, // 工程登录列表 - 列表总数
  784. warehouseList: [],
  785. warehouseValue: '',
  786. isShowGoodsDialog: false,
  787. goodsScreenForm: {
  788. proNum: '',
  789. proName: '',
  790. proModel: '',
  791. price1: '',
  792. price2: ''
  793. },
  794. currentPage: 1,
  795. listTotal: 0,
  796. leftGoodsList: [],
  797. rightGoodsList: [],
  798. leftSelection: [],
  799. rightSelection: [],
  800. formLoading: false,
  801. isFirst: false,
  802. salesmanList: [],
  803. oldSaleType: '',
  804. notInRefQueryGoodsList: '',
  805. isSetMaterial: false,
  806. currentId: '',
  807. currentRadio: ''
  808. }
  809. },
  810. computed: {
  811. isDealer() {
  812. return JSON.parse(localStorage.getItem('supply_user')).isCustomer
  813. },
  814. outSalesmanList() {
  815. const list = []
  816. if (this.goodsList && this.goodsList.length) {
  817. this.goodsList.forEach(item => {
  818. if (item.serviceId) {
  819. const hasItem = findElem(list, 'adminUserId', item.serviceId)
  820. if (hasItem < 0) {
  821. const obj = this.salesmanList.find(o => o.adminUserId == item.serviceId)
  822. if (obj) {
  823. list.push(obj)
  824. }
  825. }
  826. }
  827. })
  828. if (this.isFirst) {
  829. this.isFirst = false
  830. } else {
  831. this.mainForm.salesMan = this.goodsList[0].serviceId
  832. }
  833. }
  834. return list
  835. }
  836. },
  837. watch: {
  838. goodsList: {
  839. handler(newValue, oldValue) {
  840. if (newValue && newValue.length) {
  841. newValue.forEach((item, index) => {
  842. this.goodsList[index].compute_sfAmount =
  843. (item.price * item.qty * 100 -
  844. ((item.price * item.qty * (item.rebateRate * 100)) / 100) * 100 -
  845. ((item.qty * (item.discAmount * 100)) / 100) * 100) /
  846. 100
  847. this.goodsList[index].compute_flAmount = (item.price * item.qty * (item.rebateRate * 100)) / 100
  848. this.goodsList[index].ko = item.qty * item.discAmount
  849. this.goodsList[index].dida = item.price * item.qty
  850. })
  851. newValue.forEach(item => {
  852. // 'enginNum', 'directTransferQty', 'hasSendQty', 'retiredQty', 'ko'
  853. // 'price', 'compute_flAmount', 'compute_sfAmount'
  854. item.sums1 = ['qty']
  855. item.sums2 = ['dida']
  856. })
  857. }
  858. if (this.goodsList && this.goodsList.length) {
  859. if (this.isFirst) {
  860. this.isFirst = false
  861. } else {
  862. // this.mainForm.salesMan = this.goodsList[0].serviceId;
  863. }
  864. } else {
  865. this.mainForm.salesMan = ''
  866. }
  867. },
  868. immediate: true,
  869. deep: true
  870. },
  871. 'mainForm.saleType': function (newValue, oldValue) {
  872. this.oldSaleType = oldValue
  873. }
  874. },
  875. beforeCreate() {
  876. that = this
  877. },
  878. async created() {
  879. await this.getSalesmanList()
  880. this.getDictList()
  881. this.getHomeTypeList()
  882. this.getWarehouseList()
  883. if (this.listItem) {
  884. this.isFirst = true
  885. this.editId = this.listItem.parentId
  886. this.getDetail()
  887. } else {
  888. this.mainForm.jxsNum = JSON.parse(localStorage.getItem('supply_user')).customerNumber
  889. this.mainForm.jxsName = JSON.parse(localStorage.getItem('supply_user')).customerName
  890. this.mainForm.createMan = JSON.parse(localStorage.getItem('supply_user')).nickName
  891. this.mainForm.createDate = this.getDate()
  892. }
  893. },
  894. methods: {
  895. // 返回列表
  896. goBack() {
  897. this.$emit('backListFormDetail')
  898. },
  899. getDate() {
  900. var date = new Date()
  901. var seperator1 = '-'
  902. var year = date.getFullYear()
  903. var month = date.getMonth() + 1
  904. var strDate = date.getDate()
  905. if (month >= 1 && month <= 9) {
  906. month = '0' + month
  907. }
  908. if (strDate >= 0 && strDate <= 9) {
  909. strDate = '0' + strDate
  910. }
  911. var currentdate = year + seperator1 + month + seperator1 + strDate
  912. return currentdate
  913. },
  914. // 获取产品大类列表
  915. getDictList() {
  916. // getDictList({sysDictEnum: 'PRODUCT_TYPE'}).then(res => {
  917. // this.typeList = res.data;
  918. // })
  919. getDictList({ sysDictEnum: 'STOCK_ORDER' }).then(res => {
  920. this.stockList = res.data
  921. })
  922. },
  923. // 获取家用销售类型列表
  924. getHomeTypeList() {
  925. getHomeTypeList({ pageNum: 1, pageSize: -1 }).then(res => {
  926. this.salesTypeList = res.data.records
  927. })
  928. },
  929. // 获取仓库列表
  930. getWarehouseList() {
  931. getWarehouseList({
  932. pageNum: 1,
  933. pageSize: -1
  934. }).then(res => {
  935. this.warehouseList = res.data.records
  936. })
  937. },
  938. async getSalesmanList() {
  939. const res = await getSalesmanList({
  940. pageNum: 1,
  941. pageSize: -1,
  942. isCustomer: 0,
  943. status: true
  944. })
  945. this.salesmanList = res.data.records
  946. },
  947. // 工程登录列表 - 获取列表
  948. getHomeLoginList() {
  949. getHomeLoginList({
  950. pageNum: this.dialogTable_currentPage,
  951. pageSize: this.dialogTable_pageSize,
  952. recordNo: this.screenForm.loginNum,
  953. projectName: this.screenForm.enginName,
  954. useUnit: this.screenForm.company,
  955. refEnginRecordNo: this.mainForm.loginNum,
  956. examineStatus: 'OK'
  957. }).then(res => {
  958. this.dialogTable_dataList = res.data.records
  959. this.dialogTable_listTotal = res.data.total
  960. this.dialogTable_listLoading = false
  961. })
  962. },
  963. // 工程登录列表 - 打开弹窗
  964. openShareDetail() {
  965. if (!this.mainForm.saleType) {
  966. return this.$errorMsg('请先选择销售类型')
  967. }
  968. this.isShowDialog = true
  969. this.dialogTable_currentPage = 1
  970. this.screenForm.loginNum = this.mainForm.loginNum
  971. this.getHomeLoginList()
  972. },
  973. // 工程登录列表 - 更改列表当前页
  974. dialogTableCurrentChange(val) {
  975. this.dialogTable_currentPage = val
  976. this.getHomeLoginList()
  977. },
  978. // 提交筛选表单
  979. submitScreenForm() {
  980. this.dialogTable_currentPage = 1
  981. this.getHomeLoginList()
  982. },
  983. // 重置筛选表单
  984. resetScreenForm() {
  985. this.$refs.screenForm.resetFields()
  986. this.dialogTable_currentPage = 1
  987. this.getHomeLoginList()
  988. },
  989. // 选择工程登录
  990. async chooseItem(id, uid, isChangeSaleType = false) {
  991. const isCustomer = JSON.parse(localStorage.getItem('supply_user')).isCustomer
  992. let customerId = JSON.parse(localStorage.getItem('supply_user')).customerId
  993. if (!isCustomer) {
  994. customerId = this.mainForm.customerId
  995. }
  996. getHomeLoginDetail({
  997. recordNo: id,
  998. saleTypeId: this.mainForm.saleType,
  999. userId: uid,
  1000. enginOrderId: this.mainForm.orderNum,
  1001. customerId: customerId,
  1002. refEnginRecordNo: this.mainForm.loginNum
  1003. })
  1004. .then(async res => {
  1005. // 复制当前明细数据
  1006. const copyGoodsList = JSON.parse(JSON.stringify(this.goodsList))
  1007. console.log('未刷新前', copyGoodsList)
  1008. if (!isChangeSaleType) {
  1009. this.setMainAndItem(res.data)
  1010. } else {
  1011. // 找出不属于引用单上的产品
  1012. if (copyGoodsList && copyGoodsList.length > 0) {
  1013. const notInRefGoodsList = []
  1014. for (let i = 0; i < copyGoodsList.length; i++) {
  1015. const goods = copyGoodsList[i]
  1016. const index = res.data.items.findIndex(v => v.materialOldNumber === goods.materialOldNumber)
  1017. if (index < 0) {
  1018. notInRefGoodsList.push(goods)
  1019. }
  1020. }
  1021. if (notInRefGoodsList && notInRefGoodsList.length > 0) {
  1022. const oldNumbers = []
  1023. notInRefGoodsList.forEach(v => oldNumbers.push(v.materialOldNumber))
  1024. console.log('请求前可选机型接口', notInRefGoodsList, oldNumbers)
  1025. // 请求可选机型接口
  1026. await this.querySaleTypeGoods(oldNumbers)
  1027. console.log('返回新加明细', this.notInRefQueryGoodsList)
  1028. if (!this.notInRefQueryGoodsList) {
  1029. console.log('结束执行下去')
  1030. return
  1031. }
  1032. this.addRefItems(res.data.items, notInRefGoodsList)
  1033. }
  1034. // 数量和价格不变更
  1035. console.log('执行下去,数量和价格不变更')
  1036. }
  1037. console.log('替换前', res.data.items)
  1038. res.data.items = this.replaceHistoryItems(res.data.items, copyGoodsList)
  1039. console.log('替换后', res.data.items)
  1040. this.setMainAndItem(res.data)
  1041. }
  1042. })
  1043. .catch(() => {
  1044. this.mainForm.saleType = this.oldSaleType
  1045. })
  1046. },
  1047. // 选择销售类型
  1048. changeSaleType() {
  1049. if (this.mainForm.loginNum) {
  1050. this.chooseItem(this.mainForm.loginNum, this.mainForm.loginUserId, true)
  1051. }
  1052. },
  1053. // 删除产品
  1054. deleteItem(index) {
  1055. this.goodsList.splice(index, 1)
  1056. },
  1057. // 修改返利钱包
  1058. changeFlWallet(index) {
  1059. if (this.goodsList[index].customerWalletId2) {
  1060. const obj = this.goodsList[index].rebateWallets.find(
  1061. o => o.customerWalletId == this.goodsList[index].customerWalletId2
  1062. )
  1063. this.goodsList[index].rebateRate = obj.rebateRate
  1064. this.goodsList[index].customerWalletName2 = obj.customerWalletName
  1065. } else {
  1066. this.goodsList[index].rebateRate = ''
  1067. this.goodsList[index].customerWalletName2 = ''
  1068. }
  1069. },
  1070. // 修改现金钱包
  1071. changeXjWallet(index) {
  1072. if (this.goodsList[index].customerWalletId) {
  1073. const obj = this.goodsList[index].wallets.find(
  1074. o => o.customerWalletId == this.goodsList[index].customerWalletId
  1075. )
  1076. this.goodsList[index].customerWalletName = obj.customerWalletName
  1077. this.goodsList[index].serviceId = obj.serviceId
  1078. this.goodsList[index].serviceName = obj.serviceName
  1079. } else {
  1080. this.goodsList[index].customerWalletName = ''
  1081. this.goodsList[index].serviceId = ''
  1082. this.goodsList[index].serviceName = ''
  1083. }
  1084. },
  1085. // 获取详情
  1086. getDetail() {
  1087. getOrderDetail({ id: this.editId }).then(res => {
  1088. const data = res.data
  1089. this.mainForm.customerId = data.customerId
  1090. this.mainForm.orderNum = data.enginOrderId
  1091. this.mainForm.orderDate = data.orderDate
  1092. this.mainForm.type = data.mainId
  1093. this.mainForm.jxsNum = data.customerNumber
  1094. this.mainForm.jxsName = data.customerName
  1095. this.mainForm.loginNum = data.refEnginRecordNo
  1096. this.mainForm.enginName = data.refProjectCategory
  1097. this.mainForm.loginType = data.refTradeCategory
  1098. this.mainForm.promiseStatus = data.refPromiseStatus
  1099. this.mainForm.factoryNum = data.refFactoryNo
  1100. this.mainForm.company = data.refUseUnit
  1101. this.mainForm.saleType = data.saleTypeId
  1102. this.mainForm.contactMan = data.refLinkman
  1103. this.mainForm.tel = data.refTel
  1104. this.mainForm.phone = data.refPhone
  1105. this.mainForm.address = data.refInstallAddress
  1106. this.mainForm.declareNo = data.refDeclareNo
  1107. this.mainForm.refCount = data.refCount
  1108. this.mainForm.greeRemark = data.geLiInerNote
  1109. this.mainForm.greeReply = data.note1
  1110. this.mainForm.remark = data.remark
  1111. this.mainForm.createMan = data.createName
  1112. this.mainForm.createDate = data.createTime
  1113. this.mainForm.fileNum = data.fileNo
  1114. this.mainForm.salesMan = data.serviceId
  1115. this.mainForm.projectRemark = data.refProjectNote
  1116. this.mainForm.projectType = data.refProjectType
  1117. this.mainForm.examineRemark = data.examineNote
  1118. this.mainForm.loginUserId = data.loginUserId
  1119. this.mainForm.regionWork = data.refRegionWork
  1120. this.mainForm.examineStatus = data.examineStatus
  1121. this.mainForm.refBuyUnitName = data.refBuyUnitName
  1122. this.mainForm.refPromiseProvide = data.refPromiseProvide
  1123. data.items.forEach(item => {
  1124. item.status1 = ''
  1125. item.status2 = ''
  1126. item.rebateWallets = item.customerWalletList.filter(item => {
  1127. return item.type === 'REBATE'
  1128. })
  1129. item.wallets = item.customerWalletList.filter(item => {
  1130. return item.type === 'COMMONLY'
  1131. })
  1132. })
  1133. this.goodsList = data.items
  1134. })
  1135. },
  1136. // 获取商品列表
  1137. getGoodsList() {
  1138. getRetailProductList({
  1139. pageNum: this.currentPage,
  1140. pageSize: 10,
  1141. saleId: this.mainForm.saleType,
  1142. billType: 'HOME',
  1143. materialOldNumber: this.goodsScreenForm.proNum,
  1144. materialName: this.goodsScreenForm.proName,
  1145. specification: this.goodsScreenForm.proModel,
  1146. price1: this.goodsScreenForm.price1,
  1147. price2: this.goodsScreenForm.price2,
  1148. refEnginRecordNo: this.mainForm.loginNum,
  1149. customerId: this.listItem ? this.listItem.customerId : ''
  1150. }).then(res => {
  1151. const oldGoodsList = this.goodsList
  1152. const newGoodsList = res.data.records
  1153. for (let i = 0; i < oldGoodsList.length; i++) {
  1154. const oldItem = oldGoodsList[i]
  1155. for (let j = 0; j < newGoodsList.length; j++) {
  1156. const newItem = newGoodsList[j]
  1157. if (newItem.id === oldItem.id) {
  1158. newGoodsList[j].selected = true
  1159. break
  1160. }
  1161. }
  1162. }
  1163. res.data.records.forEach(item => {
  1164. item.materialName = item.name
  1165. item.materialCode = item.number
  1166. item.saleTypeName = item.saleName
  1167. item.unit = item.baseUnit
  1168. item.enginNum = 0
  1169. item.qty = 0
  1170. item.price = item.batchPrice
  1171. item.tax = item.taxRate
  1172. item.isDirectTransfer = false
  1173. item.directTransferQty = ''
  1174. item.status1 = ''
  1175. item.status2 = ''
  1176. item.rebateAmount = ''
  1177. item.rebateRate = ''
  1178. item.productPriceId = item.id
  1179. item.customerWalletId = item.wallets && item.wallets.length ? item.wallets[0].customerWalletId : ''
  1180. })
  1181. this.leftGoodsList = res.data.records
  1182. this.listTotal = res.data.total
  1183. })
  1184. },
  1185. // 查询重复值并禁选
  1186. checkboxSelect(row, rowIndex) {
  1187. if (row.selected) {
  1188. return false // 禁用
  1189. } else {
  1190. return true // 不禁用
  1191. }
  1192. },
  1193. // 点击 选择商品
  1194. openDialog() {
  1195. if (!this.mainForm.saleType) {
  1196. return this.$errorMsg('请先选择销售类型')
  1197. }
  1198. this.isShowGoodsDialog = true
  1199. this.getGoodsList()
  1200. },
  1201. // 提交筛选表单
  1202. submitGoodsScreenForm() {
  1203. this.currentPage = 1
  1204. this.getGoodsList()
  1205. },
  1206. // 重置筛选表单
  1207. resetGoodsScreenForm() {
  1208. this.$refs.goodsScreenForm.resetFields()
  1209. this.currentRadio = ''
  1210. this.currentPage = 1
  1211. this.getGoodsList()
  1212. },
  1213. // 更改列表当前页
  1214. handleTableCurrentChange(val) {
  1215. this.currentPage = val
  1216. this.getGoodsList()
  1217. },
  1218. // 关闭 弹窗
  1219. closeDialog() {
  1220. this.isShowGoodsDialog = false
  1221. this.isSetMaterial = false
  1222. },
  1223. // 左侧列表选择
  1224. leftSelectionChange(val) {
  1225. this.leftSelection = val
  1226. },
  1227. // 右侧列表选择
  1228. rightSelectionChange(val) {
  1229. this.rightSelection = val
  1230. },
  1231. // 数组去重
  1232. delRepeat(arr1, arr2) {
  1233. const allArr = arr1.concat(arr2) // 两个数组对象合并
  1234. const newArr = [] // 存放去重后数据的新数组
  1235. for (let i = 0; i < allArr.length; i++) {
  1236. // 循环allArr数组对象的内容
  1237. let flag = true // 建立标记,判断数据是否重复,true为不重复
  1238. for (let j = 0; j < newArr.length; j++) {
  1239. // 循环新数组的内容
  1240. if (allArr[i].id == newArr[j].id) {
  1241. // 让allArr数组对象的内容与新数组的内容作比较,相同的话,改变标记为false
  1242. flag = false
  1243. }
  1244. }
  1245. if (flag) {
  1246. // 判断是否重复
  1247. newArr.push(allArr[i]) // 不重复的放入新数组。 新数组的内容会继续进行上边的循环。
  1248. }
  1249. }
  1250. return newArr
  1251. },
  1252. // 全部添加
  1253. addAllGoods() {
  1254. this.rightGoodsList = this.delRepeat(this.leftGoodsList, this.rightGoodsList)
  1255. },
  1256. // 添加
  1257. addGoods() {
  1258. this.rightGoodsList = this.delRepeat(this.leftSelection, this.rightGoodsList)
  1259. },
  1260. // 删除
  1261. deleteGoods() {
  1262. const rightGoodsList = this.rightGoodsList
  1263. const rightSelection = this.rightSelection
  1264. for (let i = 0; i < rightGoodsList.length; i++) {
  1265. for (let j = 0; j < rightSelection.length; j++) {
  1266. if (rightSelection[j].materialId == rightGoodsList[i].materialId) {
  1267. this.rightGoodsList.splice(i, 1)
  1268. }
  1269. }
  1270. }
  1271. },
  1272. // 全部删除
  1273. deleteAllGoods() {
  1274. this.rightGoodsList = []
  1275. },
  1276. // 确定 添加产品
  1277. submitAddGoods() {
  1278. // this.goodsList = this.delRepeat(this.rightGoodsList, this.goodsList);
  1279. this.goodsList = this.goodsList.concat(this.rightGoodsList)
  1280. this.goodsList.forEach((k, i) => {
  1281. this.$set(this.goodsList[i], 'realMaterialId', k.materialId)
  1282. this.$set(this.goodsList[i], 'realMaterialName', k.materialName)
  1283. this.$set(this.goodsList[i], 'realMaterialNumber', k.materialNumber)
  1284. this.$set(this.goodsList[i], 'realMaterialOldNumber', k.materialOldNumber)
  1285. this.$set(this.goodsList[i], 'realSpecification', k.specification)
  1286. if (!this.listItem) {
  1287. const str = `实装物料编号:${k.materialNumber}实装厂产品编码:${k.materialOldNumber}`
  1288. let remark
  1289. if (!this.goodsList[i].remark) {
  1290. remark = str
  1291. } else {
  1292. remark = this.goodsList[i].remark.replace(/str/g, str)
  1293. }
  1294. this.$set(this.goodsList[i], 'remark', remark)
  1295. }
  1296. })
  1297. this.isShowGoodsDialog = false
  1298. this.leftGoodsList = []
  1299. this.rightGoodsList = []
  1300. },
  1301. getRealMaterData(id) {
  1302. this.currentId = id
  1303. this.isSetMaterial = true
  1304. this.getGoodsList()
  1305. },
  1306. submitPushGoods() {
  1307. // realMaterialId
  1308. // 实装金蝶物料id
  1309. // realMaterialName
  1310. // 实装金蝶物料名称
  1311. // realMaterialNumber
  1312. // 实装金蝶物料编码
  1313. // realMaterialOldNumber
  1314. // 实装金蝶物料旧编码
  1315. // realSpecification
  1316. // 实装规格型号
  1317. const currentData = this.leftGoodsList.find(e => e.id === this.currentRadio)
  1318. this.$set(this.goodsList[this.currentId], 'realMaterialId', currentData.materialId)
  1319. this.$set(this.goodsList[this.currentId], 'realMaterialName', currentData.materialName)
  1320. this.$set(this.goodsList[this.currentId], 'realMaterialNumber', currentData.materialNumber)
  1321. this.$set(this.goodsList[this.currentId], 'realMaterialOldNumber', currentData.materialOldNumber)
  1322. this.$set(this.goodsList[this.currentId], 'realSpecification', currentData.specification)
  1323. if (!this.listItem) {
  1324. const str = `实装物料编号:${currentData.materialNumber}实装厂产品编码:${currentData.materialOldNumber}`
  1325. let remark
  1326. if (!this.goodsList[this.currentId].remark) {
  1327. remark = str
  1328. } else {
  1329. remark = this.goodsList[this.currentId].remark.replace(/str/g, str)
  1330. }
  1331. this.$set(this.goodsList[this.currentId], 'remark', remark)
  1332. }
  1333. this.isSetMaterial = false
  1334. },
  1335. // 检查库存
  1336. checkStock() {
  1337. if (!this.warehouseValue) {
  1338. return this.$errorMsg('请选择仓库')
  1339. }
  1340. if (!this.goodsList) {
  1341. return this.$errorMsg('请添加货品')
  1342. }
  1343. const ids = []
  1344. this.goodsList.forEach(item => {
  1345. ids.push(item.materialId)
  1346. })
  1347. checkStock({
  1348. correspondId: this.warehouseValue,
  1349. materialId: ids.join(',')
  1350. }).then(res => {
  1351. if (res.data) {
  1352. this.goodsList.forEach((item, index) => {
  1353. item.status1 = res.data[index].allStockNum
  1354. item.status2 = res.data[index].stockNum
  1355. })
  1356. }
  1357. })
  1358. },
  1359. status2Filter(item) {
  1360. if (item.status2 === '' || item.status2 === null || item.status2 === undefined) return '未检查'
  1361. else if (item.status2 <= 0) return '无货'
  1362. if (item.status2 <= 0) {
  1363. return '无货'
  1364. } else if (item.status2 >= 1 && item.status2 <= 30) {
  1365. return item.status2
  1366. } else if (item.status2 >= 31 && item.status2 <= 1000) {
  1367. return '有货'
  1368. } else {
  1369. return '充足'
  1370. }
  1371. },
  1372. // 保存 / 提交审核
  1373. clickSubmitForm(type) {
  1374. this.$refs.mainForm.validate(valid => {
  1375. if (valid) {
  1376. for (let i = 0; i < this.goodsList.length; i++) {
  1377. if (!this.goodsList[i].customerWalletId) {
  1378. this.$errorMsg('请选择现金钱包')
  1379. return
  1380. }
  1381. if (!Number(this.goodsList[i].qty)) {
  1382. this.$errorMsg('不允许数量为0')
  1383. return
  1384. }
  1385. }
  1386. const goodsList = JSON.parse(JSON.stringify(this.goodsList))
  1387. goodsList.forEach(item => {
  1388. delete item.rebateWallets
  1389. delete item.wallets
  1390. })
  1391. const saleTypeItem = this.salesTypeList.find(o => o.id == this.mainForm.saleType)
  1392. const saleManItem = this.mainForm.salesMan
  1393. ? this.salesmanList.find(o => o.adminUserId == this.mainForm.salesMan)
  1394. : ''
  1395. const params = {
  1396. enginOrderId: this.mainForm.orderNum,
  1397. loginUserId: this.mainForm.loginUserId,
  1398. refEnginRecordNo: this.mainForm.loginNum || '',
  1399. refProjectCategory: this.mainForm.enginName || '',
  1400. refTradeCategory: this.mainForm.loginType || '',
  1401. refPromiseStatus: this.mainForm.promiseStatus || '',
  1402. refFactoryNo: this.mainForm.factoryNum || '',
  1403. refUseUnit: this.mainForm.company || '',
  1404. refLinkman: this.mainForm.contactMan || '',
  1405. refTel: this.mainForm.tel || '',
  1406. refPhone: this.mainForm.phone || '',
  1407. refInstallAddress: this.mainForm.address || '',
  1408. refDeclareNo: this.mainForm.declareNo || '',
  1409. refCount: this.mainForm.refCount || '',
  1410. saleTypeId: this.mainForm.saleType,
  1411. saleTypeCode: saleTypeItem.saleCode,
  1412. saleTypeName: saleTypeItem.saleName,
  1413. geLiInerNote: this.mainForm.greeRemark || '',
  1414. geLiNote: this.mainForm.greeReply || '',
  1415. remark: this.mainForm.remark || '',
  1416. fileNo: this.mainForm.fileNum || '',
  1417. serviceId: this.mainForm.salesMan,
  1418. serviceName: saleManItem ? saleManItem.nickName : goodsList[0].serviceName,
  1419. refProjectNote: this.mainForm.projectRemark,
  1420. refProjectType: this.mainForm.projectType,
  1421. refRegionWork: this.mainForm.regionWork,
  1422. refBuyUnitName: this.mainForm.refBuyUnitName,
  1423. refPromiseProvide: this.mainForm.refPromiseProvide,
  1424. refOtherAnnexIdea: this.mainForm.refOtherAnnexIdea,
  1425. items: goodsList
  1426. }
  1427. if (this.mainForm.examineStatus === 'WAIT') {
  1428. params.takeDeposit = false
  1429. }
  1430. this.formLoading = true
  1431. if (type === 1) {
  1432. if (this.listItem) {
  1433. editHome(params)
  1434. .then(res => {
  1435. this.$successMsg('编辑成功')
  1436. this.goBack()
  1437. this.$parent.getList()
  1438. })
  1439. .finally(res => {
  1440. this.formLoading = false
  1441. })
  1442. } else {
  1443. addHome(params)
  1444. .then(res => {
  1445. this.$successMsg('新增成功')
  1446. this.goBack()
  1447. this.$parent.getList()
  1448. })
  1449. .finally(res => {
  1450. this.formLoading = false
  1451. })
  1452. }
  1453. } else if (type === 2) {
  1454. submitHome(params)
  1455. .then(res => {
  1456. this.$successMsg('提交审核成功')
  1457. this.goBack()
  1458. this.$parent.getList()
  1459. })
  1460. .finally(res => {
  1461. this.formLoading = false
  1462. })
  1463. }
  1464. }
  1465. })
  1466. },
  1467. setMainAndItem(data) {
  1468. this.isShowDialog = false
  1469. this.mainForm.type = data.productCategory
  1470. this.mainForm.loginUserId = data.userid
  1471. // this.mainForm.saleType = '';
  1472. this.mainForm.loginNum = data.recordNo
  1473. this.mainForm.enginName = data.projectName
  1474. this.mainForm.loginType = data.tradeCategory
  1475. this.mainForm.factoryNum = data.factoryNo
  1476. this.mainForm.promiseStatus = data.promiseStatus
  1477. this.mainForm.company = data.useUnit
  1478. this.mainForm.contactMan = data.buyUnitCallMen
  1479. this.mainForm.tel = data.buyUnitTel
  1480. this.mainForm.phone = data.buyUnitPhone
  1481. this.mainForm.address = data.installAddress
  1482. this.mainForm.declareNo = data.declareNo
  1483. this.mainForm.projectRemark = data.buChonShuoMing
  1484. this.mainForm.projectType = data.govBuyType
  1485. this.mainForm.refCount = data.refCount
  1486. this.mainForm.regionWork = data.regionWork
  1487. this.mainForm.refBuyUnitName = data.buyUnitName
  1488. this.mainForm.refPromiseProvide = data.promiseProvide === 1 ? '已保证' : '未保证'
  1489. this.mainForm.refOtherAnnexIdea = data.otherAnnexIdea
  1490. const saleTypeItem = this.salesTypeList.find(o => o.id === this.mainForm.saleType)
  1491. this.goodsList = data.items.map(item => {
  1492. return {
  1493. useRefCount: item.useRefCount,
  1494. saleTypeId: saleTypeItem.id,
  1495. saleTypeCode: saleTypeItem.saleCode,
  1496. saleTypeName: saleTypeItem.saleName,
  1497. materialId: item.materialId,
  1498. materialNumber: item.materialNumber,
  1499. materialOldNumber: item.materialOldNumber,
  1500. materialName: item.materialName,
  1501. specification: item.machine,
  1502. enginNum: item.num,
  1503. enginPrice: item.price,
  1504. enginTotality: item.totality,
  1505. historyHasDeliverQty: item.hasDeliverQty,
  1506. unit: item.unit,
  1507. price: item.price,
  1508. qty: item.num,
  1509. customerWalletId2: '',
  1510. rebateRate: '',
  1511. discAmount: '',
  1512. customerWalletId: '',
  1513. isDirectTransfer: false,
  1514. directTransferQty: '',
  1515. hasSendQty: '',
  1516. remark: item.discri,
  1517. tax: '',
  1518. status1: '',
  1519. status2: '',
  1520. rebateWallets: item.customerWalletList.filter(item => {
  1521. return item.type === 'REBATE'
  1522. }),
  1523. wallets: item.customerWalletList.filter(item => {
  1524. return item.type === 'COMMONLY'
  1525. })
  1526. }
  1527. })
  1528. this.goodsList.forEach((k, i) => {
  1529. this.$set(this.goodsList[i], 'realMaterialId', k.materialId)
  1530. this.$set(this.goodsList[i], 'realMaterialName', k.materialName)
  1531. this.$set(this.goodsList[i], 'realMaterialNumber', k.materialNumber)
  1532. this.$set(this.goodsList[i], 'realMaterialOldNumber', k.materialOldNumber)
  1533. this.$set(this.goodsList[i], 'realSpecification', k.specification)
  1534. if (!this.listItem) {
  1535. const str = `实装物料编号:${k.materialNumber}实装厂产品编码:${k.materialOldNumber}`
  1536. let remark
  1537. if (!this.goodsList[i].remark) {
  1538. remark = str
  1539. } else {
  1540. remark = this.goodsList[i].remark.replace(/str/g, str)
  1541. }
  1542. this.$set(this.goodsList[i], 'remark', remark)
  1543. }
  1544. })
  1545. this.goodsList.forEach(item => {
  1546. item.customerWalletId = item.wallets && item.wallets.length ? item.wallets[0].customerWalletId : ''
  1547. item.serviceId = item.wallets && item.wallets.length ? item.wallets[0].serviceId : ''
  1548. item.serviceName = item.wallets && item.wallets.length ? item.wallets[0].serviceName : ''
  1549. })
  1550. },
  1551. async querySaleTypeGoods(oldNumbers) {
  1552. await getRetailProductList({
  1553. pageNum: 1,
  1554. pageSize: -1,
  1555. saleId: this.mainForm.saleType,
  1556. billType: 'HOME',
  1557. oldNumbers: oldNumbers.join(','),
  1558. customerId: this.mainForm.customerId
  1559. }).then(res => {
  1560. console.log('请求后可选机型接口', res.data.records)
  1561. if (!res.data.records || res.data.records.length === 0) {
  1562. this.mainForm.saleType = this.oldSaleType
  1563. console.log(1)
  1564. this.$errorMsg(oldNumbers.join(',') + ' 产品无此销售类型')
  1565. this.notInRefQueryGoodsList = ''
  1566. return
  1567. }
  1568. if (res.data.records.length < oldNumbers.length) {
  1569. const notInOldNumbers = []
  1570. for (let i = 0; i < oldNumbers.length; i++) {
  1571. const oldNumber = oldNumbers[i]
  1572. const index = res.data.records.findIndex(v => v.materialOldNumber === oldNumber)
  1573. if (index < 0) {
  1574. notInOldNumbers.push(oldNumber)
  1575. }
  1576. }
  1577. this.mainForm.saleType = this.oldSaleType
  1578. console.log(2)
  1579. this.$errorMsg(notInOldNumbers.join(',') + ' 产品无此销售类型')
  1580. this.notInRefQueryGoodsList = ''
  1581. return
  1582. }
  1583. this.notInRefQueryGoodsList = res.data.records
  1584. })
  1585. },
  1586. replaceHistoryItems(items, copyGoodsList) {
  1587. if (items && copyGoodsList) {
  1588. for (let i = 0; i < items.length; i++) {
  1589. const index = copyGoodsList.findIndex(v => v.materialOldNumber === items[i].materialOldNumber)
  1590. if (index >= 0) {
  1591. items[i].price = copyGoodsList[index].price
  1592. items[i].num = copyGoodsList[index].qty
  1593. items[i].discri = copyGoodsList[index].remark
  1594. }
  1595. }
  1596. }
  1597. return items
  1598. },
  1599. addRefItems(items, notInRefGoodsList) {
  1600. if (notInRefGoodsList && this.notInRefQueryGoodsList) {
  1601. for (let i = 0; i < notInRefGoodsList.length; i++) {
  1602. const index = this.notInRefQueryGoodsList.findIndex(
  1603. v => v.materialOldNumber === notInRefGoodsList[i].materialOldNumber
  1604. )
  1605. if (index >= 0) {
  1606. this.notInRefQueryGoodsList[index].batchPrice = notInRefGoodsList[i].price
  1607. this.notInRefQueryGoodsList[index].qty = notInRefGoodsList[i].qty
  1608. this.notInRefQueryGoodsList[index].remark = notInRefGoodsList[i].remark
  1609. }
  1610. }
  1611. console.log('非引用单产品', this.notInRefQueryGoodsList)
  1612. for (let i = 0; i < this.notInRefQueryGoodsList.length; i++) {
  1613. const goods = this.notInRefQueryGoodsList[i]
  1614. const customerWalletList = [].concat(goods.rebateWallets).concat(goods.wallets)
  1615. items.push({
  1616. saleTypeId: goods.saleTypeId,
  1617. saleTypeCode: goods.saleTypeCode,
  1618. saleTypeName: goods.saleTypeName,
  1619. materialId: goods.materialId,
  1620. materialNumber: goods.materialNumber,
  1621. materialOldNumber: goods.materialOldNumber,
  1622. materialName: goods.materialName,
  1623. machine: goods.specification,
  1624. num: goods.qty,
  1625. batchPrice: goods.batchPrice,
  1626. discri: goods.remark,
  1627. customerWalletList: customerWalletList
  1628. })
  1629. }
  1630. }
  1631. }
  1632. }
  1633. }
  1634. </script>
  1635. <style scoped lang="scss">
  1636. ::v-deep .input .el-input__inner {
  1637. color: blue;
  1638. }
  1639. .detail-container {
  1640. width: 100%;
  1641. height: 100%;
  1642. }
  1643. .main-title {
  1644. display: flex;
  1645. justify-content: space-between;
  1646. align-items: center;
  1647. margin-top: 20px;
  1648. height: 60px;
  1649. border-bottom: 1px solid #dcdfe6;
  1650. margin-bottom: 20px;
  1651. .title {
  1652. font-size: 16px;
  1653. font-weight: 600;
  1654. padding-left: 10px;
  1655. }
  1656. }
  1657. .tables {
  1658. display: flex;
  1659. margin-top: 10px;
  1660. .table {
  1661. width: 45%;
  1662. }
  1663. .buttons {
  1664. display: flex;
  1665. flex-direction: column;
  1666. justify-content: center;
  1667. align-items: center;
  1668. padding: 0 10px;
  1669. button {
  1670. margin: 0;
  1671. margin-top: 10px;
  1672. }
  1673. }
  1674. }
  1675. ::v-deep input::-webkit-outer-spin-button,
  1676. ::v-deep input::-webkit-inner-spin-button {
  1677. -webkit-appearance: none;
  1678. }
  1679. ::v-deep input[type='number'] {
  1680. -moz-appearance: textfield;
  1681. }
  1682. </style>