retail_detail.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361
  1. <template>
  2. <div class="detail-container">
  3. <el-page-header @back="goBack" content="详情"></el-page-header>
  4. <div class="main-title">
  5. <div class="title">提货进度</div>
  6. </div>
  7. <div class="progress-container">
  8. <el-progress :text-inside="true" :stroke-width="26" :percentage="progress || 0"></el-progress>
  9. </div>
  10. <div class="main-title">
  11. <div class="title">订单信息</div>
  12. </div>
  13. <div class="diy-table-1">
  14. <el-row>
  15. <el-col :span="8" class="item">
  16. <div class="label">订单号</div>
  17. <div class="value">{{detailData.id}}</div>
  18. </el-col>
  19. <el-col :span="8" class="item">
  20. <div class="label">订单日期</div>
  21. <div class="value">{{detailData.theTime}}</div>
  22. </el-col>
  23. <el-col :span="8" class="item">
  24. <div class="label">单据状态</div>
  25. <div class="value">{{detailData.examineStatus | statusFilter}}</div>
  26. </el-col>
  27. <el-col :span="16" class="item">
  28. <div class="label">备注</div>
  29. <div class="value">{{detailData.remark}}</div>
  30. </el-col>
  31. <el-col :span="8" class="item">
  32. <div class="label">业务员</div>
  33. <div class="value">{{detailData.serviceName}}</div>
  34. </el-col>
  35. <el-col :span="8" class="item">
  36. <div class="label">制单人</div>
  37. <div class="value">{{detailData.createName}}</div>
  38. </el-col>
  39. <el-col :span="8" class="item">
  40. <div class="label">制单日期</div>
  41. <div class="value">{{detailData.createTime}}</div>
  42. </el-col>
  43. <el-col :span="8" class="item">
  44. <div class="label">审核人</div>
  45. <div class="value">{{detailData.examineName}}</div>
  46. </el-col>
  47. <el-col :span="8" class="item">
  48. <div class="label">审核日期</div>
  49. <div class="value">{{detailData.examineTime}}</div>
  50. </el-col>
  51. <el-col :span="8" class="item">
  52. <div class="label">关闭人</div>
  53. <div class="value">{{detailData.closeName}}</div>
  54. </el-col>
  55. <el-col :span="8" class="item">
  56. <div class="label">关闭日期</div>
  57. <div class="value">{{detailData.closeTime}}</div>
  58. </el-col>
  59. </el-row>
  60. </div>
  61. <div class="main-title">
  62. <div class="title">货品信息</div>
  63. </div>
  64. <div class="table" style="margin-top: 20px">
  65. <el-table :data="detailData.retailOrderItemList" element-loading-text="Loading" border fit highlight-current-row stripe max-height="400">
  66. <el-table-column align="center" label="序号" type="index" width="50"></el-table-column>
  67. <el-table-column align="center" label="销售类型" prop="saleTypeName" min-width="100" show-overflow-tooltip></el-table-column>
  68. <el-table-column align="center" label="产品编码" prop="materialCode" min-width="160" show-overflow-tooltip></el-table-column>
  69. <el-table-column align="center" label="产品名称" prop="materialName" min-width="160" show-overflow-tooltip></el-table-column>
  70. <el-table-column align="center" label="规格型号" prop="specification" min-width="160" show-overflow-tooltip></el-table-column>
  71. <el-table-column align="center" label="单位" prop="unit" min-width="100" show-overflow-tooltip></el-table-column>
  72. <el-table-column align="center" label="单价" prop="price" min-width="100" show-overflow-tooltip></el-table-column>
  73. <el-table-column align="center" label="数量" prop="qty" min-width="100" show-overflow-tooltip></el-table-column>
  74. <el-table-column align="center" label="订单金额" prop="totalAmount" min-width="100" show-overflow-tooltip></el-table-column>
  75. <el-table-column align="center" label="返利钱包" prop="customerWalletName2" min-width="100" show-overflow-tooltip></el-table-column>
  76. <el-table-column align="center" label="返利金额" prop="rebateAmount" min-width="100" show-overflow-tooltip></el-table-column>
  77. <el-table-column align="center" label="格力折扣" prop="deductAmount" min-width="100" show-overflow-tooltip></el-table-column>
  78. <el-table-column align="center" label="现金钱包" prop="customerWalletName" min-width="100" show-overflow-tooltip></el-table-column>
  79. <el-table-column align="center" label="实付金额" prop="payAmount" min-width="100" show-overflow-tooltip></el-table-column>
  80. <el-table-column align="center" label="是否直调" prop="isDirectTransfer" min-width="100" show-overflow-tooltip>
  81. <template slot-scope="scope">
  82. {{scope.row.isDirectTransfer ? '是':'否'}}
  83. </template>
  84. </el-table-column>
  85. <el-table-column align="center" label="直调数量" prop="directTransferQty" min-width="100" show-overflow-tooltip></el-table-column>
  86. <el-table-column align="center" label="原订单数量" prop="oldQty" min-width="100" show-overflow-tooltip></el-table-column>
  87. <el-table-column align="center" label="备注" prop="remark" min-width="160" show-overflow-tooltip></el-table-column>
  88. <el-table-column align="center" label="税率" prop="tax" min-width="100" show-overflow-tooltip></el-table-column>
  89. </el-table>
  90. </div>
  91. <div v-if="isExamine">
  92. <div class="main-title">
  93. <div class="title">审批记录</div>
  94. </div>
  95. <div class="diy-table-1">
  96. <el-row :gutter="0">
  97. <el-col :span="12" class="item">
  98. <div class="label">审批人</div>
  99. <div class="value">{{detailData.examineName}}</div>
  100. </el-col>
  101. <el-col :span="12" class="item">
  102. <div class="label">审批结果</div>
  103. <div class="value">{{detailData.examineStatus | statusFilter}}</div>
  104. </el-col>
  105. <el-col :span="24" class="item">
  106. <div class="label">审批说明</div>
  107. <div class="value">{{detailData.examineRemark}}</div>
  108. </el-col>
  109. </el-row>
  110. </div>
  111. </div>
  112. <div class="page-footer">
  113. <div class="footer" :class="classObj">
  114. <el-button type="primary" @click="openDeliverDialog" :disabled="detailData.examineStatus !== 'OK'">直调发货</el-button>
  115. <el-button @click="goBack">关 闭</el-button>
  116. </div>
  117. </div>
  118. <el-dialog title="直调发货" :visible.sync="isShowDeliverDialog" width="80%">
  119. <el-form ref="deliverForm" :model="deliverForm" :rules="deliverFormRules" label-width="80px" size="small" label-position="left">
  120. <el-row :gutter="20">
  121. <el-col :xs="8" :sm="8" :lg="8" style="height: 51px;">
  122. <el-form-item label="发货日期" prop="date">
  123. <el-date-picker
  124. v-model="deliverForm.date"
  125. type="date"
  126. value-format="yyyy-MM-dd"
  127. style="width: 100%;"
  128. placeholder="选择日期">
  129. </el-date-picker>
  130. </el-form-item>
  131. </el-col>
  132. <el-col :xs="8" :sm="8" :lg="8">
  133. <el-form-item label="发货仓库" prop="warehouse">
  134. <el-select v-model="deliverForm.warehouse" placeholder="请选择发货仓库" style="width: 100%" filterable @change="changeWarehouse">
  135. <el-option v-for="item in warehouseList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  136. </el-select>
  137. </el-form-item>
  138. </el-col>
  139. <el-col :xs="8" :sm="8" :lg="8">
  140. <el-form-item label="选择仓位" prop="position">
  141. <el-select v-model="deliverForm.position" placeholder="请选择仓位" style="width: 100%" filterable>
  142. <el-option v-for="item in positionList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  143. </el-select>
  144. </el-form-item>
  145. </el-col>
  146. </el-row>
  147. </el-form>
  148. <div class="table" style="margin-top: 20px">
  149. <el-table :data="goodsList" element-loading-text="Loading" border fit highlight-current-row stripe max-height="400">
  150. <el-table-column align="center" label="序号" type="index" width="50"></el-table-column>
  151. <el-table-column align="center" label="销售类型" prop="saleTypeName" min-width="100" show-overflow-tooltip></el-table-column>
  152. <el-table-column align="center" label="产品编码" prop="materialCode" min-width="160" show-overflow-tooltip></el-table-column>
  153. <el-table-column align="center" label="产品名称" prop="materialName" min-width="160" show-overflow-tooltip></el-table-column>
  154. <el-table-column align="center" label="规格型号" prop="specification" min-width="160" show-overflow-tooltip></el-table-column>
  155. <el-table-column align="center" label="单位" prop="unit" min-width="100" show-overflow-tooltip></el-table-column>
  156. <el-table-column align="center" label="订单数量" prop="qty" min-width="100" show-overflow-tooltip></el-table-column>
  157. <el-table-column align="center" label="发货数量" prop="hasSendQty" min-width="100" show-overflow-tooltip></el-table-column>
  158. <el-table-column align="center" label="直调数量" prop="adjustNum" min-width="100" show-overflow-tooltip>
  159. <template slot-scope="scope">
  160. <el-input v-model="scope.row.adjustNum" size="small" type="number"></el-input>
  161. </template>
  162. </el-table-column>
  163. <el-table-column align="center" label="单价" prop="price" min-width="100" show-overflow-tooltip></el-table-column>
  164. <el-table-column align="center" label="金额" prop="totalAmount" min-width="100" show-overflow-tooltip></el-table-column>
  165. <el-table-column align="center" label="返利" prop="rebateAmount" min-width="100" show-overflow-tooltip></el-table-column>
  166. <el-table-column align="center" label="实付金额" prop="payAmount" min-width="100" show-overflow-tooltip></el-table-column>
  167. <el-table-column align="center" label="备注" prop="remark" min-width="160" show-overflow-tooltip></el-table-column>
  168. </el-table>
  169. </div>
  170. <span slot="footer" class="dialog-footer">
  171. <el-button @click="closeDeliverDialog">取 消</el-button>
  172. <el-button type="primary" @click="submitDeliverForm">确 定</el-button>
  173. </span>
  174. </el-dialog>
  175. </div>
  176. </template>
  177. <script>
  178. import { getDetail, getWarehouseList, adjustDeliver } from "@/api/supply/retail";
  179. export default {
  180. name: 'RetailDetail',
  181. componentName: 'RetailDetail',
  182. props: ['listItem'],
  183. filters: {
  184. statusFilter(val) {
  185. const statusList = [
  186. { label: '已保存', value: 'SAVE' },
  187. { label: '待审核', value: 'WAIT' },
  188. { label: '审核通过', value: 'OK' },
  189. { label: '审核驳回', value: 'FAIL' },
  190. ];
  191. let obj = statusList.find(o => o.value == val);
  192. return obj ? obj.label : ''
  193. }
  194. },
  195. data() {
  196. return {
  197. detailData: {},
  198. isShowDeliverDialog: false,
  199. deliverForm: {
  200. date: '',
  201. warehouse: '',
  202. position: '',
  203. },
  204. deliverFormRules: {
  205. date: [
  206. { required: true, message: '请选择发货日期', trigger: 'change' }
  207. ],
  208. warehouse: [
  209. { required: true, message: '请选择发货仓库', trigger: 'change' }
  210. ],
  211. position: [
  212. { required: true, message: '请选择仓位', trigger: 'change' }
  213. ],
  214. },
  215. warehouseList: [],
  216. positionList: [],
  217. goodsList: [],
  218. }
  219. },
  220. computed: {
  221. sidebar() {
  222. return this.$store.state.app.sidebar
  223. },
  224. classObj() {
  225. return {
  226. hideSidebar: !this.sidebar.opened,
  227. openSidebar: this.sidebar.opened
  228. }
  229. },
  230. isExamine() {
  231. return this.detailData.examineStatus === 'OK' || this.detailData.examineStatus === 'FAIL'
  232. },
  233. progress() {
  234. if(this.detailData.totalQty == 0) return 0;
  235. return (this.detailData.takeQty * 100) / (this.detailData.totalQty * 100);
  236. }
  237. },
  238. created() {
  239. this.getDetail();
  240. },
  241. methods: {
  242. // 返回列表
  243. goBack() {
  244. this.$emit('backListFormDetail');
  245. },
  246. // 获取详情
  247. getDetail() {
  248. getDetail({id: this.listItem.id}).then(res => {
  249. this.detailData = res.data;
  250. })
  251. },
  252. // 获取仓库列表
  253. getWarehouseList() {
  254. getWarehouseList({
  255. pageNum: 1,
  256. pageSize: -1,
  257. }).then(res => {
  258. this.warehouseList = res.data.records;
  259. })
  260. },
  261. // 更改仓库
  262. changeWarehouse() {
  263. this.deliverForm.position = '';
  264. let obj = this.warehouseList.find(o => o.id == this.deliverForm.warehouse);
  265. this.positionList = obj.kingDeeStocks;
  266. },
  267. // 打开 直调发货
  268. openDeliverDialog() {
  269. this.isShowDeliverDialog = true;
  270. this.goodsList = this.detailData.retailOrderItemList;
  271. this.getWarehouseList();
  272. },
  273. // 关闭 直调发货
  274. closeDeliverDialog() {
  275. this.isShowDeliverDialog = false;
  276. },
  277. // 提交 直调发货
  278. submitDeliverForm() {
  279. this.$refs.deliverForm.validate((valid) => {
  280. if (valid) {
  281. for(let i=0; i<this.goodsList.length; i++) {
  282. if(!this.goodsList[i].adjustNum) {
  283. this.$errorMsg('请输入直调数量');
  284. return;
  285. }
  286. }
  287. let goodsList = this.goodsList.map((item) => {
  288. return {
  289. itemId: item.id,
  290. qty: item.adjustNum,
  291. }
  292. });
  293. let params = {
  294. orderNo: this.listItem.id,
  295. orderDate: this.deliverForm.date + ' 00:00:00',
  296. correspondId: this.deliverForm.warehouse,
  297. stockId: this.deliverForm.position,
  298. directItems: goodsList
  299. }
  300. adjustDeliver(params).then(res => {
  301. this.$successMsg();
  302. this.isShowDeliverDialog = false;
  303. this.getDetail();
  304. })
  305. }
  306. })
  307. },
  308. }
  309. }
  310. </script>
  311. <style scoped lang="scss">
  312. .detail-container {
  313. width: 100%;
  314. height: 100%;
  315. }
  316. .main-title {
  317. display: flex;
  318. justify-content: space-between;
  319. align-items: center;
  320. margin-top: 20px;
  321. height: 60px;
  322. border-bottom: 1px solid #DCDFE6;
  323. margin-bottom: 20px;
  324. .title {
  325. font-size: 16px;
  326. font-weight: 600;
  327. padding-left: 10px;
  328. }
  329. }
  330. .progress-container {
  331. display: flex;
  332. .el-progress {
  333. width: 500px;
  334. }
  335. }
  336. </style>