commerce_detail.vue 30 KB

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