home_form.vue 47 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193
  1. <template>
  2. <div class="detail-container">
  3. <el-page-header @back="goBack" :content="listItem ? '编辑':'新增'"></el-page-header>
  4. <div class="main-title">
  5. <div class="title">工程订单</div>
  6. </div>
  7. <el-form ref="mainForm" :model="mainForm" :rules="mainFormRules" label-width="110px" 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></el-input>
  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. </el-date-picker>
  24. </el-form-item>
  25. </el-col>
  26. <!-- <el-col :xs="24" :sm="12" :lg="8">
  27. <el-form-item label="产品大类" prop="type">
  28. <el-input v-model="mainForm.type" disabled v-if="listItem"></el-input>
  29. <el-select v-model="mainForm.type" placeholder="选择产品大类" style="width: 100%" disabled v-else>
  30. <el-option v-for="item in typeList" :key="item.dictCode" :label="item.dictValue" :value="item.dictCode"></el-option>
  31. </el-select>
  32. </el-form-item>
  33. </el-col> -->
  34. <el-col :xs="24" :sm="12" :lg="8">
  35. <el-form-item label="销售类型" prop="saleType">
  36. <el-select v-model="mainForm.saleType" placeholder="选择销售类型" style="width: 100%" clearable @change="changeSaleType">
  37. <el-option v-for="item in salesTypeList" :key="item.id" :label="item.saleName" :value="item.id"></el-option>
  38. </el-select>
  39. </el-form-item>
  40. </el-col>
  41. <el-col :xs="24" :sm="12" :lg="8">
  42. <el-form-item label="经销商编码" prop="jxsNum">
  43. <el-input v-model="mainForm.jxsNum" placeholder="请输入经销商编码" disabled></el-input>
  44. </el-form-item>
  45. </el-col>
  46. <el-col :xs="24" :sm="12" :lg="16">
  47. <el-form-item label="经销商名称" prop="jxsName">
  48. <el-input v-model="mainForm.jxsName" placeholder="请输入经销商名称" disabled></el-input>
  49. </el-form-item>
  50. </el-col>
  51. <el-col :xs="24" :sm="12" :lg="8">
  52. <el-form-item label="工程登录编号" prop="loginNum">
  53. <div style="display: flex;">
  54. <el-input v-model="mainForm.loginNum" placeholder="请引用工程登录" disabled></el-input>
  55. <el-button style="margin-left: 10px;" @click="openShareDetail">引用</el-button>
  56. </div>
  57. </el-form-item>
  58. </el-col>
  59. <el-col :xs="24" :sm="12" :lg="8">
  60. <el-form-item label="项目类别" prop="enginName">
  61. <el-input v-model="mainForm.enginName" placeholder="请输入项目类别" disabled></el-input>
  62. </el-form-item>
  63. </el-col>
  64. <el-col :xs="24" :sm="12" :lg="8">
  65. <el-form-item label="行业类别" prop="loginType">
  66. <el-input v-model="mainForm.loginType" placeholder="请输入行业类别" disabled></el-input>
  67. </el-form-item>
  68. </el-col>
  69. <el-col :xs="24" :sm="12" :lg="8">
  70. <el-form-item label="跨区厂编号" prop="factoryNum">
  71. <el-input v-model="mainForm.factoryNum" placeholder="请输入跨区厂编号"></el-input>
  72. </el-form-item>
  73. </el-col>
  74. <el-col :xs="24" :sm="12" :lg="8">
  75. <el-form-item label="使用单位" prop="company">
  76. <el-input v-model="mainForm.company" placeholder="请输入使用单位" disabled></el-input>
  77. </el-form-item>
  78. </el-col>
  79. <el-col :xs="24" :sm="12" :lg="8">
  80. <el-form-item label="业务员" prop="salesMan">
  81. <el-select v-model="mainForm.salesMan" placeholder="选择业务员" size="small" clearable style="width: 100%">
  82. <el-option
  83. v-for="item in outSalesmanList"
  84. :key="item.adminUserId"
  85. :label="item.nickName"
  86. :value="item.adminUserId">
  87. </el-option>
  88. </el-select>
  89. </el-form-item>
  90. </el-col>
  91. <el-col :xs="24" :sm="12" :lg="8">
  92. <el-form-item label="联系人" prop="contactMan">
  93. <el-input v-model="mainForm.contactMan" placeholder="请输入联系人" disabled></el-input>
  94. </el-form-item>
  95. </el-col>
  96. <el-col :xs="24" :sm="12" :lg="8">
  97. <el-form-item label="固定电话" prop="tel">
  98. <el-input v-model="mainForm.tel" placeholder="请输入固定电话" disabled></el-input>
  99. </el-form-item>
  100. </el-col>
  101. <el-col :xs="24" :sm="12" :lg="8">
  102. <el-form-item label="移动电话" prop="phone">
  103. <el-input v-model="mainForm.phone" placeholder="请输入移动电话" disabled></el-input>
  104. </el-form-item>
  105. </el-col>
  106. <el-col :xs="24" :sm="12" :lg="16">
  107. <el-form-item label="安装地址" prop="address">
  108. <el-input v-model="mainForm.address" placeholder="请输入安装地址" disabled></el-input>
  109. </el-form-item>
  110. </el-col>
  111. <el-col :xs="24" :sm="12" :lg="8">
  112. <el-form-item label="第几次申报" prop="declareNo">
  113. <el-input v-model="mainForm.declareNo" placeholder="请输入第几次申报"></el-input>
  114. </el-form-item>
  115. </el-col>
  116. <el-col :xs="24" :sm="12" :lg="16">
  117. <el-form-item label="项目说明" prop="projectRemark">
  118. <el-input v-model="mainForm.projectRemark" placeholder="请输入项目说明"></el-input>
  119. </el-form-item>
  120. </el-col>
  121. <el-col :xs="24" :sm="12" :lg="8">
  122. <el-form-item label="项目类型" prop="projectType">
  123. <el-input v-model="mainForm.projectType" placeholder="请输入项目类型"></el-input>
  124. </el-form-item>
  125. </el-col>
  126. <el-col :xs="24" :sm="24" :lg="24" v-if="!isDealer">
  127. <el-form-item label="格力内部备注" prop="greeRemark">
  128. <el-input v-model="mainForm.greeRemark" placeholder="请输入格力内部备注"></el-input>
  129. </el-form-item>
  130. </el-col>
  131. <!-- <el-col :xs="24" :sm="24" :lg="24">
  132. <el-form-item label="格力回复" prop="greeReply">
  133. <el-input v-model="mainForm.greeReply" placeholder="请输入格力回复"></el-input>
  134. </el-form-item>
  135. </el-col> -->
  136. <el-col :xs="24" :sm="24" :lg="24">
  137. <el-form-item label="备注" prop="remark">
  138. <el-input v-model="mainForm.remark" placeholder="请输入备注"></el-input>
  139. </el-form-item>
  140. </el-col>
  141. <el-col :xs="24" :sm="12" :lg="8">
  142. <el-form-item label="制单人" prop="createMan">
  143. <el-input v-model="mainForm.createMan" placeholder="请输入制单人" disabled></el-input>
  144. </el-form-item>
  145. </el-col>
  146. <el-col :xs="24" :sm="12" :lg="8" style="height: 51px;">
  147. <el-form-item label="制单日期" prop="createDate">
  148. <el-date-picker
  149. v-model="mainForm.createDate"
  150. disabled
  151. type="date"
  152. value-format="yyyy-MM-dd"
  153. style="width: 100%;"
  154. placeholder="选择日期">
  155. </el-date-picker>
  156. </el-form-item>
  157. </el-col>
  158. <el-col :xs="24" :sm="12" :lg="8">
  159. <el-form-item label="文件编号" prop="fileNum">
  160. <el-input v-model="mainForm.fileNum" placeholder="请输入文件编号"></el-input>
  161. </el-form-item>
  162. </el-col>
  163. </el-row>
  164. </el-form>
  165. <div class="main-title">
  166. <div class="title">货品信息</div>
  167. <div>
  168. <el-select v-model="warehouseValue" placeholder="请选择发货仓库" size="small" style="margin-right: 10px">
  169. <el-option :label="item.name" :value="item.id" v-for="(item, index) in warehouseList" :key="index"></el-option>
  170. </el-select>
  171. <el-button type="primary" size="small" icon="el-icon-search" @click="checkStock">检查库存</el-button>
  172. <el-divider direction="vertical"></el-divider>
  173. <el-button type="primary" size="small" icon="el-icon-plus" @click="openDialog">添加货品</el-button>
  174. </div>
  175. </div>
  176. <div class="table" style="margin-top: 20px">
  177. <el-table :data="goodsList" element-loading-text="Loading" border fit highlight-current-row stripe max-height="400">
  178. <el-table-column align="center" label="序号" type="index" width="50"></el-table-column>
  179. <el-table-column align="center" label="引用记录" prop="useRefCount" min-width="160" show-overflow-tooltip></el-table-column>
  180. <el-table-column align="center" label="销售类型" prop="saleTypeName" min-width="120" show-overflow-tooltip></el-table-column>
  181. <el-table-column align="center" label="产品编码" prop="materialNumber" min-width="160" show-overflow-tooltip></el-table-column>
  182. <el-table-column align="center" label="物料代码" prop="materialOldNumber" min-width="160" show-overflow-tooltip></el-table-column>
  183. <el-table-column align="center" label="产品名称" prop="materialName" min-width="160" show-overflow-tooltip></el-table-column>
  184. <el-table-column align="center" label="规格型号" prop="specification" min-width="160" show-overflow-tooltip>
  185. <template slot-scope="scope">
  186. <el-input v-model="scope.row.specification" size="small" v-if="listItem"></el-input>
  187. <div v-else>{{scope.row.specification}}</div>
  188. </template>
  189. </el-table-column>
  190. <el-table-column align="center" label="单位" prop="unit" min-width="100" show-overflow-tooltip></el-table-column>
  191. <el-table-column align="center" label="单价" prop="price" min-width="100" show-overflow-tooltip>
  192. <template slot-scope="scope">
  193. <el-input v-model="scope.row.price" size="small" type="number"></el-input>
  194. </template>
  195. </el-table-column>
  196. <el-table-column align="center" label="工程登录数量" prop="enginNum" min-width="120" show-overflow-tooltip></el-table-column>
  197. <el-table-column align="center" label="数量" prop="qty" min-width="100" show-overflow-tooltip>
  198. <template slot-scope="scope">
  199. <el-input v-model="scope.row.qty" size="small" type="number"></el-input>
  200. </template>
  201. </el-table-column>
  202. <el-table-column align="center" label="订单金额" min-width="100" show-overflow-tooltip>
  203. <template slot-scope="scope">
  204. {{scope.row.price * scope.row.qty}}
  205. </template>
  206. </el-table-column>
  207. <el-table-column align="center" label="返利类型" prop="customerWalletId2" min-width="160" show-overflow-tooltip>
  208. <template slot-scope="scope">
  209. <el-select v-model="scope.row.customerWalletId2" placeholder="选择返利类型" size="small" clearable @change="changeFlWallet(scope.$index)">
  210. <el-option
  211. v-for="item in scope.row.rebateWallets"
  212. :key="item.customerWalletId"
  213. :label="item.customerWalletName"
  214. :value="item.customerWalletId">
  215. </el-option>
  216. </el-select>
  217. </template>
  218. </el-table-column>
  219. <el-table-column align="center" label="返利金额" min-width="100" show-overflow-tooltip>
  220. <template slot-scope="scope">
  221. {{(scope.row.price * scope.row.qty * (scope.row.rebateRate * 100)) / 100}}
  222. </template>
  223. </el-table-column>
  224. <el-table-column align="center" label="格力折扣" min-width="100" show-overflow-tooltip>
  225. <template slot-scope="scope">
  226. {{scope.row.qty * scope.row.discAmount}}
  227. </template>
  228. </el-table-column>
  229. <el-table-column align="center" label="现金钱包" prop="customerWalletId" min-width="160" show-overflow-tooltip>
  230. <template slot-scope="scope">
  231. <el-select v-model="scope.row.customerWalletId" placeholder="选择现金钱包" size="small" clearable @change="changeXjWallet(scope.$index)">
  232. <el-option
  233. v-for="item in scope.row.wallets"
  234. :key="item.customerWalletId"
  235. :label="item.customerWalletName"
  236. :value="item.customerWalletId">
  237. </el-option>
  238. </el-select>
  239. </template>
  240. </el-table-column>
  241. <el-table-column align="center" label="实付金额" prop="qty" min-width="100" show-overflow-tooltip>
  242. <template slot-scope="scope">
  243. {{((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}}
  244. </template>
  245. </el-table-column>
  246. <el-table-column align="center" label="是否直调" prop="isDirectTransfer" min-width="100">
  247. <template slot-scope="scope">
  248. <el-checkbox v-model="scope.row.isDirectTransfer"></el-checkbox>
  249. </template>
  250. </el-table-column>
  251. <el-table-column align="center" label="直调数量" prop="directTransferQty" min-width="100"></el-table-column>
  252. <el-table-column align="center" label="已发货数量" prop="hasSendQty" min-width="100" show-overflow-tooltip></el-table-column>
  253. <el-table-column align="center" label="已退数量" prop="retiredQty" min-width="100" show-overflow-tooltip></el-table-column>
  254. <el-table-column align="center" label="备注" prop="remark" min-width="160" show-overflow-tooltip>
  255. <template slot-scope="scope">
  256. <el-input v-model="scope.row.remark" size="small"></el-input>
  257. </template>
  258. </el-table-column>
  259. <el-table-column align="center" label="税率" prop="tax" min-width="100" show-overflow-tooltip></el-table-column>
  260. <!-- <el-table-column align="center" label="总仓库" prop="status1" min-width="100" show-overflow-tooltip>
  261. <template slot-scope="scope">
  262. <div>{{ scope.row.status1 | status1Filter }}</div>
  263. </template>
  264. </el-table-column> -->
  265. <el-table-column align="center" label="仓库状态" prop="status2" min-width="100" show-overflow-tooltip>
  266. <template slot-scope="scope">
  267. <div>{{ status2Filter(scope.row) }}</div>
  268. </template>
  269. </el-table-column>
  270. <el-table-column align="center" label="业务员" prop="serviceId" min-width="160" show-overflow-tooltip>
  271. <template slot-scope="scope">
  272. <el-select v-model="scope.row.serviceId" placeholder="选择业务员" size="small" clearable disabled>
  273. <el-option
  274. v-for="item in salesmanList"
  275. :key="item.adminUserId"
  276. :label="item.nickName"
  277. :value="item.adminUserId">
  278. </el-option>
  279. </el-select>
  280. </template>
  281. </el-table-column>
  282. <el-table-column align="center" label="操作" width="100" fixed="right">
  283. <template slot-scope="scope">
  284. <el-button type="text" @click="deleteItem(scope.$index)">删除</el-button>
  285. </template>
  286. </el-table-column>
  287. </el-table>
  288. </div>
  289. <div class="page-footer">
  290. <div class="footer">
  291. <el-button type="primary" @click="clickSubmitForm(1)" :loading="formLoading">保 存</el-button>
  292. <el-button type="primary" @click="clickSubmitForm(2)" :loading="formLoading">提交审核</el-button>
  293. <el-popconfirm title="确定关闭吗?" @onConfirm="goBack" style="margin-left: 10px;">
  294. <el-button slot="reference">关 闭</el-button>
  295. </el-popconfirm>
  296. </div>
  297. </div>
  298. <!-- 工程登录列表 -->
  299. <el-dialog title="工程登录列表" :visible.sync="isShowDialog" width="70%" :close-on-click-modal="false">
  300. <el-form ref="screenForm" :model="screenForm" label-width="0" size="small" label-position="left">
  301. <el-row :gutter="20">
  302. <el-col :xs="24" :sm="12" :lg="6">
  303. <el-form-item prop="loginNum">
  304. <el-input v-model="screenForm.loginNum" placeholder="工程登录编号"></el-input>
  305. </el-form-item>
  306. </el-col>
  307. <el-col :xs="24" :sm="12" :lg="6">
  308. <el-form-item prop="enginName">
  309. <el-input v-model="screenForm.enginName" placeholder="工程项目"></el-input>
  310. </el-form-item>
  311. </el-col>
  312. <el-col :xs="24" :sm="12" :lg="6">
  313. <el-form-item prop="company">
  314. <el-input v-model="screenForm.company" placeholder="使用单位"></el-input>
  315. </el-form-item>
  316. </el-col>
  317. <el-col :xs="24" :sm="12" :lg="6" class="tr">
  318. <el-form-item label="">
  319. <el-button size="small" @click="resetScreenForm">清空</el-button>
  320. <el-button size="small" type="primary" @click="submitScreenForm">搜索</el-button>
  321. </el-form-item>
  322. </el-col>
  323. </el-row>
  324. </el-form>
  325. <div class="table" style="margin: 10px 0 20px;">
  326. <el-table
  327. v-loading="dialogTable_listLoading"
  328. :data="dialogTable_dataList"
  329. element-loading-text="Loading"
  330. tooltip-effect="dark"
  331. style="width: 100%"
  332. max-height="270">
  333. <el-table-column align="center" label="" width="100">
  334. <template slot-scope="scope">
  335. <el-button type="primary" size="small" @click="chooseItem(scope.row.recordNo, scope.row.userid)">选择</el-button>
  336. </template>
  337. </el-table-column>
  338. <el-table-column align="center" prop="checkTime" label="工程登录日期" show-overflow-tooltip></el-table-column>
  339. <el-table-column align="center" prop="recordNo" label="工程登录编号" show-overflow-tooltip></el-table-column>
  340. <el-table-column align="center" prop="projectName" label="工程项目" show-overflow-tooltip></el-table-column>
  341. <el-table-column align="center" prop="useUnit" label="使用单位" show-overflow-tooltip></el-table-column>
  342. <el-table-column align="center" prop="organizationName" label="经销商" show-overflow-tooltip></el-table-column>
  343. </el-table>
  344. </div>
  345. <div class="pagination clearfix">
  346. <div class="fr">
  347. <el-pagination
  348. @current-change="dialogTableCurrentChange"
  349. :current-page="dialogTable_currentPage"
  350. :page-size="dialogTable_pageSize"
  351. background
  352. layout="prev, pager, next"
  353. :total="dialogTable_listTotal">
  354. </el-pagination>
  355. </div>
  356. </div>
  357. <div slot="footer" class="dialog-footer">
  358. <el-button @click="isShowDialog = false">关 闭</el-button>
  359. </div>
  360. </el-dialog>
  361. <el-dialog title="添加产品" :visible.sync="isShowGoodsDialog" width="80%">
  362. <el-form ref="goodsScreenForm" :model="goodsScreenForm" size="small" label-position="left">
  363. <el-row :gutter="20">
  364. <el-col :xs="12" :sm="6" :lg="6">
  365. <el-form-item prop="proNum">
  366. <el-input v-model="goodsScreenForm.proNum" placeholder="请输入产品编码"></el-input>
  367. </el-form-item>
  368. </el-col>
  369. <el-col :xs="12" :sm="6" :lg="6">
  370. <el-form-item prop="proName">
  371. <el-input v-model="goodsScreenForm.proName" placeholder="请输入产品名称"></el-input>
  372. </el-form-item>
  373. </el-col>
  374. <el-col :xs="12" :sm="6" :lg="6">
  375. <el-form-item prop="proModel">
  376. <el-input v-model="goodsScreenForm.proModel" placeholder="请输入产品型号"></el-input>
  377. </el-form-item>
  378. </el-col>
  379. <el-col :xs="12" :sm="6" :lg="6">
  380. <el-form-item prop="price1" style="display: flex">
  381. <el-input v-model="goodsScreenForm.price1" placeholder="请输入价格" style="width: 46%"></el-input>
  382. <span> - </span>
  383. <el-input v-model="goodsScreenForm.price2" placeholder="请输入价格" style="width: 46%"></el-input>
  384. </el-form-item>
  385. </el-col>
  386. <el-col :xs="24" :sm="24" :lg="24" class="tr">
  387. <el-form-item label="">
  388. <el-button size="small" @click="resetGoodsScreenForm">清空</el-button>
  389. <el-button size="small" type="primary" @click="submitGoodsScreenForm">搜索</el-button>
  390. </el-form-item>
  391. </el-col>
  392. </el-row>
  393. </el-form>
  394. <div class="tables">
  395. <div class="table">
  396. <el-table :data="leftGoodsList" element-loading-text="Loading" border fit highlight-current-row stripe height="400" @selection-change="leftSelectionChange">
  397. <el-table-column align="center" type="selection" width="55" :selectable='checkboxSelect'></el-table-column>
  398. <el-table-column align="center" label="产品编码" prop="number" min-width="100" show-overflow-tooltip></el-table-column>
  399. <el-table-column align="center" label="产品名称" prop="name" min-width="160" show-overflow-tooltip></el-table-column>
  400. <el-table-column align="center" label="产品型号" prop="specification" min-width="160" show-overflow-tooltip></el-table-column>
  401. <el-table-column align="center" label="产品价格" prop="batchPrice" min-width="80" show-overflow-tooltip></el-table-column>
  402. </el-table>
  403. <div class="pagination clearfix" style="margin-top: 10px">
  404. <div class="fr">
  405. <el-pagination
  406. @current-change="handleTableCurrentChange"
  407. :current-page="currentPage"
  408. :page-size="10"
  409. background
  410. layout="prev, pager, next"
  411. :total="listTotal">
  412. </el-pagination>
  413. </div>
  414. </div>
  415. </div>
  416. <div class="buttons">
  417. <el-button size="small" type="primary" @click="addAllGoods">全部添加</el-button>
  418. <el-button size="small" type="primary" @click="addGoods">添&emsp;加</el-button>
  419. <el-button size="small" type="danger" @click="deleteGoods">删&emsp;除</el-button>
  420. <el-button size="small" type="danger" @click="deleteAllGoods">全部删除</el-button>
  421. </div>
  422. <div class="table">
  423. <el-table :data="rightGoodsList" element-loading-text="Loading" border fit highlight-current-row stripe height="400" @selection-change="rightSelectionChange">
  424. <el-table-column align="center" type="selection" width="55"></el-table-column>
  425. <el-table-column align="center" label="产品编码" prop="number" min-width="100" show-overflow-tooltip></el-table-column>
  426. <el-table-column align="center" label="产品名称" prop="name" min-width="160" show-overflow-tooltip></el-table-column>
  427. <el-table-column align="center" label="产品型号" prop="specification" min-width="160" show-overflow-tooltip></el-table-column>
  428. <el-table-column align="center" label="产品价格" prop="batchPrice" min-width="80" show-overflow-tooltip></el-table-column>
  429. </el-table>
  430. </div>
  431. </div>
  432. <span slot="footer" class="dialog-footer">
  433. <el-button @click="closeDialog">取 消</el-button>
  434. <el-button type="primary" @click="submitAddGoods">确 定</el-button>
  435. </span>
  436. </el-dialog>
  437. </div>
  438. </template>
  439. <script>
  440. import { getOrderDetail, getHomeLoginList, getHomeLoginDetail, getWarehouseList, addHome, editHome, submitHome, checkStock, getRetailProductList } from "@/api/supply/engin";
  441. import { getDictList, getTypeList, getSalesmanList } from '@/api/common'
  442. import { findElem } from '@/utils/util'
  443. let that
  444. export default {
  445. name: 'HomeForm',
  446. componentName: 'HomeForm',
  447. props: ['listItem'],
  448. filters: {
  449. status1Filter(val) {
  450. let STOCK_ORDER_START = that.stockList.find(o => o.dictCode == 'STOCK_ORDER_START').dictValue;
  451. let STOCK_ORDER_END = that.stockList.find(o => o.dictCode == 'STOCK_ORDER_END').dictValue;
  452. let STOCK_ORDER_HAVE_START = that.stockList.find(o => o.dictCode == 'STOCK_ORDER_HAVE_START').dictValue;
  453. let STOCK_ORDER_HAVE_END = that.stockList.find(o => o.dictCode == 'STOCK_ORDER_HAVE_END').dictValue;
  454. let STOCK_ORDER_ALL_NUM = that.stockList.find(o => o.dictCode == 'STOCK_ORDER_ALL_NUM').dictValue;
  455. if (val === '' || val === null || val === undefined) return '未检查';
  456. else if (val <= 0) return '无货';
  457. else if (val > STOCK_ORDER_START && val <= STOCK_ORDER_END) return val;
  458. else if (val >= STOCK_ORDER_HAVE_START && val <= STOCK_ORDER_HAVE_END) return '有货';
  459. else if (val > STOCK_ORDER_ALL_NUM) return '充足';
  460. },
  461. },
  462. data() {
  463. return {
  464. editId: '',
  465. mainForm: {
  466. orderNum: '',
  467. orderDate: '',
  468. type: '',
  469. jxsNum: '',
  470. jxsName: '',
  471. loginNum: '',
  472. enginName: '',
  473. loginType: '',
  474. factoryNum: '',
  475. company: '',
  476. saleType: '',
  477. contactMan: '',
  478. tel: '',
  479. phone: '',
  480. address: '',
  481. declareNo: '',
  482. greeRemark: '',
  483. greeReply: '',
  484. remark: '',
  485. createMan: '',
  486. createDate: '',
  487. fileNum: '',
  488. loginUserId: '',
  489. salesMan: '',
  490. projectRemark: '',
  491. projectType: '',
  492. },
  493. mainFormRules: {
  494. // orderDate: [{ required: true, message: '请选择单据日期', trigger: 'change' }],
  495. jxsNum: [{ required: true, message: '请输入经销商编码', trigger: 'blur' }],
  496. jxsName: [{ required: true, message: '请输入经销商名称', trigger: 'blur' }],
  497. loginNum: [{ required: true, message: '请输入工程登录编号', trigger: 'blur' }],
  498. // enginName: [{ required: true, message: '请输入项目类别', trigger: 'blur' }],
  499. // loginType: [{ required: true, message: '请输入行业类别', trigger: 'blur' }],
  500. company: [{ required: true, message: '请输入使用单位', trigger: 'blur' }],
  501. saleType: [{ required: true, message: '请选择销售类型', trigger: 'change' }],
  502. // contactMan: [{ required: true, message: '请输入联系人', trigger: 'blur' }],
  503. // tel: [{ required: true, message: '请输入固定电话', trigger: 'blur' }],
  504. // phone: [{ required: true, message: '请输入移动电话', trigger: 'blur' }],
  505. address: [{ required: true, message: '请输入安装地址', trigger: 'blur' }],
  506. },
  507. salesTypeList: [],
  508. // typeList: [],
  509. stockList: [],
  510. goodsList: [],
  511. isShowDialog: false, // 工程登录列表 - 弹窗
  512. screenForm: {
  513. loginNum: '',
  514. enginName: '',
  515. company: '',
  516. },
  517. dialogTable_dataList: null, // 工程登录列表 - 列表数据
  518. dialogTable_listLoading: true, // 工程登录列表 - 列表加载loading
  519. dialogTable_currentPage: 1, // 工程登录列表 - 当前页码
  520. dialogTable_pageSize: 10, // 工程登录列表 - 每页数量
  521. dialogTable_listTotal: 0, // 工程登录列表 - 列表总数
  522. warehouseList: [],
  523. warehouseValue: '',
  524. isShowGoodsDialog: false,
  525. goodsScreenForm: {
  526. proNum: '',
  527. proName: '',
  528. proModel: '',
  529. price1: '',
  530. price2: '',
  531. },
  532. currentPage: 1,
  533. listTotal: 0,
  534. leftGoodsList: [],
  535. rightGoodsList: [],
  536. leftSelection: [],
  537. rightSelection: [],
  538. formLoading: false,
  539. isFirst: false,
  540. salesmanList: [],
  541. }
  542. },
  543. computed: {
  544. isDealer() {
  545. return JSON.parse(localStorage.getItem("supply_user")).isCustomer
  546. },
  547. outSalesmanList() {
  548. let list = [];
  549. if(this.goodsList && this.goodsList.length) {
  550. this.goodsList.forEach(item => {
  551. if(item.serviceId) {
  552. let hasItem = findElem(list, 'adminUserId', item.serviceId);
  553. if(hasItem < 0) {
  554. let obj = this.salesmanList.find(o => o.adminUserId == item.serviceId);
  555. if(obj) {
  556. list.push(obj);
  557. }
  558. }
  559. }
  560. })
  561. if(this.isFirst) {
  562. this.isFirst = false;
  563. }else {
  564. this.mainForm.salesMan = this.goodsList[0].serviceId;
  565. }
  566. }
  567. return list
  568. }
  569. },
  570. beforeCreate() {
  571. that = this;
  572. },
  573. async created() {
  574. await this.getSalesmanList();
  575. this.getDictList();
  576. this.getSalesTypeList();
  577. this.getWarehouseList();
  578. if(this.listItem) {
  579. this.isFirst = true;
  580. this.editId = this.listItem.parentId;
  581. this.getDetail();
  582. }else {
  583. this.mainForm.jxsNum = JSON.parse(localStorage.getItem("supply_user")).customerNumber;
  584. this.mainForm.jxsName = JSON.parse(localStorage.getItem("supply_user")).customerName;
  585. this.mainForm.createMan = JSON.parse(localStorage.getItem("supply_user")).nickName;
  586. this.mainForm.createDate = this.getDate();
  587. }
  588. },
  589. methods: {
  590. // 返回列表
  591. goBack() {
  592. this.$emit('backListFormDetail');
  593. },
  594. getDate() {
  595. var date = new Date();
  596. var seperator1 = "-";
  597. var year = date.getFullYear();
  598. var month = date.getMonth() + 1;
  599. var strDate = date.getDate();
  600. if (month >= 1 && month <= 9) {
  601. month = "0" + month;
  602. }
  603. if (strDate >= 0 && strDate <= 9) {
  604. strDate = "0" + strDate;
  605. }
  606. var currentdate = year + seperator1 + month + seperator1 + strDate;
  607. return currentdate;
  608. },
  609. // 获取产品大类列表
  610. getDictList() {
  611. // getDictList({sysDictEnum: 'PRODUCT_TYPE'}).then(res => {
  612. // this.typeList = res.data;
  613. // })
  614. getDictList({sysDictEnum: 'STOCK_ORDER'}).then(res => {
  615. this.stockList = res.data;
  616. })
  617. },
  618. // 获取销售类型列表
  619. getSalesTypeList() {
  620. getTypeList({
  621. pageNum: 1,
  622. pageSize: -1
  623. }).then((res) => {
  624. this.salesTypeList = res.data.records;
  625. })
  626. },
  627. // 获取仓库列表
  628. getWarehouseList() {
  629. getWarehouseList({
  630. pageNum: 1,
  631. pageSize: -1
  632. }).then((res) => {
  633. this.warehouseList = res.data.records;
  634. })
  635. },
  636. async getSalesmanList() {
  637. const res = await getSalesmanList({
  638. pageNum: 1,
  639. pageSize: -1,
  640. isCustomer: 0,
  641. status: true,
  642. });
  643. this.salesmanList = res.data.records;
  644. },
  645. // 工程登录列表 - 获取列表
  646. getHomeLoginList() {
  647. getHomeLoginList({
  648. pageNum: this.dialogTable_currentPage,
  649. pageSize: this.dialogTable_pageSize,
  650. recordNo: this.screenForm.loginNum,
  651. projectName: this.screenForm.enginName,
  652. useUnit: this.screenForm.company,
  653. examineStatus: 'OK'
  654. }).then(res => {
  655. this.dialogTable_dataList = res.data.records;
  656. this.dialogTable_listTotal = res.data.total;
  657. this.dialogTable_listLoading = false;
  658. })
  659. },
  660. // 工程登录列表 - 打开弹窗
  661. openShareDetail() {
  662. if(!this.mainForm.saleType) {
  663. return this.$errorMsg('请先选择销售类型');
  664. }
  665. this.isShowDialog = true;
  666. this.dialogTable_currentPage = 1;
  667. this.screenForm.loginNum = this.mainForm.loginNum;
  668. this.getHomeLoginList();
  669. },
  670. // 工程登录列表 - 更改列表当前页
  671. dialogTableCurrentChange(val) {
  672. this.dialogTable_currentPage = val;
  673. this.getHomeLoginList();
  674. },
  675. // 提交筛选表单
  676. submitScreenForm() {
  677. this.dialogTable_currentPage = 1;
  678. this.getHomeLoginList();
  679. },
  680. // 重置筛选表单
  681. resetScreenForm() {
  682. this.$refs.screenForm.resetFields();
  683. this.dialogTable_currentPage = 1;
  684. this.getHomeLoginList();
  685. },
  686. // 选择工程登录
  687. chooseItem(id, uid) {
  688. getHomeLoginDetail({
  689. recordNo: id,
  690. saleTypeId: this.mainForm.saleType,
  691. userId: uid
  692. }).then(res => {
  693. this.isShowDialog = false;
  694. let data = res.data;
  695. this.mainForm.type = data.productCategory;
  696. this.mainForm.loginUserId = data.userid;
  697. // this.mainForm.saleType = '';
  698. this.mainForm.loginNum = data.recordNo;
  699. this.mainForm.enginName = data.projectName;
  700. this.mainForm.loginType = data.promiseStatus;
  701. this.mainForm.company = data.useUnit;
  702. this.mainForm.contactMan = data.buyUnitCallMen;
  703. this.mainForm.tel = data.buyUnitTel;
  704. this.mainForm.phone = data.buyUnitPhone;
  705. this.mainForm.address = data.installAddress;
  706. this.mainForm.declareNo = data.declareNo;
  707. this.mainForm.projectRemark = data.buChonShuoMing;
  708. this.mainForm.projectType = data.govBuyType;
  709. let saleTypeItem = this.salesTypeList.find(o => o.id == this.mainForm.saleType);
  710. this.goodsList = data.items.map(item => {
  711. return {
  712. useRefCount: item.useRefCount,
  713. saleTypeId: saleTypeItem.id,
  714. saleTypeCode: saleTypeItem.saleCode,
  715. saleTypeName: saleTypeItem.saleName,
  716. materialId: item.materialId,
  717. materialNumber: item.materialNumber,
  718. materialOldNumber: item.materialOldNumber,
  719. materialName: item.materialName,
  720. specification: item.machine,
  721. enginNum: item.num,
  722. enginPrice: item.price,
  723. enginTotality: item.totality,
  724. historyHasDeliverQty: item.hasDeliverQty,
  725. unit: item.unit,
  726. price: item.price,
  727. qty: item.num,
  728. customerWalletId2: '',
  729. rebateRate: '',
  730. discAmount: '',
  731. customerWalletId: '',
  732. isDirectTransfer: false,
  733. directTransferQty: '',
  734. hasSendQty: '',
  735. remark: item.discri,
  736. tax: '',
  737. status1: '',
  738. status2: '',
  739. rebateWallets: item.customerWalletList.filter(item => {
  740. return item.type === 'REBATE';
  741. }),
  742. wallets: item.customerWalletList.filter(item => {
  743. return item.type === 'COMMONLY';
  744. }),
  745. }
  746. })
  747. this.goodsList.forEach(item => {
  748. item.customerWalletId = (item.wallets && item.wallets.length) ? item.wallets[0].customerWalletId : '';
  749. item.serviceId = (item.wallets && item.wallets.length) ? item.wallets[0].serviceId : '';
  750. item.serviceName = (item.wallets && item.wallets.length) ? item.wallets[0].serviceName : '';
  751. })
  752. })
  753. },
  754. // 选择销售类型
  755. changeSaleType() {
  756. if(this.mainForm.loginNum) {
  757. this.chooseItem(this.mainForm.loginNum, this.mainForm.loginUserId);
  758. }
  759. },
  760. // 删除产品
  761. deleteItem(index) {
  762. this.goodsList.splice(index, 1);
  763. },
  764. // 修改返利钱包
  765. changeFlWallet(index) {
  766. if(this.goodsList[index].customerWalletId2) {
  767. let obj = this.goodsList[index].rebateWallets.find(o => o.customerWalletId == this.goodsList[index].customerWalletId2);
  768. this.goodsList[index].rebateRate = obj.rebateRate;
  769. this.goodsList[index].customerWalletName2 = obj.customerWalletName;
  770. }else {
  771. this.goodsList[index].rebateRate = '';
  772. this.goodsList[index].customerWalletName2 = '';
  773. }
  774. },
  775. // 修改现金钱包
  776. changeXjWallet(index) {
  777. if(this.goodsList[index].customerWalletId) {
  778. let obj = this.goodsList[index].wallets.find(o => o.customerWalletId == this.goodsList[index].customerWalletId);
  779. this.goodsList[index].customerWalletName = obj.customerWalletName;
  780. }else {
  781. this.goodsList[index].customerWalletName = '';
  782. }
  783. },
  784. // 获取详情
  785. getDetail() {
  786. getOrderDetail({id: this.editId}).then(res => {
  787. let data = res.data;
  788. this.mainForm.orderNum = data.enginOrderId;
  789. this.mainForm.orderDate = data.orderDate;
  790. this.mainForm.type = data.mainId;
  791. this.mainForm.jxsNum = data.customerNumber;
  792. this.mainForm.jxsName = data.customerName;
  793. this.mainForm.loginNum = data.refEnginRecordNo;
  794. this.mainForm.enginName = data.refProjectName;
  795. this.mainForm.loginType = data.refPromiseStatus;
  796. this.mainForm.factoryNum = data.refFactoryNo;
  797. this.mainForm.company = data.refUseUnit;
  798. this.mainForm.saleType = data.saleTypeId;
  799. this.mainForm.contactMan = data.refLinkman;
  800. this.mainForm.tel = data.refTel;
  801. this.mainForm.phone = data.refPhone;
  802. this.mainForm.address = data.refInstallAddress;
  803. this.mainForm.declareNo = data.refDeclareNo;
  804. this.mainForm.greeRemark = data.geLiInerNote;
  805. this.mainForm.greeReply = data.note1;
  806. this.mainForm.remark = data.remark;
  807. this.mainForm.createMan = data.createName;
  808. this.mainForm.createDate = data.createTime;
  809. this.mainForm.fileNum = data.fileNo;
  810. this.mainForm.salesMan = data.serviceId;
  811. this.mainForm.projectRemark = data.refProjectNote;
  812. this.mainForm.projectType = data.refProjectType;
  813. data.items.forEach(item => {
  814. item.status1 = '';
  815. item.status2 = '';
  816. item.rebateWallets = item.customerWalletList.filter(item => {
  817. return item.type === 'REBATE';
  818. });
  819. item.wallets = item.customerWalletList.filter(item => {
  820. return item.type === 'COMMONLY';
  821. });
  822. })
  823. this.goodsList = data.items;
  824. })
  825. },
  826. // 获取商品列表
  827. getGoodsList() {
  828. getRetailProductList({
  829. pageNum: this.currentPage,
  830. pageSize: 10,
  831. saleId: this.mainForm.saleType,
  832. materialCode: this.goodsScreenForm.proNum,
  833. materialName: this.goodsScreenForm.proName,
  834. specification: this.goodsScreenForm.proModel,
  835. price1: this.goodsScreenForm.price1,
  836. price2: this.goodsScreenForm.price2,
  837. }).then(res => {
  838. let oldGoodsList = this.goodsList;
  839. let newGoodsList = res.data.records;
  840. for(let i = 0; i < oldGoodsList.length; i++) {
  841. let oldItem = oldGoodsList[i]
  842. for(let j = 0; j < newGoodsList.length; j++) {
  843. let newItem = newGoodsList[j]
  844. if(newItem.id === oldItem.id){
  845. newGoodsList[j].selected = true;
  846. break;
  847. }
  848. }
  849. }
  850. res.data.records.forEach(item => {
  851. item.materialName = item.name;
  852. item.materialCode = item.number;
  853. item.saleTypeName = item.saleName;
  854. item.unit = item.baseUnit;
  855. item.price = item.batchPrice;
  856. item.tax = item.taxRate;
  857. item.isDirectTransfer = false;
  858. item.directTransferQty = '';
  859. item.status1 = '';
  860. item.status2 = '';
  861. item.rebateAmount = '';
  862. item.rebateRate = '';
  863. item.productPriceId = item.id;
  864. item.customerWalletId = (item.wallets && item.wallets.length) ? item.wallets[0].customerWalletId : '';
  865. });
  866. this.leftGoodsList = res.data.records;
  867. this.listTotal = res.data.total;
  868. })
  869. },
  870. // 查询重复值并禁选
  871. checkboxSelect(row, rowIndex) {
  872. if (row.selected) {
  873. return false // 禁用
  874. }else{
  875. return true // 不禁用
  876. }
  877. },
  878. // 点击 选择商品
  879. openDialog() {
  880. if(!this.mainForm.saleType) {
  881. return this.$errorMsg('请先选择销售类型');
  882. }
  883. this.isShowGoodsDialog = true;
  884. this.getGoodsList();
  885. },
  886. // 提交筛选表单
  887. submitGoodsScreenForm() {
  888. this.currentPage = 1;
  889. this.getGoodsList();
  890. },
  891. // 重置筛选表单
  892. resetGoodsScreenForm() {
  893. this.$refs.goodsScreenForm.resetFields();
  894. this.currentPage = 1;
  895. this.getGoodsList();
  896. },
  897. // 更改列表当前页
  898. handleTableCurrentChange(val) {
  899. this.currentPage = val;
  900. this.getGoodsList();
  901. },
  902. // 关闭 弹窗
  903. closeDialog() {
  904. this.isShowGoodsDialog = false;
  905. },
  906. // 左侧列表选择
  907. leftSelectionChange(val) {
  908. this.leftSelection = val;
  909. },
  910. // 右侧列表选择
  911. rightSelectionChange(val) {
  912. this.rightSelection = val;
  913. },
  914. // 数组去重
  915. delRepeat(arr1, arr2) {
  916. let allArr = arr1.concat(arr2); // 两个数组对象合并
  917. let newArr = []; // 存放去重后数据的新数组
  918. for(let i=0; i<allArr.length; i++){ // 循环allArr数组对象的内容
  919. let flag = true; // 建立标记,判断数据是否重复,true为不重复
  920. for(let j=0; j<newArr.length; j++){ // 循环新数组的内容
  921. if(allArr[i].id == newArr[j].id){ // 让allArr数组对象的内容与新数组的内容作比较,相同的话,改变标记为false
  922. flag = false;
  923. }
  924. }
  925. if(flag){ // 判断是否重复
  926. newArr.push(allArr[i]); // 不重复的放入新数组。 新数组的内容会继续进行上边的循环。
  927. }
  928. }
  929. return newArr;
  930. },
  931. // 全部添加
  932. addAllGoods() {
  933. this.rightGoodsList = this.delRepeat(this.leftGoodsList, this.rightGoodsList);
  934. },
  935. // 添加
  936. addGoods() {
  937. this.rightGoodsList = this.delRepeat(this.leftSelection, this.rightGoodsList);
  938. },
  939. // 删除
  940. deleteGoods() {
  941. let rightGoodsList = this.rightGoodsList;
  942. let rightSelection = this.rightSelection;
  943. for(let i = 0; i < rightGoodsList.length; i++) {
  944. for(let j = 0; j < rightSelection.length; j++) {
  945. if(rightSelection[j].materialId == rightGoodsList[i].materialId){
  946. this.rightGoodsList.splice(i, 1);
  947. }
  948. }
  949. }
  950. },
  951. // 全部删除
  952. deleteAllGoods() {
  953. this.rightGoodsList = [];
  954. },
  955. // 确定 添加产品
  956. submitAddGoods() {
  957. // this.goodsList = this.delRepeat(this.rightGoodsList, this.goodsList);
  958. this.goodsList = this.goodsList.concat(this.rightGoodsList);
  959. this.isShowGoodsDialog = false;
  960. this.leftGoodsList = [];
  961. this.rightGoodsList = [];
  962. },
  963. // 检查库存
  964. checkStock() {
  965. if(!this.warehouseValue) {
  966. return this.$errorMsg('请选择仓库');
  967. }
  968. if(!this.goodsList) {
  969. return this.$errorMsg('请添加货品');
  970. }
  971. let ids = [];
  972. this.goodsList.forEach(item => {
  973. ids.push(item.materialId);
  974. })
  975. checkStock({
  976. correspondId: this.warehouseValue,
  977. materialId: ids.join(',')
  978. }).then(res => {
  979. if(res.data) {
  980. this.goodsList.forEach((item, index) => {
  981. item.status1 = res.data[index].allStockNum;
  982. item.status2 = res.data[index].stockNum;
  983. })
  984. }
  985. })
  986. },
  987. status2Filter(item) {
  988. if (item.status2 === '' || item.status2 === null || item.status2 === undefined) return '未检查';
  989. else if (item.status2 <= 0) return '无货';
  990. else if (item.status2 >= item.qty) return '可用';
  991. else return '短缺';
  992. },
  993. // 保存 / 提交审核
  994. clickSubmitForm(type) {
  995. this.$refs.mainForm.validate((valid) => {
  996. if (valid) {
  997. for(let i=0; i<this.goodsList.length; i++) {
  998. if(!this.goodsList[i].customerWalletId) {
  999. this.$errorMsg('请选择现金钱包');
  1000. return;
  1001. }
  1002. }
  1003. let goodsList = JSON.parse(JSON.stringify(this.goodsList));
  1004. goodsList.forEach(item => {
  1005. delete item.rebateWallets;
  1006. delete item.wallets;
  1007. })
  1008. let saleTypeItem = this.salesTypeList.find(o => o.id == this.mainForm.saleType);
  1009. let saleManItem = this.mainForm.salesMan ? this.outSalesmanList.find(o => o.adminUserId == this.mainForm.salesMan) : '';
  1010. let params = {
  1011. enginOrderId: this.mainForm.orderNum,
  1012. // orderDate: this.mainForm.orderDate,
  1013. // mainId: this.mainForm.type || '',
  1014. loginUserId: this.mainForm.loginUserId,
  1015. refEnginRecordNo: this.mainForm.loginNum || '',
  1016. refProjectName: this.mainForm.enginName || '',
  1017. refPromiseStatus: this.mainForm.loginType || '',
  1018. refFactoryNo: this.mainForm.factoryNum || '',
  1019. refUseUnit: this.mainForm.company || '',
  1020. refLinkman: this.mainForm.contactMan || '',
  1021. refTel: this.mainForm.tel || '',
  1022. refPhone: this.mainForm.phone || '',
  1023. refInstallAddress: this.mainForm.address || '',
  1024. refDeclareNo: this.mainForm.declareNo || '',
  1025. saleTypeId: this.mainForm.saleType,
  1026. saleTypeCode: saleTypeItem.saleCode,
  1027. saleTypeName: saleTypeItem.saleName,
  1028. geLiInerNote: this.mainForm.greeRemark || '',
  1029. note1: this.mainForm.greeReply || '',
  1030. remark: this.mainForm.remark || '',
  1031. fileNo: this.mainForm.fileNum || '',
  1032. serviceId: this.mainForm.salesMan,
  1033. serviceName: saleManItem.nickName,
  1034. refProjectNote: this.mainForm.projectRemark,
  1035. refProjectType: this.mainForm.projectType,
  1036. items: goodsList,
  1037. }
  1038. this.formLoading = true;
  1039. if(type === 1) {
  1040. if(this.listItem) {
  1041. editHome(params).then(res => {
  1042. this.$successMsg('编辑成功');
  1043. this.goBack();
  1044. this.$parent.getList();
  1045. }).finally(res => {
  1046. this.formLoading = false;
  1047. })
  1048. }else {
  1049. addHome(params).then(res => {
  1050. this.$successMsg('新增成功');
  1051. this.goBack();
  1052. this.$parent.getList();
  1053. }).finally(res => {
  1054. this.formLoading = false;
  1055. })
  1056. }
  1057. }else if(type === 2) {
  1058. submitHome(params).then(res => {
  1059. this.$successMsg('提交审核成功');
  1060. this.goBack();
  1061. this.$parent.getList();
  1062. }).finally(res => {
  1063. this.formLoading = false;
  1064. })
  1065. }
  1066. }
  1067. })
  1068. },
  1069. }
  1070. }
  1071. </script>
  1072. <style scoped lang="scss">
  1073. .detail-container {
  1074. width: 100%;
  1075. height: 100%;
  1076. }
  1077. .main-title {
  1078. display: flex;
  1079. justify-content: space-between;
  1080. align-items: center;
  1081. margin-top: 20px;
  1082. height: 60px;
  1083. border-bottom: 1px solid #DCDFE6;
  1084. margin-bottom: 20px;
  1085. .title {
  1086. font-size: 16px;
  1087. font-weight: 600;
  1088. padding-left: 10px;
  1089. }
  1090. }
  1091. .tables {
  1092. display: flex;
  1093. margin-top: 10px;
  1094. .table {
  1095. width: 45%;
  1096. }
  1097. .buttons {
  1098. display: flex;
  1099. flex-direction: column;
  1100. justify-content: center;
  1101. align-items: center;
  1102. padding: 0 10px;
  1103. button {
  1104. margin: 0;
  1105. margin-top: 10px;
  1106. }
  1107. }
  1108. }
  1109. ::v-deep input::-webkit-outer-spin-button,
  1110. ::v-deep input::-webkit-inner-spin-button {
  1111. -webkit-appearance: none;
  1112. }
  1113. ::v-deep input[type='number'] {
  1114. -moz-appearance: textfield;
  1115. }
  1116. </style>