home_detail.vue 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744
  1. <template>
  2. <div class="detail-container">
  3. <div v-show="!isShowCheckOrder">
  4. <el-page-header @back="goBack" content="详情"></el-page-header>
  5. <div id="printData">
  6. <div class="main-title">
  7. <div class="title">工程订单</div>
  8. </div>
  9. <div class="diy-table-1">
  10. <el-row>
  11. <el-col :span="8" class="item">
  12. <div class="label">工程订单号</div>
  13. <div class="value">{{detailData.enginOrderNo}}</div>
  14. </el-col>
  15. <el-col :span="8" class="item">
  16. <div class="label">订单日期</div>
  17. <div class="value">{{detailData.orderDate}}</div>
  18. </el-col>
  19. <el-col :span="8" class="item">
  20. <div class="label">单据状态</div>
  21. <div class="value">{{detailData.examineStatus | statusFilter}}</div>
  22. </el-col>
  23. <el-col :span="8" class="item">
  24. <div class="label">经销商编码</div>
  25. <div class="value">{{detailData.customerNumber}}</div>
  26. </el-col>
  27. <el-col :span="8" class="item">
  28. <div class="label">经销商名称</div>
  29. <div class="value">{{detailData.customerName}}</div>
  30. </el-col>
  31. <el-col :span="8" class="item">
  32. <div class="label">机型类别</div>
  33. <div class="value">{{detailData.refMachineType}}</div>
  34. </el-col>
  35. <el-col :span="8" class="item">
  36. <div class="label">工程登录编号</div>
  37. <div class="value">{{detailData.refEnginRecordNo}}</div>
  38. </el-col>
  39. <el-col :span="8" class="item">
  40. <div class="label">项目类别</div>
  41. <div class="value">{{detailData.refProjectCategory}}</div>
  42. </el-col>
  43. <el-col :span="8" class="item">
  44. <div class="label">行业类别</div>
  45. <div class="value">{{detailData.refTradeCategory}}</div>
  46. </el-col>
  47. <el-col :span="8" class="item">
  48. <div class="label">跨区厂编号</div>
  49. <div class="value">{{detailData.refFactoryNo}}</div>
  50. </el-col>
  51. <el-col :span="8" class="item">
  52. <div class="label">使用单位</div>
  53. <div class="value">{{detailData.refUseUnit}}</div>
  54. </el-col>
  55. <el-col :span="8" class="item">
  56. <div class="label">购买单位</div>
  57. <div class="value">{{detailData.refBuyUnitName}}</div>
  58. </el-col>
  59. <el-col :span="8" class="item">
  60. <div class="label">区域</div>
  61. <div class="value">{{detailData.refRegionWork}}</div>
  62. </el-col>
  63. <el-col :span="8" class="item">
  64. <div class="label">销售类型</div>
  65. <div class="value">{{detailData.saleTypeName}}</div>
  66. </el-col>
  67. <el-col :span="8" class="item">
  68. <div class="label">第几次申报</div>
  69. <div class="value">{{detailData.refDeclareNo}}</div>
  70. </el-col>
  71. <el-col :span="8" class="item">
  72. <div class="label">联系人</div>
  73. <div class="value">{{detailData.refLinkman}}</div>
  74. </el-col>
  75. <el-col :span="8" class="item">
  76. <div class="label">固定电话</div>
  77. <div class="value">{{detailData.refTel}}</div>
  78. </el-col>
  79. <el-col :span="8" class="item">
  80. <div class="label">移动电话</div>
  81. <div class="value">{{detailData.refPhone}}</div>
  82. </el-col>
  83. <el-col :span="16" class="item">
  84. <div class="label">安装地址</div>
  85. <div class="value">{{detailData.refInstallAddress}}</div>
  86. </el-col>
  87. <el-col :span="8" class="item">
  88. <div class="label">保证函</div>
  89. <div class="value">{{detailData.refPromiseProvide}}</div>
  90. </el-col>
  91. <el-col :span="8" class="item">
  92. <div class="label">不扣押金</div>
  93. <div class="value">{{detailData.takeDeposit ? '是':'否'}}</div>
  94. </el-col>
  95. <el-col :span="8" class="item">
  96. <div class="label">文件编号</div>
  97. <div class="value">{{detailData.fileNo}}</div>
  98. </el-col>
  99. <el-col :span="8" class="item">
  100. <div class="label">业务员</div>
  101. <div class="value">{{detailData.serviceName}}</div>
  102. </el-col>
  103. <!-- <el-col :span="24" class="item">
  104. <div class="label">格力回复</div>
  105. <div class="value">{{detailData.note1}}</div>
  106. </el-col> -->
  107. <el-col :span="16" class="item">
  108. <div class="label">项目说明</div>
  109. <div class="value">{{detailData.refProjectNote}}</div>
  110. </el-col>
  111. <el-col :span="8" class="item">
  112. <div class="label">项目类型</div>
  113. <div class="value">{{detailData.refProjectType}}</div>
  114. </el-col>
  115. <el-col :span="24" class="item">
  116. <div class="label">其他附件审批意见</div>
  117. <div class="value">{{detailData.refOtherAnnexIdea}}</div>
  118. </el-col>
  119. <el-col :span="24" class="item" v-if="!isDealer">
  120. <div class="label">格力内部备注</div>
  121. <div class="value">
  122. <el-input v-model="detailData.geLiInerNote" placeholder="请输入格力内部备注"></el-input>
  123. <el-divider direction="vertical"></el-divider>
  124. <el-button type="text" @click="saveRemark">保存备注</el-button>
  125. </div>
  126. </el-col>
  127. <el-col :span="24" class="item">
  128. <div class="label">备注</div>
  129. <div class="value">{{detailData.remark}}</div>
  130. </el-col>
  131. <el-col :span="6" class="item">
  132. <div class="label">制单人</div>
  133. <div class="value">{{detailData.createName}}</div>
  134. </el-col>
  135. <el-col :span="6" class="item">
  136. <div class="label">制单日期</div>
  137. <div class="value">{{detailData.createTime}}</div>
  138. </el-col>
  139. <el-col :span="6" class="item">
  140. <div class="label">审核人</div>
  141. <div class="value">{{detailData.confirmName}}</div>
  142. </el-col>
  143. <el-col :span="6" class="item">
  144. <div class="label">审核日期</div>
  145. <div class="value">{{detailData.confirmTime}}</div>
  146. </el-col>
  147. <el-col :span="6" class="item">
  148. <div class="label">最后更新人</div>
  149. <div class="value">{{detailData.updateName}}</div>
  150. </el-col>
  151. <el-col :span="6" class="item">
  152. <div class="label">最后更新日期</div>
  153. <div class="value">{{detailData.updateTime}}</div>
  154. </el-col>
  155. <el-col :span="6" class="item">
  156. <div class="label">关闭人</div>
  157. <div class="value">{{detailData.closeName}}</div>
  158. </el-col>
  159. <el-col :span="6" class="item">
  160. <div class="label">关闭日期</div>
  161. <div class="value">{{detailData.closeTime}}</div>
  162. </el-col>
  163. <el-col :span="24" class="item">
  164. <div class="label">审批说明</div>
  165. <div class="value">{{detailData.examineNote}}</div>
  166. </el-col>
  167. <el-col :span="24" class="item" v-if="!isDealer">
  168. <div class="label" >引用记录</div>
  169. <div class="value">{{detailData.items[0]&&detailData.items[0].useRefCount}}</div>
  170. </el-col>
  171. </el-row>
  172. </div>
  173. <div class="main-title">
  174. <div class="title">货品信息</div>
  175. </div>
  176. <div class="table" style="margin-top: 20px">
  177. <el-table
  178. :data="detailData.items"
  179. element-loading-text="Loading"
  180. border
  181. fit
  182. highlight-current-row
  183. stripe
  184. max-height="400"
  185. show-summary
  186. :summary-method="$getSummaries">
  187. <el-table-column align="center" label="序号" type="index" width="50"></el-table-column>
  188. <el-table-column align="left" label="销售类型" prop="saleTypeName" min-width="100" show-overflow-tooltip></el-table-column>
  189. <el-table-column align="left" label="物料编码" prop="materialNumber" min-width="120" show-overflow-tooltip></el-table-column>
  190. <el-table-column align="left" label="产品编码" prop="materialOldNumber" min-width="120" show-overflow-tooltip></el-table-column>
  191. <el-table-column align="left" label="产品名称" prop="materialName" min-width="160" show-overflow-tooltip></el-table-column>
  192. <el-table-column align="left" label="规格型号" prop="specification" min-width="350" show-overflow-tooltip></el-table-column>
  193. <el-table-column align="left" label="实装规格型号" prop="realSpecification" min-width="300" show-overflow-tooltip></el-table-column>
  194. <el-table-column align="right" label="数量" prop="qty" min-width="100" show-overflow-tooltip></el-table-column>
  195. <el-table-column align="right" label="单价" prop="price" min-width="100" show-overflow-tooltip>
  196. <template slot-scope="scope">
  197. {{ scope.row.price | numToFixed }}
  198. </template>
  199. </el-table-column>
  200. <el-table-column align="right" label="订单金额" prop="totalAmount" min-width="100" show-overflow-tooltip>
  201. <template slot-scope="scope">
  202. {{ scope.row.totalAmount | numToFixed }}
  203. </template>
  204. </el-table-column>
  205. <el-table-column align="right" label="工程登录数量" prop="enginNum" min-width="120" show-overflow-tooltip></el-table-column>
  206. <el-table-column align="left" label="现金钱包" prop="customerWalletName" min-width="100" show-overflow-tooltip></el-table-column>
  207. <el-table-column align="right" label="返利类型" prop="customerWalletName2" min-width="100" show-overflow-tooltip></el-table-column>
  208. <el-table-column align="right" label="实付返利金额" prop="payRebateAmount" min-width="100" show-overflow-tooltip>
  209. <template slot-scope="scope">
  210. {{ scope.row.payRebateAmount | numToFixed }}
  211. </template>
  212. </el-table-column>
  213. <el-table-column align="right" label="格力折扣" prop="discAmount" min-width="100" show-overflow-tooltip>
  214. <template slot-scope="scope">
  215. {{ scope.row.discAmount | numToFixed }}
  216. </template>
  217. </el-table-column>
  218. <el-table-column align="right" label="实付金额" prop="payAmount" min-width="100" show-overflow-tooltip>
  219. <template slot-scope="scope">
  220. {{ scope.row.payAmount | numToFixed }}
  221. </template>
  222. </el-table-column>
  223. <el-table-column align="left" label="是否直调" prop="isDirectTransfer" min-width="100" show-overflow-tooltip>
  224. <template slot-scope="scope">
  225. {{ scope.row.isDirectTransfer ? '是' : '否' }}
  226. </template>
  227. </el-table-column>
  228. <el-table-column align="right" label="直调数量" prop="directTransferQty" min-width="100" show-overflow-tooltip></el-table-column>
  229. <el-table-column align="right" label="已发货数量" prop="hasSendQty" min-width="100" show-overflow-tooltip></el-table-column>
  230. <!-- <el-table-column align="right" label="原订单数量" prop="oldQty" min-width="100" show-overflow-tooltip></el-table-column> -->
  231. <el-table-column align="left" label="备注" prop="remark" min-width="160" show-overflow-tooltip></el-table-column>
  232. <el-table-column align="left" label="实装物料编号" prop="realMaterialNumber" min-width="150" show-overflow-tooltip></el-table-column>
  233. <el-table-column align="left" label="实装厂产品编码" prop="realMaterialOldNumber" min-width="200" show-overflow-tooltip></el-table-column>
  234. <el-table-column align="left" label="税率" prop="tax" min-width="100" show-overflow-tooltip></el-table-column>
  235. <el-table-column align="left" label="单位" prop="unit" min-width="100" show-overflow-tooltip></el-table-column>
  236. </el-table>
  237. </div>
  238. </div>
  239. <div class="page-footer">
  240. <div class="footer">
  241. <el-button type="success" @click="toCheckOrder">联查单据</el-button>
  242. <el-button type="danger" @click="closeData" v-if="!isDealer && (detailData.examineStatus === 'SAVE' || detailData.examineStatus === 'WAIT')">关闭订单</el-button>
  243. <el-button type="primary" @click="openDirectDialog" v-if="!isDealer">提前开票</el-button>
  244. <el-button type="primary" @click="overData" v-if="!isDealer">直调完结</el-button>
  245. <el-button type="primary" @click="openDeliverDialog" :disabled="detailData.directTransferStatus" v-if="!isDealer">直调发货</el-button>
  246. <el-button @click="goBack">返回列表</el-button>
  247. </div>
  248. </div>
  249. </div>
  250. <el-dialog title="直调发货" :visible.sync="isShowDeliverDialog" width="80%">
  251. <el-form ref="deliverForm" :model="deliverForm" :rules="deliverFormRules" label-width="120px" size="small" label-position="left">
  252. <el-row :gutter="20">
  253. <el-col :xs="8" :sm="8" :lg="8" style="height: 51px;">
  254. <el-form-item label="发货日期" prop="date">
  255. <el-date-picker
  256. v-model="deliverForm.date"
  257. type="date"
  258. value-format="yyyy-MM-dd"
  259. style="width: 100%;"
  260. placeholder="选择日期">
  261. </el-date-picker>
  262. </el-form-item>
  263. </el-col>
  264. <el-col :xs="8" :sm="8" :lg="8">
  265. <el-form-item label="选择仓位" prop="position">
  266. <el-select v-model="deliverForm.position" placeholder="请选择仓位" style="width: 100%" filterable>
  267. <el-option v-for="item in positionList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  268. </el-select>
  269. </el-form-item>
  270. </el-col>
  271. <el-col :xs="8" :sm="8" :lg="8">
  272. <el-form-item label="发货申请备注" prop="remark">
  273. <el-input v-model="deliverForm.remark" placeholder="请输入发货申请备注" clearable ></el-input>
  274. </el-form-item>
  275. </el-col>
  276. </el-row>
  277. </el-form>
  278. <div class="table" style="margin-top: 20px">
  279. <el-table :data="deliverGoodsList" element-loading-text="Loading" border fit highlight-current-row stripe max-height="400">
  280. <el-table-column align="center" label="序号" type="index" width="50"></el-table-column>
  281. <el-table-column align="center" label="销售类型" prop="saleTypeName" min-width="100" show-overflow-tooltip></el-table-column>
  282. <el-table-column align="center" label="物料编码" prop="materialNumber" min-width="160" show-overflow-tooltip></el-table-column>
  283. <el-table-column align="center" label="产品名称" prop="materialName" min-width="160" show-overflow-tooltip></el-table-column>
  284. <el-table-column align="center" label="规格型号" prop="specification" min-width="160" show-overflow-tooltip></el-table-column>
  285. <el-table-column align="center" label="单位" prop="unit" min-width="100" show-overflow-tooltip></el-table-column>
  286. <el-table-column align="right" label="订单数量" prop="qty" min-width="100" show-overflow-tooltip></el-table-column>
  287. <el-table-column align="right" label="发货数量" prop="hasSendQty" min-width="100" show-overflow-tooltip></el-table-column>
  288. <el-table-column align="right" label="直调数量" prop="directTransferQty" min-width="100" show-overflow-tooltip>
  289. <template slot-scope="scope">
  290. <el-input v-model="scope.row.realDirectTransferQty " :disabled="!scope.row.isDirectTransfer"
  291. size="small" type="number" @mousewheel.native.prevent></el-input>
  292. </template>
  293. </el-table-column>
  294. <el-table-column align="right" label="单价" prop="price" min-width="100" show-overflow-tooltip></el-table-column>
  295. <el-table-column align="right" label="金额" prop="totalAmount" min-width="100" show-overflow-tooltip></el-table-column>
  296. <el-table-column align="right" label="实际返利金额" prop="payRebateAmount" min-width="110" show-overflow-tooltip></el-table-column>
  297. <el-table-column align="center" label="备注" prop="remark" min-width="160" show-overflow-tooltip></el-table-column>
  298. </el-table>
  299. </div>
  300. <span slot="footer" class="dialog-footer">
  301. <el-button @click="closeDeliverDialog">取 消</el-button>
  302. <el-button type="primary" @click="submitDeliverForm" :loading="formLoading">确 定</el-button>
  303. </span>
  304. </el-dialog>
  305. <el-dialog title="直接调拨单(提前开票)" :visible.sync="isShowDirectDialog" width="80%">
  306. <el-form ref="directForm" :model="directForm" :rules="directFormRules" label-width="80px" size="small" label-position="left">
  307. <el-row :gutter="20">
  308. <el-col :xs="12" :sm="6" :lg="6">
  309. <el-form-item label="调出仓库" prop="warehouse1">
  310. <el-select v-model="directForm.warehouse1" placeholder="请选择调出仓库" style="width: 100%" filterable @change="changeWarehouse1">
  311. <el-option v-for="item in warehouseList1" :key="item.id" :label="item.name" :value="item.id"></el-option>
  312. </el-select>
  313. </el-form-item>
  314. </el-col>
  315. <el-col :xs="12" :sm="6" :lg="6">
  316. <el-form-item label="调出仓位" prop="position1">
  317. <el-select v-model="directForm.position1" placeholder="请调出仓位" style="width: 100%" filterable @change="changePosition1">
  318. <el-option v-for="item in positionList1" :key="item.id" :label="item.name" :value="item.id"></el-option>
  319. </el-select>
  320. </el-form-item>
  321. </el-col>
  322. <el-col :xs="12" :sm="6" :lg="6">
  323. <el-form-item label="调入仓库" prop="warehouse2">
  324. <el-select v-model="directForm.warehouse2" placeholder="请选择调入仓库" style="width: 100%" filterable @change="changeWarehouse2">
  325. <el-option v-for="item in warehouseList2" :key="item.id" :label="item.name" :value="item.id"></el-option>
  326. </el-select>
  327. </el-form-item>
  328. </el-col>
  329. <el-col :xs="12" :sm="6" :lg="6">
  330. <el-form-item label="调入仓位" prop="position2">
  331. <el-select v-model="directForm.position2" placeholder="请调入仓位" style="width: 100%" filterable @change="changePosition2">
  332. <el-option v-for="item in positionList2" :key="item.id" :label="item.name" :value="item.id"></el-option>
  333. </el-select>
  334. </el-form-item>
  335. </el-col>
  336. </el-row>
  337. </el-form>
  338. <div class="table" style="margin-top: 20px">
  339. <el-table :data="directGoodsList" element-loading-text="Loading" border fit highlight-current-row stripe max-height="400">
  340. <el-table-column align="center" label="序号" type="index" width="50"></el-table-column>
  341. <el-table-column align="center" label="销售类型" prop="saleTypeName" min-width="100" show-overflow-tooltip></el-table-column>
  342. <el-table-column align="center" label="物料代码" prop="materialNumber" min-width="160" show-overflow-tooltip></el-table-column>
  343. <el-table-column align="center" label="产品编码" prop="materialOldNumber" min-width="160" show-overflow-tooltip></el-table-column>
  344. <el-table-column align="center" label="产品名称" prop="materialName" min-width="160" show-overflow-tooltip></el-table-column>
  345. <el-table-column align="center" label="规格型号" prop="specification" min-width="160" show-overflow-tooltip></el-table-column>
  346. <el-table-column align="center" label="单位" prop="unit" min-width="100" show-overflow-tooltip></el-table-column>
  347. <el-table-column align="center" label="数量" prop="qty" min-width="100" show-overflow-tooltip></el-table-column>
  348. <el-table-column align="center" label="调出仓库" prop="warehouse1" min-width="100" show-overflow-tooltip></el-table-column>
  349. <el-table-column align="center" label="调出仓位" prop="position1" min-width="100" show-overflow-tooltip></el-table-column>
  350. <el-table-column align="center" label="调入仓库" prop="warehouse2" min-width="100" show-overflow-tooltip></el-table-column>
  351. <el-table-column align="center" label="调入仓位" prop="position2" min-width="100" show-overflow-tooltip></el-table-column>
  352. <el-table-column align="center" label="调出库存状态" prop="status1" min-width="110" show-overflow-tooltip></el-table-column>
  353. <el-table-column align="center" label="调入库存状态" prop="status2" min-width="110" show-overflow-tooltip></el-table-column>
  354. <el-table-column align="center" label="调出货主" min-width="100" show-overflow-tooltip>
  355. <template slot-scope="">弘格</template>
  356. </el-table-column>
  357. <el-table-column align="center" label="调入货主" min-width="100" show-overflow-tooltip>
  358. <template slot-="scope">弘格</template>
  359. </el-table-column>
  360. <el-table-column align="center" label="备注" prop="remark" min-width="160" show-overflow-tooltip></el-table-column>
  361. </el-table>
  362. </div>
  363. <span slot="footer" class="dialog-footer">
  364. <el-button @click="closeDirectDialog">取 消</el-button>
  365. <el-button type="primary" @click="submitDirectForm" :loading="formLoading">确 定</el-button>
  366. </span>
  367. </el-dialog>
  368. <CheckOrder :checkOrderId="checkOrderId" v-if="isShowCheckOrder" @backDetail="backDetail" />
  369. </div>
  370. </template>
  371. <script>
  372. import { getOrderDetail, closeHome, overOrder, getWarehouseList, deliverOrder, directOrder, getPositionList, editRemarkHome } from "@/api/supply/engin";
  373. import CheckOrder from "@/components/Common/check-order";
  374. export default {
  375. name: 'HomeDetail',
  376. componentName: 'HomeDetail',
  377. components: {
  378. CheckOrder,
  379. },
  380. props: ['listItem'],
  381. filters: {
  382. statusFilter(val) {
  383. const statusList = [
  384. { label: '已保存', value: 'SAVE' },
  385. { label: '待审核', value: 'WAIT' },
  386. { label: '审核通过', value: 'OK' },
  387. // { label: '审核驳回', value: 'FAIL' },,
  388. { label: '已关闭', value: 'CLOSE' },
  389. ];
  390. let obj = statusList.find(o => o.value == val);
  391. return obj ? obj.label : ''
  392. }
  393. },
  394. data() {
  395. return {
  396. detailData: {},
  397. isShowDeliverDialog: false,
  398. deliverForm: {
  399. date: '',
  400. position: '',
  401. remark:''
  402. },
  403. deliverFormRules: {
  404. date: [
  405. { required: true, message: '请选择发货日期', trigger: 'change' }
  406. ],
  407. position: [
  408. { required: true, message: '请选择仓位', trigger: 'change' }
  409. ],
  410. },
  411. positionList: [],
  412. deliverGoodsList: [],
  413. isShowDirectDialog: false,
  414. directForm: {
  415. warehouse1: '',
  416. position1: '',
  417. warehouse2: '',
  418. position2: '',
  419. },
  420. directFormRules: {
  421. warehouse1: [
  422. { required: true, message: '请选择调出仓库', trigger: 'change' }
  423. ],
  424. position1: [
  425. { required: true, message: '请选择调出仓位', trigger: 'change' }
  426. ],
  427. warehouse2: [
  428. { required: true, message: '请选择调入仓库', trigger: 'change' }
  429. ],
  430. position2: [
  431. { required: true, message: '请选择调入仓位', trigger: 'change' }
  432. ],
  433. },
  434. warehouseList1: [],
  435. warehouseList2: [],
  436. positionList1: [],
  437. positionList2: [],
  438. directGoodsList: [],
  439. formLoading: false,
  440. checkOrderId: {},
  441. isShowCheckOrder: false,
  442. }
  443. },
  444. computed: {
  445. isExamine() {
  446. return this.detailData.examineStatus === 'OK' || this.detailData.examineStatus === 'FAIL'
  447. },
  448. isDealer() {
  449. console.log(JSON.parse(localStorage.getItem("supply_user")).isCustomer,'898');
  450. return JSON.parse(localStorage.getItem("supply_user")).isCustomer
  451. },
  452. },
  453. created() {
  454. this.getDetail();
  455. },
  456. methods: {
  457. // 返回列表
  458. goBack() {
  459. this.$emit('backListFormDetail');
  460. },
  461. // 获取仓库列表
  462. getWarehouseList() {
  463. getWarehouseList({
  464. pageNum: 1,
  465. pageSize: -1,
  466. }).then(res => {
  467. this.warehouseList1 = res.data.records;
  468. this.warehouseList2 = res.data.records;
  469. })
  470. },
  471. // 获取虚拟仓位列表
  472. getPositionList() {
  473. getPositionList({
  474. pageNum: 1,
  475. pageSize: -1,
  476. type: 2
  477. }).then(res => {
  478. this.positionList = res.data.records;
  479. })
  480. },
  481. // 获取详情
  482. getDetail() {
  483. getOrderDetail({id: this.listItem.parentId}).then(res => {
  484. if(res.data.items) {
  485. res.data.items.forEach(item => {
  486. item.number = (item.qty*100 - item.retiredQty*100) / 100;
  487. item.sums1 = ['number', 'directTransferQty', 'qty', 'enginNum', 'oldQty','hasSendQty'];
  488. item.sums2 = ['totalAmount', 'payAmount', 'price', 'payRebateAmount', 'discAmount'];
  489. })
  490. }
  491. this.detailData = res.data;
  492. })
  493. },
  494. // 关闭订单
  495. closeData() {
  496. this.$confirm('此操作将关闭订单, 是否继续?', '提示', {
  497. confirmButtonText: '确定',
  498. cancelButtonText: '取消',
  499. type: 'warning'
  500. }).then(() => {
  501. closeHome({id: this.listItem.parentId, refEnginRecordNo:this.detailData.refEnginRecordNo,}).then(res => {
  502. this.$successMsg();
  503. this.getDetail();
  504. })
  505. }).catch(() => {});
  506. },
  507. // 直调完结
  508. overData() {
  509. this.$confirm('此操作将直调完结订单, 是否继续?', '提示', {
  510. confirmButtonText: '确定',
  511. cancelButtonText: '取消',
  512. type: 'warning'
  513. }).then(() => {
  514. overOrder({id: this.listItem.parentId, refEnginRecordNo:this.detailData.refEnginRecordNo,}).then(res => {
  515. this.$successMsg();
  516. this.getDetail();
  517. })
  518. }).catch(() => {});
  519. },
  520. // 更改仓库
  521. changeWarehouse() {
  522. this.deliverForm.position = '';
  523. let obj = this.warehouseList.find(o => o.id == this.deliverForm.warehouse);
  524. this.positionList = obj.kingDeeStocks;
  525. },
  526. // 打开 直调发货
  527. openDeliverDialog() {
  528. this.isShowDeliverDialog = true;
  529. this.deliverGoodsList = this.detailData.items;
  530. this.deliverGoodsList.forEach(item => {
  531. item.warehouse1 = '';
  532. item.warehouse2 = '';
  533. item.position1 = '';
  534. item.position2 = '';
  535. item.status1 = '';
  536. item.status2 = '';
  537. this.$set(item,'realDirectTransferQty',item.refundableQty)
  538. })
  539. this.getPositionList();
  540. },
  541. // 关闭 直调发货
  542. closeDeliverDialog() {
  543. this.isShowDeliverDialog = false;
  544. },
  545. // 提交 直调发货
  546. submitDeliverForm() {
  547. this.$refs.deliverForm.validate((valid) => {
  548. if (valid) {
  549. for(let i=0; i<this.deliverGoodsList.length; i++) {
  550. if(!this.deliverGoodsList[i].directTransferQty && this.deliverGoodsList[i].directTransferQty !== 0) {
  551. this.$errorMsg('请输入直调数量');
  552. return;
  553. }
  554. }
  555. let params = {
  556. enginOrderId: this.detailData.enginOrderId,
  557. enginOrderType: 'HOME', // TRADE=商用 HOME=家用
  558. deliverDate: this.deliverForm.date + ' 00:00:00',
  559. correspondId: this.deliverForm.position,
  560. remark:this.deliverForm.remark,
  561. refEnginRecordNo:this.detailData.refEnginRecordNo,
  562. items: this.deliverGoodsList
  563. }
  564. this.formLoading = true;
  565. deliverOrder(params).then(res => {
  566. this.$successMsg();
  567. this.isShowDeliverDialog = false;
  568. this.getDetail();
  569. }).finally(res => {
  570. this.formLoading = false;
  571. })
  572. }
  573. })
  574. },
  575. // 更改调出仓库
  576. changeWarehouse1() {
  577. this.directForm.position1 = '';
  578. let obj = this.warehouseList1.find(o => o.id == this.directForm.warehouse1);
  579. this.positionList1 = obj.kingDeeStocks;
  580. this.directGoodsList.forEach(item => {
  581. item.warehouse1 = obj.name;
  582. });
  583. },
  584. // 更改调入仓库
  585. changeWarehouse2() {
  586. this.directForm.position2 = '';
  587. let obj = this.warehouseList2.find(o => o.id == this.directForm.warehouse2);
  588. this.positionList2 = obj.kingDeeStocks;
  589. this.directGoodsList.forEach(item => {
  590. item.warehouse2 = obj.name;
  591. });
  592. },
  593. // 更改调出仓位
  594. changePosition1() {
  595. let obj = this.positionList1.find(o => o.id == this.directForm.position1);
  596. this.directGoodsList.forEach(item => {
  597. item.position1 = obj.name;
  598. item.status1 = obj.defStockStatusName;
  599. });
  600. },
  601. // 更改调入仓位
  602. changePosition2() {
  603. let obj = this.positionList2.find(o => o.id == this.directForm.position2);
  604. this.directGoodsList.forEach(item => {
  605. item.position2 = obj.name;
  606. item.status2 = obj.defStockStatusName;
  607. });
  608. },
  609. // 打开 提前开票
  610. openDirectDialog() {
  611. this.isShowDirectDialog = true;
  612. this.directGoodsList = this.detailData.items;
  613. this.getWarehouseList();
  614. },
  615. // 关闭 提前开票
  616. closeDirectDialog() {
  617. this.isShowDirectDialog = false;
  618. },
  619. // 提交 提前开票
  620. submitDirectForm() {
  621. this.$refs.directForm.validate((valid) => {
  622. if (valid) {
  623. let warehouseItem1 = this.warehouseList1.find(o => o.id == this.directForm.warehouse1);
  624. let positionItem1 = this.positionList1.find(o => o.id == this.directForm.position1);
  625. let warehouseItem2 = this.warehouseList2.find(o => o.id == this.directForm.warehouse2);
  626. let positionItem2 = this.positionList2.find(o => o.id == this.directForm.position2);
  627. let params = {
  628. orderNo: this.detailData.enginOrderId,
  629. orderType: 'HOME', // TRADE=商用 HOME=家用 RETAIL=零售单 RETAIL_POLICY 销售政策单
  630. correspondId: this.directForm.warehouse1,
  631. correspondName: warehouseItem1.name,
  632. stockId: this.directForm.position1,
  633. stockName: positionItem1.name,
  634. inCorrespondId: this.directForm.warehouse2,
  635. inCorrespondName: warehouseItem2.name,
  636. inStockId: this.directForm.position2,
  637. inStockName: positionItem2.name,
  638. refEnginRecordNo: this.detailData.refEnginRecordNo || '',
  639. }
  640. this.formLoading = true;
  641. directOrder(params).then(res => {
  642. this.$successMsg();
  643. this.isShowDirectDialog = false;
  644. this.getDetail();
  645. }).finally(res => {
  646. this.formLoading = false;
  647. })
  648. }
  649. })
  650. },
  651. // 联查单据
  652. toCheckOrder() {
  653. this.checkOrderId = this.detailData.enginOrderId;
  654. this.isShowCheckOrder = true;
  655. },
  656. // 保存备注
  657. saveRemark() {
  658. editRemarkHome({
  659. enginOrderId: this.detailData.enginOrderId,
  660. geLiInerNote: this.detailData.geLiInerNote,
  661. refEnginRecordNo:this.detailData.refEnginRecordNo,
  662. }).then(res => {
  663. this.$successMsg('编辑成功');
  664. this.getDetail();
  665. })
  666. },
  667. backDetail() {
  668. this.isShowCheckOrder = false;
  669. },
  670. }
  671. }
  672. </script>
  673. <style scoped lang="scss">
  674. .detail-container {
  675. width: 100%;
  676. height: 100%;
  677. }
  678. .main-title {
  679. display: flex;
  680. justify-content: space-between;
  681. align-items: center;
  682. margin-top: 20px;
  683. height: 60px;
  684. border-bottom: 1px solid #DCDFE6;
  685. margin-bottom: 20px;
  686. .title {
  687. font-size: 16px;
  688. font-weight: 600;
  689. padding-left: 10px;
  690. }
  691. }
  692. </style>