commerce_detail.vue 29 KB

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