home_form.vue 47 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194
  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. enginOrderId: this.mainForm.orderNum
  693. }).then(res => {
  694. this.isShowDialog = false;
  695. let data = res.data;
  696. this.mainForm.type = data.productCategory;
  697. this.mainForm.loginUserId = data.userid;
  698. // this.mainForm.saleType = '';
  699. this.mainForm.loginNum = data.recordNo;
  700. this.mainForm.enginName = data.projectName;
  701. this.mainForm.loginType = data.promiseStatus;
  702. this.mainForm.company = data.useUnit;
  703. this.mainForm.contactMan = data.buyUnitCallMen;
  704. this.mainForm.tel = data.buyUnitTel;
  705. this.mainForm.phone = data.buyUnitPhone;
  706. this.mainForm.address = data.installAddress;
  707. this.mainForm.declareNo = data.declareNo;
  708. this.mainForm.projectRemark = data.buChonShuoMing;
  709. this.mainForm.projectType = data.govBuyType;
  710. let saleTypeItem = this.salesTypeList.find(o => o.id == this.mainForm.saleType);
  711. this.goodsList = data.items.map(item => {
  712. return {
  713. useRefCount: item.useRefCount,
  714. saleTypeId: saleTypeItem.id,
  715. saleTypeCode: saleTypeItem.saleCode,
  716. saleTypeName: saleTypeItem.saleName,
  717. materialId: item.materialId,
  718. materialNumber: item.materialNumber,
  719. materialOldNumber: item.materialOldNumber,
  720. materialName: item.materialName,
  721. specification: item.machine,
  722. enginNum: item.num,
  723. enginPrice: item.price,
  724. enginTotality: item.totality,
  725. historyHasDeliverQty: item.hasDeliverQty,
  726. unit: item.unit,
  727. price: item.price,
  728. qty: item.num,
  729. customerWalletId2: '',
  730. rebateRate: '',
  731. discAmount: '',
  732. customerWalletId: '',
  733. isDirectTransfer: false,
  734. directTransferQty: '',
  735. hasSendQty: '',
  736. remark: item.discri,
  737. tax: '',
  738. status1: '',
  739. status2: '',
  740. rebateWallets: item.customerWalletList.filter(item => {
  741. return item.type === 'REBATE';
  742. }),
  743. wallets: item.customerWalletList.filter(item => {
  744. return item.type === 'COMMONLY';
  745. }),
  746. }
  747. })
  748. this.goodsList.forEach(item => {
  749. item.customerWalletId = (item.wallets && item.wallets.length) ? item.wallets[0].customerWalletId : '';
  750. item.serviceId = (item.wallets && item.wallets.length) ? item.wallets[0].serviceId : '';
  751. item.serviceName = (item.wallets && item.wallets.length) ? item.wallets[0].serviceName : '';
  752. })
  753. })
  754. },
  755. // 选择销售类型
  756. changeSaleType() {
  757. if(this.mainForm.loginNum) {
  758. this.chooseItem(this.mainForm.loginNum, this.mainForm.loginUserId);
  759. }
  760. },
  761. // 删除产品
  762. deleteItem(index) {
  763. this.goodsList.splice(index, 1);
  764. },
  765. // 修改返利钱包
  766. changeFlWallet(index) {
  767. if(this.goodsList[index].customerWalletId2) {
  768. let obj = this.goodsList[index].rebateWallets.find(o => o.customerWalletId == this.goodsList[index].customerWalletId2);
  769. this.goodsList[index].rebateRate = obj.rebateRate;
  770. this.goodsList[index].customerWalletName2 = obj.customerWalletName;
  771. }else {
  772. this.goodsList[index].rebateRate = '';
  773. this.goodsList[index].customerWalletName2 = '';
  774. }
  775. },
  776. // 修改现金钱包
  777. changeXjWallet(index) {
  778. if(this.goodsList[index].customerWalletId) {
  779. let obj = this.goodsList[index].wallets.find(o => o.customerWalletId == this.goodsList[index].customerWalletId);
  780. this.goodsList[index].customerWalletName = obj.customerWalletName;
  781. }else {
  782. this.goodsList[index].customerWalletName = '';
  783. }
  784. },
  785. // 获取详情
  786. getDetail() {
  787. getOrderDetail({id: this.editId}).then(res => {
  788. let data = res.data;
  789. this.mainForm.orderNum = data.enginOrderId;
  790. this.mainForm.orderDate = data.orderDate;
  791. this.mainForm.type = data.mainId;
  792. this.mainForm.jxsNum = data.customerNumber;
  793. this.mainForm.jxsName = data.customerName;
  794. this.mainForm.loginNum = data.refEnginRecordNo;
  795. this.mainForm.enginName = data.refProjectName;
  796. this.mainForm.loginType = data.refPromiseStatus;
  797. this.mainForm.factoryNum = data.refFactoryNo;
  798. this.mainForm.company = data.refUseUnit;
  799. this.mainForm.saleType = data.saleTypeId;
  800. this.mainForm.contactMan = data.refLinkman;
  801. this.mainForm.tel = data.refTel;
  802. this.mainForm.phone = data.refPhone;
  803. this.mainForm.address = data.refInstallAddress;
  804. this.mainForm.declareNo = data.refDeclareNo;
  805. this.mainForm.greeRemark = data.geLiInerNote;
  806. this.mainForm.greeReply = data.note1;
  807. this.mainForm.remark = data.remark;
  808. this.mainForm.createMan = data.createName;
  809. this.mainForm.createDate = data.createTime;
  810. this.mainForm.fileNum = data.fileNo;
  811. this.mainForm.salesMan = data.serviceId;
  812. this.mainForm.projectRemark = data.refProjectNote;
  813. this.mainForm.projectType = data.refProjectType;
  814. data.items.forEach(item => {
  815. item.status1 = '';
  816. item.status2 = '';
  817. item.rebateWallets = item.customerWalletList.filter(item => {
  818. return item.type === 'REBATE';
  819. });
  820. item.wallets = item.customerWalletList.filter(item => {
  821. return item.type === 'COMMONLY';
  822. });
  823. })
  824. this.goodsList = data.items;
  825. })
  826. },
  827. // 获取商品列表
  828. getGoodsList() {
  829. getRetailProductList({
  830. pageNum: this.currentPage,
  831. pageSize: 10,
  832. saleId: this.mainForm.saleType,
  833. materialCode: this.goodsScreenForm.proNum,
  834. materialName: this.goodsScreenForm.proName,
  835. specification: this.goodsScreenForm.proModel,
  836. price1: this.goodsScreenForm.price1,
  837. price2: this.goodsScreenForm.price2,
  838. }).then(res => {
  839. let oldGoodsList = this.goodsList;
  840. let newGoodsList = res.data.records;
  841. for(let i = 0; i < oldGoodsList.length; i++) {
  842. let oldItem = oldGoodsList[i]
  843. for(let j = 0; j < newGoodsList.length; j++) {
  844. let newItem = newGoodsList[j]
  845. if(newItem.id === oldItem.id){
  846. newGoodsList[j].selected = true;
  847. break;
  848. }
  849. }
  850. }
  851. res.data.records.forEach(item => {
  852. item.materialName = item.name;
  853. item.materialCode = item.number;
  854. item.saleTypeName = item.saleName;
  855. item.unit = item.baseUnit;
  856. item.price = item.batchPrice;
  857. item.tax = item.taxRate;
  858. item.isDirectTransfer = false;
  859. item.directTransferQty = '';
  860. item.status1 = '';
  861. item.status2 = '';
  862. item.rebateAmount = '';
  863. item.rebateRate = '';
  864. item.productPriceId = item.id;
  865. item.customerWalletId = (item.wallets && item.wallets.length) ? item.wallets[0].customerWalletId : '';
  866. });
  867. this.leftGoodsList = res.data.records;
  868. this.listTotal = res.data.total;
  869. })
  870. },
  871. // 查询重复值并禁选
  872. checkboxSelect(row, rowIndex) {
  873. if (row.selected) {
  874. return false // 禁用
  875. }else{
  876. return true // 不禁用
  877. }
  878. },
  879. // 点击 选择商品
  880. openDialog() {
  881. if(!this.mainForm.saleType) {
  882. return this.$errorMsg('请先选择销售类型');
  883. }
  884. this.isShowGoodsDialog = true;
  885. this.getGoodsList();
  886. },
  887. // 提交筛选表单
  888. submitGoodsScreenForm() {
  889. this.currentPage = 1;
  890. this.getGoodsList();
  891. },
  892. // 重置筛选表单
  893. resetGoodsScreenForm() {
  894. this.$refs.goodsScreenForm.resetFields();
  895. this.currentPage = 1;
  896. this.getGoodsList();
  897. },
  898. // 更改列表当前页
  899. handleTableCurrentChange(val) {
  900. this.currentPage = val;
  901. this.getGoodsList();
  902. },
  903. // 关闭 弹窗
  904. closeDialog() {
  905. this.isShowGoodsDialog = false;
  906. },
  907. // 左侧列表选择
  908. leftSelectionChange(val) {
  909. this.leftSelection = val;
  910. },
  911. // 右侧列表选择
  912. rightSelectionChange(val) {
  913. this.rightSelection = val;
  914. },
  915. // 数组去重
  916. delRepeat(arr1, arr2) {
  917. let allArr = arr1.concat(arr2); // 两个数组对象合并
  918. let newArr = []; // 存放去重后数据的新数组
  919. for(let i=0; i<allArr.length; i++){ // 循环allArr数组对象的内容
  920. let flag = true; // 建立标记,判断数据是否重复,true为不重复
  921. for(let j=0; j<newArr.length; j++){ // 循环新数组的内容
  922. if(allArr[i].id == newArr[j].id){ // 让allArr数组对象的内容与新数组的内容作比较,相同的话,改变标记为false
  923. flag = false;
  924. }
  925. }
  926. if(flag){ // 判断是否重复
  927. newArr.push(allArr[i]); // 不重复的放入新数组。 新数组的内容会继续进行上边的循环。
  928. }
  929. }
  930. return newArr;
  931. },
  932. // 全部添加
  933. addAllGoods() {
  934. this.rightGoodsList = this.delRepeat(this.leftGoodsList, this.rightGoodsList);
  935. },
  936. // 添加
  937. addGoods() {
  938. this.rightGoodsList = this.delRepeat(this.leftSelection, this.rightGoodsList);
  939. },
  940. // 删除
  941. deleteGoods() {
  942. let rightGoodsList = this.rightGoodsList;
  943. let rightSelection = this.rightSelection;
  944. for(let i = 0; i < rightGoodsList.length; i++) {
  945. for(let j = 0; j < rightSelection.length; j++) {
  946. if(rightSelection[j].materialId == rightGoodsList[i].materialId){
  947. this.rightGoodsList.splice(i, 1);
  948. }
  949. }
  950. }
  951. },
  952. // 全部删除
  953. deleteAllGoods() {
  954. this.rightGoodsList = [];
  955. },
  956. // 确定 添加产品
  957. submitAddGoods() {
  958. // this.goodsList = this.delRepeat(this.rightGoodsList, this.goodsList);
  959. this.goodsList = this.goodsList.concat(this.rightGoodsList);
  960. this.isShowGoodsDialog = false;
  961. this.leftGoodsList = [];
  962. this.rightGoodsList = [];
  963. },
  964. // 检查库存
  965. checkStock() {
  966. if(!this.warehouseValue) {
  967. return this.$errorMsg('请选择仓库');
  968. }
  969. if(!this.goodsList) {
  970. return this.$errorMsg('请添加货品');
  971. }
  972. let ids = [];
  973. this.goodsList.forEach(item => {
  974. ids.push(item.materialId);
  975. })
  976. checkStock({
  977. correspondId: this.warehouseValue,
  978. materialId: ids.join(',')
  979. }).then(res => {
  980. if(res.data) {
  981. this.goodsList.forEach((item, index) => {
  982. item.status1 = res.data[index].allStockNum;
  983. item.status2 = res.data[index].stockNum;
  984. })
  985. }
  986. })
  987. },
  988. status2Filter(item) {
  989. if (item.status2 === '' || item.status2 === null || item.status2 === undefined) return '未检查';
  990. else if (item.status2 <= 0) return '无货';
  991. else if (item.status2 >= item.qty) return '可用';
  992. else return '短缺';
  993. },
  994. // 保存 / 提交审核
  995. clickSubmitForm(type) {
  996. this.$refs.mainForm.validate((valid) => {
  997. if (valid) {
  998. for(let i=0; i<this.goodsList.length; i++) {
  999. if(!this.goodsList[i].customerWalletId) {
  1000. this.$errorMsg('请选择现金钱包');
  1001. return;
  1002. }
  1003. }
  1004. let goodsList = JSON.parse(JSON.stringify(this.goodsList));
  1005. goodsList.forEach(item => {
  1006. delete item.rebateWallets;
  1007. delete item.wallets;
  1008. })
  1009. let saleTypeItem = this.salesTypeList.find(o => o.id == this.mainForm.saleType);
  1010. let saleManItem = this.mainForm.salesMan ? this.outSalesmanList.find(o => o.adminUserId == this.mainForm.salesMan) : '';
  1011. let params = {
  1012. enginOrderId: this.mainForm.orderNum,
  1013. // orderDate: this.mainForm.orderDate,
  1014. // mainId: this.mainForm.type || '',
  1015. loginUserId: this.mainForm.loginUserId,
  1016. refEnginRecordNo: this.mainForm.loginNum || '',
  1017. refProjectName: this.mainForm.enginName || '',
  1018. refPromiseStatus: this.mainForm.loginType || '',
  1019. refFactoryNo: this.mainForm.factoryNum || '',
  1020. refUseUnit: this.mainForm.company || '',
  1021. refLinkman: this.mainForm.contactMan || '',
  1022. refTel: this.mainForm.tel || '',
  1023. refPhone: this.mainForm.phone || '',
  1024. refInstallAddress: this.mainForm.address || '',
  1025. refDeclareNo: this.mainForm.declareNo || '',
  1026. saleTypeId: this.mainForm.saleType,
  1027. saleTypeCode: saleTypeItem.saleCode,
  1028. saleTypeName: saleTypeItem.saleName,
  1029. geLiInerNote: this.mainForm.greeRemark || '',
  1030. note1: this.mainForm.greeReply || '',
  1031. remark: this.mainForm.remark || '',
  1032. fileNo: this.mainForm.fileNum || '',
  1033. serviceId: this.mainForm.salesMan,
  1034. serviceName: saleManItem.nickName,
  1035. refProjectNote: this.mainForm.projectRemark,
  1036. refProjectType: this.mainForm.projectType,
  1037. items: goodsList,
  1038. }
  1039. this.formLoading = true;
  1040. if(type === 1) {
  1041. if(this.listItem) {
  1042. editHome(params).then(res => {
  1043. this.$successMsg('编辑成功');
  1044. this.goBack();
  1045. this.$parent.getList();
  1046. }).finally(res => {
  1047. this.formLoading = false;
  1048. })
  1049. }else {
  1050. addHome(params).then(res => {
  1051. this.$successMsg('新增成功');
  1052. this.goBack();
  1053. this.$parent.getList();
  1054. }).finally(res => {
  1055. this.formLoading = false;
  1056. })
  1057. }
  1058. }else if(type === 2) {
  1059. submitHome(params).then(res => {
  1060. this.$successMsg('提交审核成功');
  1061. this.goBack();
  1062. this.$parent.getList();
  1063. }).finally(res => {
  1064. this.formLoading = false;
  1065. })
  1066. }
  1067. }
  1068. })
  1069. },
  1070. }
  1071. }
  1072. </script>
  1073. <style scoped lang="scss">
  1074. .detail-container {
  1075. width: 100%;
  1076. height: 100%;
  1077. }
  1078. .main-title {
  1079. display: flex;
  1080. justify-content: space-between;
  1081. align-items: center;
  1082. margin-top: 20px;
  1083. height: 60px;
  1084. border-bottom: 1px solid #DCDFE6;
  1085. margin-bottom: 20px;
  1086. .title {
  1087. font-size: 16px;
  1088. font-weight: 600;
  1089. padding-left: 10px;
  1090. }
  1091. }
  1092. .tables {
  1093. display: flex;
  1094. margin-top: 10px;
  1095. .table {
  1096. width: 45%;
  1097. }
  1098. .buttons {
  1099. display: flex;
  1100. flex-direction: column;
  1101. justify-content: center;
  1102. align-items: center;
  1103. padding: 0 10px;
  1104. button {
  1105. margin: 0;
  1106. margin-top: 10px;
  1107. }
  1108. }
  1109. }
  1110. ::v-deep input::-webkit-outer-spin-button,
  1111. ::v-deep input::-webkit-inner-spin-button {
  1112. -webkit-appearance: none;
  1113. }
  1114. ::v-deep input[type='number'] {
  1115. -moz-appearance: textfield;
  1116. }
  1117. </style>