engin_examine.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378
  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="diy-table-1">
  8. <el-row>
  9. <el-col :span="8" class="item">
  10. <div class="label">工程订单号</div>
  11. <div class="value">{{detailData.enginInfoNo}}</div>
  12. </el-col>
  13. <el-col :span="8" class="item">
  14. <div class="label">订单日期</div>
  15. <div class="value">{{detailData.orderDate}}</div>
  16. </el-col>
  17. <el-col :span="8" class="item">
  18. <div class="label">单据状态</div>
  19. <div class="value">{{detailData.examineStatus | statusFilter}}</div>
  20. </el-col>
  21. <el-col :span="8" class="item">
  22. <div class="label">经销商编码</div>
  23. <div class="value">{{detailData.customerNumber}}</div>
  24. </el-col>
  25. <el-col :span="8" class="item">
  26. <div class="label">项目名称</div>
  27. <div class="value">{{detailData.projectName}}</div>
  28. </el-col>
  29. <el-col :span="8" class="item">
  30. <div class="label">单据类型</div>
  31. <div class="value">{{detailData.orderType}}</div>
  32. </el-col>
  33. <el-col :span="8" class="item">
  34. <div class="label">经销商名称</div>
  35. <div class="value">{{detailData.customerName}}</div>
  36. </el-col>
  37. <el-col :span="8" class="item">
  38. <div class="label">使用单位</div>
  39. <div class="value">{{detailData.useUnit}}</div>
  40. </el-col>
  41. <el-col :span="8" class="item">
  42. <div class="label">安装地址</div>
  43. <div class="value">{{detailData.installAddress}}</div>
  44. </el-col>
  45. <el-col :span="8" class="item">
  46. <div class="label">工程编号</div>
  47. <div class="value">{{detailData.projectNo}}</div>
  48. </el-col>
  49. <el-col :span="8" class="item">
  50. <div class="label">厂工程编码</div>
  51. <div class="value">{{detailData.enginFactoryNo}}</div>
  52. </el-col>
  53. <el-col :span="8" class="item">
  54. <div class="label">工程登录类型</div>
  55. <div class="value">{{detailData.enginSignType}}</div>
  56. </el-col>
  57. <el-col :span="8" class="item">
  58. <div class="label">联系人</div>
  59. <div class="value">{{detailData.linkman}}</div>
  60. </el-col>
  61. <el-col :span="8" class="item">
  62. <div class="label">联系电话</div>
  63. <div class="value">{{detailData.phone}}</div>
  64. </el-col>
  65. <el-col :span="8" class="item">
  66. <div class="label">固定电话</div>
  67. <div class="value">{{detailData.tel}}</div>
  68. </el-col>
  69. <el-col :span="8" class="item">
  70. <div class="label">制单人</div>
  71. <div class="value">{{detailData.createBy}}</div>
  72. </el-col>
  73. <el-col :span="8" class="item">
  74. <div class="label">制单日期</div>
  75. <div class="value">{{detailData.createTime}}</div>
  76. </el-col>
  77. <el-col :span="8" class="item">
  78. <div class="label">合同有效期</div>
  79. <div class="value">
  80. <el-date-picker
  81. v-model="detailData.contractExpireDate"
  82. type="date"
  83. prefix-icon="none"
  84. value-format="yyyy-MM-dd"
  85. style="width: 100%;"
  86. placeholder="选择日期">
  87. </el-date-picker>
  88. </div>
  89. </el-col>
  90. <el-col :span="16" class="item">
  91. <div class="label">备注</div>
  92. <div class="value">{{detailData.remark}}</div>
  93. </el-col>
  94. <el-col :span="8" class="item">
  95. <div class="label">业务员</div>
  96. <div class="value">{{detailData.serviceName}}</div>
  97. </el-col>
  98. </el-row>
  99. </div>
  100. <div class="main-title">
  101. <div class="title">货品信息</div>
  102. </div>
  103. <div class="table" style="margin-top: 20px">
  104. <el-table :data="goodsList" element-loading-text="Loading" border fit highlight-current-row stripe max-height="400">
  105. <el-table-column align="center" label="序号" type="index" width="50"></el-table-column>
  106. <el-table-column align="center" label="销售类型" prop="saleTypeId" min-width="160" show-overflow-tooltip>
  107. <template slot-scope="scope">
  108. <el-select v-model="scope.row.saleTypeId" placeholder="选择销售类型" size="small" @change="changeSaleType(scope.$index)">
  109. <el-option
  110. v-for="item in salesTypeList"
  111. :key="item.id"
  112. :label="item.saleName"
  113. :value="item.id">
  114. </el-option>
  115. </el-select>
  116. </template>
  117. </el-table-column>
  118. <el-table-column align="center" label="产品名称" prop="materialNumber" min-width="160" show-overflow-tooltip>
  119. <template slot-scope="scope">
  120. <el-select v-model="scope.row.materialNumber" placeholder="选择产品" size="small" @change="changeGoods(scope.$index)">
  121. <el-option
  122. v-for="item in retailProductList"
  123. :key="item.id"
  124. :label="item.name"
  125. :value="item.number">
  126. </el-option>
  127. </el-select>
  128. </template>
  129. </el-table-column>
  130. <el-table-column align="center" label="物料编码" prop="materialNumber" min-width="120" show-overflow-tooltip></el-table-column>
  131. <el-table-column align="center" label="产品编码" prop="materialOldNumber" min-width="120" show-overflow-tooltip></el-table-column>
  132. <el-table-column align="center" label="规格型号" prop="specification" min-width="200" show-overflow-tooltip></el-table-column>
  133. <el-table-column align="center" label="单位" prop="unit" min-width="100" show-overflow-tooltip></el-table-column>
  134. <el-table-column align="center" label="单价" prop="price" min-width="100" show-overflow-tooltip>
  135. <template slot-scope="scope">
  136. <el-input v-model="scope.row.price" size="small" type="number"></el-input>
  137. </template>
  138. </el-table-column>
  139. <el-table-column align="center" label="数量" prop="qty" min-width="100" show-overflow-tooltip>
  140. <template slot-scope="scope">
  141. <el-input v-model="scope.row.qty" size="small" type="number"></el-input>
  142. </template>
  143. </el-table-column>
  144. <el-table-column align="center" label="订单金额" min-width="100" show-overflow-tooltip>
  145. <template slot-scope="scope">
  146. {{(scope.row.price || 0) * (scope.row.qty || 0)}}
  147. </template>
  148. </el-table-column>
  149. <el-table-column align="center" label="备注" prop="remark" min-width="200" show-overflow-tooltip>
  150. <template slot-scope="scope">
  151. <el-input v-model="scope.row.remark" size="small"></el-input>
  152. </template>
  153. </el-table-column>
  154. <el-table-column align="center" label="税率" prop="taxRate" min-width="100" show-overflow-tooltip></el-table-column>
  155. <el-table-column align="center" label="操作" width="100" fixed="right">
  156. <template slot-scope="scope">
  157. <el-button type="text" @click="deleteItem(scope.$index)">删除</el-button>
  158. </template>
  159. </el-table-column>
  160. </el-table>
  161. <div class="add"><el-button type="text" icon="el-icon-plus" @click="addGoods">添加产品</el-button></div>
  162. </div>
  163. <div class="main-title">
  164. <div class="title">审批信息</div>
  165. </div>
  166. <div class="diy-table-1">
  167. <el-row :gutter="0">
  168. <el-col :span="12" class="item">
  169. <div class="label">审批人</div>
  170. <div class="value">{{userName}}</div>
  171. </el-col>
  172. <el-col :span="12" class="item">
  173. <div class="label">审批结果</div>
  174. <div class="value">
  175. <el-radio-group v-model="examineForm.examineResult">
  176. <el-radio :label="true">通过</el-radio>
  177. <el-radio :label="false">驳回</el-radio>
  178. </el-radio-group>
  179. </div>
  180. </el-col>
  181. <el-col :span="24" class="item">
  182. <div class="label">审批说明</div>
  183. <div class="value"><el-input v-model="examineForm.remark" placeholder="请输入内容"></el-input></div>
  184. </el-col>
  185. </el-row>
  186. </div>
  187. <div class="page-footer">
  188. <div class="footer">
  189. <el-button type="primary" @click="clickSubmitForm" :loading="formLoading">{{ formLoading ? '提交中 ...' : '提 交' }}</el-button>
  190. <el-popconfirm
  191. title="确定关闭吗?"
  192. @onConfirm="goBack"
  193. style="margin-left: 10px;"
  194. >
  195. <el-button slot="reference">关 闭</el-button>
  196. </el-popconfirm>
  197. </div>
  198. </div>
  199. </div>
  200. </template>
  201. <script>
  202. import { getEnginDetail, getRetailProductList, examineEngin } from "@/api/supply/engin";
  203. import { getTypeList } from "@/api/common";
  204. export default {
  205. name: 'EnginExamine',
  206. componentName: 'EnginExamine',
  207. props: ['listItem'],
  208. filters: {
  209. statusFilter(val) {
  210. const statusList = [
  211. { label: '已保存', value: 'SAVE' },
  212. { label: '待审核', value: 'WAIT' },
  213. { label: '审核通过', value: 'OK' },
  214. { label: '审核驳回', value: 'FAIL' },
  215. { label: '已关闭', value: 'CLOSE' },
  216. ];
  217. let obj = statusList.find(o => o.value == val);
  218. return obj ? obj.label : ''
  219. }
  220. },
  221. data() {
  222. return {
  223. detailData: {},
  224. goodsList: [],
  225. userName: JSON.parse(localStorage.getItem("supply_user")).nickName,
  226. formLoading: false,
  227. examineForm: {
  228. examineResult: true,
  229. remark: '',
  230. },
  231. salesTypeList: [],
  232. retailProductList: [],
  233. }
  234. },
  235. created() {
  236. this.getDetail();
  237. this.getTypeList();
  238. this.getRetailProductList();
  239. },
  240. methods: {
  241. // 返回列表
  242. goBack() {
  243. this.$emit('backListFormDetail');
  244. },
  245. // 获取详情
  246. getDetail() {
  247. getEnginDetail({id: this.listItem.enginInfoId}).then(res => {
  248. this.detailData = res.data;
  249. this.goodsList = res.data.items;
  250. })
  251. },
  252. // 获取销售类型列表
  253. getTypeList() {
  254. getTypeList({
  255. pageNum: 1,
  256. pageSize: -1,
  257. }).then((res) => {
  258. this.salesTypeList = res.data.records;
  259. });
  260. },
  261. // 获取商品列表
  262. getRetailProductList() {
  263. getRetailProductList({
  264. pageNum: 1,
  265. pageSize: -1,
  266. }).then(res => {
  267. this.retailProductList = res.data.records;
  268. })
  269. },
  270. // 修改销售类型
  271. changeSaleType(index) {
  272. if(this.goodsList[index].saleTypeId) {
  273. let obj = this.salesTypeList.find(o => o.id == this.goodsList[index].saleTypeId);
  274. this.goodsList[index].saleTypeName = obj.saleName;
  275. this.goodsList[index].saleTypeCode = obj.saleCode;
  276. }
  277. },
  278. // 修改产品
  279. changeGoods(index) {
  280. if(this.goodsList[index].materialNumber) {
  281. let obj = this.retailProductList.find(o => o.number == this.goodsList[index].materialNumber);
  282. this.goodsList[index].materialName = obj.name;
  283. this.goodsList[index].materialId = obj.materialId;
  284. this.goodsList[index].specification = obj.specification;
  285. this.goodsList[index].baseUnitId = obj.baseUnit;
  286. this.goodsList[index].price = obj.batchPrice;
  287. this.goodsList[index].taxRate = obj.taxRate;
  288. this.goodsList[index].mainId = obj.mainId;
  289. }
  290. },
  291. // 添加产品
  292. addGoods() {
  293. this.goodsList.push({})
  294. },
  295. // 删除产品
  296. deleteItem(index) {
  297. this.goodsList.splice(index, 1);
  298. },
  299. clickSubmitForm() {
  300. this.formLoading = true;
  301. examineEngin({
  302. enginInfoId: this.listItem.enginInfoId,
  303. mainId: this.listItem.mainId,
  304. examineResult: this.examineForm.examineResult,
  305. examineNote: this.examineForm.remark,
  306. contractExpireDate: this.detailData.contractExpireDate,
  307. items: this.goodsList,
  308. }).then(res => {
  309. this.$successMsg('审批成功');
  310. this.goBack();
  311. this.$parent.getList();
  312. }).finally(res => {
  313. this.formLoading = false;
  314. })
  315. },
  316. }
  317. }
  318. </script>
  319. <style scoped lang="scss">
  320. .detail-container {
  321. width: 100%;
  322. height: 100%;
  323. }
  324. .main-title {
  325. display: flex;
  326. justify-content: space-between;
  327. align-items: center;
  328. margin-top: 20px;
  329. height: 60px;
  330. border-bottom: 1px solid #DCDFE6;
  331. margin-bottom: 20px;
  332. .title {
  333. font-size: 16px;
  334. font-weight: 600;
  335. padding-left: 10px;
  336. }
  337. }
  338. .add {
  339. display: flex;
  340. align-items: center;
  341. justify-content: center;
  342. border: 1px solid #EBEEF5;
  343. border-top: none;
  344. height: 50px;
  345. }
  346. ::v-deep input::-webkit-outer-spin-button,
  347. ::v-deep input::-webkit-inner-spin-button {
  348. -webkit-appearance: none;
  349. }
  350. ::v-deep input[type='number'] {
  351. -moz-appearance: textfield;
  352. }
  353. </style>