addOrEditDialog.vue 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349
  1. <template>
  2. <div>
  3. <el-form ref="form" :model="form" label-width="120px" class="el-form-box">
  4. <headerTitle title="基本信息"></headerTitle>
  5. <el-row :gutter="12">
  6. <el-col :span="8">
  7. <el-form-item label="编码" prop="code">
  8. <el-input
  9. v-model="form.code"
  10. placeholder="请输入"
  11. :disabled="true"
  12. />
  13. </el-form-item>
  14. </el-col>
  15. <el-col :span="8">
  16. <el-form-item label="名称" prop="name">
  17. <el-input clearable v-model="form.name" :disabled="true" />
  18. </el-form-item>
  19. </el-col>
  20. <el-col :span="8">
  21. <el-form-item label="来源类型" prop="relationType">
  22. <el-input
  23. clearable
  24. v-model="form.relationTypeName"
  25. :disabled="true"
  26. />
  27. </el-form-item>
  28. </el-col>
  29. <el-col :span="8">
  30. <el-form-item label="来源编码" prop="relationCode">
  31. <el-input clearable v-model="form.relationCode" :disabled="true" />
  32. </el-form-item>
  33. </el-col>
  34. <el-col :span="8">
  35. <el-form-item label="来源名称" prop="relationName">
  36. <el-input clearable v-model="form.relationName" :disabled="true" />
  37. </el-form-item>
  38. </el-col>
  39. <el-col :span="8">
  40. <el-form-item label="创建人" prop="createUserName">
  41. <el-input
  42. clearable
  43. v-model="form.createUserName"
  44. :disabled="true"
  45. />
  46. </el-form-item>
  47. </el-col>
  48. <el-col :span="8">
  49. <el-form-item label="创建时间" prop="createTime">
  50. <el-input clearable v-model="form.createTime" :disabled="true" />
  51. </el-form-item>
  52. </el-col>
  53. </el-row>
  54. </el-form>
  55. <headerTitle title="物品清单" style="margin-top: 30px"></headerTitle>
  56. <ele-pro-table
  57. ref="table"
  58. :needPage="false"
  59. :columns="columns"
  60. :toolkit="[]"
  61. :datasource="form.detailList"
  62. row-key="id"
  63. >
  64. <template v-slot:headerExceptionDispose="{ column }">
  65. <span class="is-required">{{ column.label }}</span>
  66. </template>
  67. <template v-slot:exceptionDispose="scope">
  68. <el-select v-model="scope.row.exceptionDispose" placeholder="请选择">
  69. <el-option
  70. v-for="item in options"
  71. :key="item.value"
  72. :label="item.label"
  73. :value="item.value"
  74. >
  75. </el-option>
  76. </el-select>
  77. </template>
  78. <template v-slot:exceptionDetermine="scope">
  79. <el-select v-model="scope.row.exceptionDetermine" placeholder="请选择">
  80. <el-option
  81. v-for="item in options1"
  82. :key="item.value"
  83. :label="item.label"
  84. :value="item.value"
  85. >
  86. </el-option>
  87. </el-select>
  88. </template>
  89. </ele-pro-table>
  90. </div>
  91. </template>
  92. <script>
  93. import dictMixins from '@/mixins/dictMixins';
  94. import {
  95. getById,
  96. update
  97. } from '@/api/bpm/components/saleManage/exceptionManagement.js';
  98. import { relationType } from '@/enum/dict.js';
  99. export default {
  100. mixins: [dictMixins],
  101. props: {
  102. businessId: {
  103. default: ''
  104. },
  105. taskDefinitionKey: {}
  106. },
  107. data() {
  108. return {
  109. options: [
  110. { label: '退货入库', value: 1 },
  111. { label: '返工返修', value: 2 },
  112. { label: '报损', value: 3 },
  113. { label: '报废', value: 4 }
  114. ],
  115. options1: [
  116. { label: '多发', value: 1 },
  117. { label: '少发', value: 2 },
  118. { label: '错发', value: 3 },
  119. { label: '损坏', value: 4 }
  120. ],
  121. form: {},
  122. columns: [
  123. {
  124. width: 45,
  125. type: 'index',
  126. columnKey: 'index',
  127. align: 'center',
  128. fixed: 'left'
  129. },
  130. {
  131. width: 220,
  132. prop: 'exceptionDetermine',
  133. label: '异常类型',
  134. slot: 'exceptionDetermine',
  135. fixed: 'left',
  136. align: 'center',
  137. headerSlot: 'headerExceptionDispose'
  138. },
  139. {
  140. width: 220,
  141. prop: 'exceptionDispose',
  142. label: '处置方式',
  143. slot: 'exceptionDispose',
  144. fixed: 'left',
  145. align: 'center',
  146. headerSlot: 'headerExceptionDispose'
  147. },
  148. {
  149. minWidth: 160,
  150. prop: 'productCode',
  151. label: '编码',
  152. showOverflowTooltip: true,
  153. align: 'center'
  154. },
  155. {
  156. minWidth: 120,
  157. prop: 'productName',
  158. label: '名称',
  159. showOverflowTooltip: true,
  160. align: 'center'
  161. },
  162. {
  163. width: 120,
  164. prop: 'specification',
  165. label: '规格',
  166. slot: 'specification',
  167. align: 'center'
  168. },
  169. {
  170. width: 120,
  171. prop: 'modelType',
  172. label: '型号',
  173. slot: 'modelType',
  174. align: 'center'
  175. },
  176. // {
  177. // minWidth: 100,
  178. // prop: 'saleCount',
  179. // label: '发货数量',
  180. // showOverflowTooltip: true,
  181. // align: 'center'
  182. // },
  183. {
  184. minWidth: 100,
  185. prop: 'totalCount',
  186. slot: 'totalCount',
  187. label: '异常数量',
  188. showOverflowTooltip: true,
  189. align: 'center'
  190. },
  191. {
  192. minWidth: 160,
  193. prop: 'batchNo',
  194. label: '批次号',
  195. showOverflowTooltip: true,
  196. slot: 'batchNo',
  197. align: 'center'
  198. },
  199. {
  200. minWidth: 160,
  201. prop: 'barcodes',
  202. label: '发货条码',
  203. showOverflowTooltip: true,
  204. slot: 'barcodes',
  205. align: 'center'
  206. },
  207. {
  208. minWidth: 120,
  209. prop: 'materielDesignation',
  210. label: '物料代号',
  211. showOverflowTooltip: true,
  212. align: 'center'
  213. },
  214. {
  215. minWidth: 120,
  216. prop: 'clientCode',
  217. label: '客户代号',
  218. showOverflowTooltip: true,
  219. align: 'center'
  220. },
  221. {
  222. minWidth: 120,
  223. prop: 'engrave',
  224. label: '刻码',
  225. showOverflowTooltip: true,
  226. align: 'center'
  227. },
  228. // {
  229. // minWidth: 160,
  230. // prop: 'packageNo',
  231. // align: 'center',
  232. // label: '包装编码',
  233. // showOverflowTooltip: true
  234. // },
  235. // {
  236. // minWidth: 100,
  237. // prop: 'packingQuantity',
  238. // align: 'center',
  239. // label: '包装数量',
  240. // showOverflowTooltip: true
  241. // },
  242. // {
  243. // minWidth: 120,
  244. // prop: 'packingUnit',
  245. // align: 'center',
  246. // label: '包装单位',
  247. // showOverflowTooltip: true
  248. // },
  249. {
  250. minWidth: 150,
  251. prop: 'measuringUnit',
  252. label: '计量单位',
  253. showOverflowTooltip: true,
  254. align: 'center'
  255. },
  256. // {
  257. // width: 160,
  258. // prop: 'pricingWay',
  259. // label: '计价方式',
  260. // slot: 'pricingWay',
  261. // align: 'center',
  262. // formatter: (row, column) => {
  263. // return row.pricingWay == 1
  264. // ? '按数量计费'
  265. // : row.pricingWay == 2
  266. // ? '按重量计费'
  267. // : '';
  268. // }
  269. // },
  270. // {
  271. // width: 100,
  272. // prop: 'singlePrice',
  273. // label: '单价',
  274. // slot: 'singlePrice',
  275. // align: 'center'
  276. // },
  277. // {
  278. // width: 100,
  279. // prop: 'totalPrice',
  280. // label: '合计',
  281. // align: 'center'
  282. // },
  283. // {
  284. // minWidth: 80,
  285. // prop: 'receiveTotalWeight',
  286. // label: '重量',
  287. // showOverflowTooltip: true,
  288. // align: 'center'
  289. // },
  290. // {
  291. // minWidth: 100,
  292. // prop: 'weightUnit',
  293. // label: '重量单位',
  294. // showOverflowTooltip: true,
  295. // align: 'center'
  296. // },
  297. {
  298. width: 220,
  299. prop: 'describes',
  300. label: '描述',
  301. slot: 'describes',
  302. align: 'center'
  303. }
  304. ]
  305. };
  306. },
  307. created() {
  308. this.getById(this.businessId);
  309. },
  310. methods: {
  311. //获取订单详情
  312. async getById(id) {
  313. this.loading = true;
  314. let data = await getById(id);
  315. data['relationTypeName'] = relationType[data.relationType];
  316. if (data) {
  317. this.form = data;
  318. }
  319. },
  320. async getTableValue() {
  321. let is = false;
  322. this.form.detailList.forEach((item) => {
  323. if (!item.exceptionDispose) {
  324. is = true;
  325. }
  326. });
  327. if (is) {
  328. this.$message.error('处置方式不能为空');
  329. return;
  330. }
  331. return this.form;
  332. }
  333. }
  334. };
  335. </script>
  336. <style scoped lang="scss"></style>