home_form.vue 64 KB

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