|
@@ -75,7 +75,7 @@
|
|
|
<el-col :span="24" class="item file">
|
|
|
<div class="label">附件</div>
|
|
|
<div class="value">
|
|
|
- <div class="file-list">
|
|
|
+ <div class="file-list" v-if="detailData.fileUrl">
|
|
|
<div class="file-item">
|
|
|
<el-image v-if="checkFileType(detailData.fileUrl) == 'image'" class="img" :src="imageURL + detailData.fileUrl" :preview-src-list="[imageURL + detailData.fileUrl]"></el-image>
|
|
|
<div v-else class="box2" @click="openLink(detailData.fileUrl)">
|
|
@@ -117,10 +117,18 @@
|
|
|
</div>
|
|
|
|
|
|
<div class="table" style="margin-top: 20px">
|
|
|
- <el-table :data="detailData.orders" element-loading-text="Loading" border fit highlight-current-row stripe max-height="400">
|
|
|
+ <el-table :data="goodsList" element-loading-text="Loading" border fit highlight-current-row stripe max-height="400">
|
|
|
<el-table-column align="center" label="序号" type="index" width="50"></el-table-column>
|
|
|
<el-table-column align="center" label="销售类型" prop="saleTypeName" min-width="100" show-overflow-tooltip></el-table-column>
|
|
|
- <el-table-column align="center" label="订单日期" prop="theTime" min-width="100" show-overflow-tooltip></el-table-column>
|
|
|
+ <el-table-column align="center" label="发货仓库" prop="stockIds" min-width="160" show-overflow-tooltip>
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-select v-model="scope.row.stockIds" placeholder="请选择发货仓库" size="small" multiple filterable @change="changeWarehouse(scope.$index)">
|
|
|
+ <el-option :label="item.name" :value="item.id" v-for="(item, index) in positionList" :key="index"></el-option>
|
|
|
+ </el-select>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column align="center" label="库存数" prop="stockNumber" min-width="100" show-overflow-tooltip></el-table-column>
|
|
|
+ <el-table-column align="center" label="订单日期" prop="theTime" min-width="160" show-overflow-tooltip></el-table-column>
|
|
|
<el-table-column align="center" label="销售订单号" prop="retailOrderId" min-width="180" show-overflow-tooltip></el-table-column>
|
|
|
<el-table-column align="center" label="物料代码" prop="materialOldNumber" min-width="120" show-overflow-tooltip></el-table-column>
|
|
|
<el-table-column align="center" label="产品编码" prop="materialCode" min-width="120" show-overflow-tooltip></el-table-column>
|
|
@@ -175,20 +183,42 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { getEnginDetail, examineEngin } from "@/api/supply/apply";
|
|
|
+import { getEnginDetail, examineEngin, getPositionList, checkStock } from "@/api/supply/apply";
|
|
|
|
|
|
export default {
|
|
|
name: 'EnginExamine',
|
|
|
componentName: 'EnginExamine',
|
|
|
props: ['listItem'],
|
|
|
+ filters: {
|
|
|
+ statusFilter(val) {
|
|
|
+ const statusList = [
|
|
|
+ { label: '已保存', value: 'SAVE' },
|
|
|
+ { label: '待审核', value: 'WAIT' },
|
|
|
+ { label: '审核通过', value: 'OK' },
|
|
|
+ { label: '审核驳回', value: 'FAIL' },
|
|
|
+ { label: '已关闭', value: 'CLOSE' },
|
|
|
+ ];
|
|
|
+ let obj = statusList.find(o => o.value == val);
|
|
|
+ return obj ? obj.label : ''
|
|
|
+ },
|
|
|
+ enginTypeFilter(val) {
|
|
|
+ const MAP = {
|
|
|
+ HOME: '家用',
|
|
|
+ TRADE: '商用',
|
|
|
+ }
|
|
|
+ return MAP[val];
|
|
|
+ }
|
|
|
+ },
|
|
|
data() {
|
|
|
return {
|
|
|
+ imageURL: this.$imageUrl,
|
|
|
detailData: {},
|
|
|
userName: JSON.parse(localStorage.getItem("supply_user")).nickName,
|
|
|
|
|
|
examineForm: {
|
|
|
remark: '',
|
|
|
- }
|
|
|
+ },
|
|
|
+ positionList: [],
|
|
|
}
|
|
|
},
|
|
|
|
|
@@ -234,11 +264,87 @@ export default {
|
|
|
getDetail() {
|
|
|
getEnginDetail({id: this.listItem.id}).then(res => {
|
|
|
this.detailData = res.data;
|
|
|
+
|
|
|
+ res.data.orders.forEach((item, index) => {
|
|
|
+ if(item.stockIds && item.stockIds.length > 0) {
|
|
|
+ item.stockIds = item.stockIds.map((it, idx) => {
|
|
|
+ return it.id;
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ this.goodsList = res.data.orders;
|
|
|
+ this.getPositionList();
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+ // 获取仓位列表
|
|
|
+ getPositionList() {
|
|
|
+ getPositionList({
|
|
|
+ correspondId: this.detailData.correspondId
|
|
|
+ }).then((res) => {
|
|
|
+ this.positionList = res.data;
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+ // 修改仓位
|
|
|
+ changeWarehouse(index) {
|
|
|
+ if(this.goodsList[index].stockIds && this.goodsList[index].stockIds.length > 0) {
|
|
|
+ checkStock({
|
|
|
+ materialId: this.goodsList[index].materialId,
|
|
|
+ StockIds: this.goodsList[index].stockIds.join(',')
|
|
|
+ }).then(res => {
|
|
|
+ this.goodsList[index].stockNumber = res.data;
|
|
|
+ })
|
|
|
+ }else {
|
|
|
+ this.goodsList[index].stockNumber = 0;
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ // 检查文件类型
|
|
|
+ checkFileType(url) {
|
|
|
+ if(!url) return '';
|
|
|
+ const fileSuffix = url.substring(url.lastIndexOf(".") + 1);
|
|
|
+
|
|
|
+ if (['jpg', 'jpeg', 'png'].includes(fileSuffix)) {
|
|
|
+ return 'image';
|
|
|
+ }else if (['doc', 'docx', 'dot', 'wps', 'wpt'].includes(fileSuffix)) {
|
|
|
+ return 'word';
|
|
|
+ }else if(['xls', 'xlsx', 'xlt', 'et', 'ett'].includes(fileSuffix)) {
|
|
|
+ return 'excel';
|
|
|
+ }else if(['ppt', 'pptx', 'dps', 'dpt', 'pot', 'pps'].includes(fileSuffix)) {
|
|
|
+ return 'ppt';
|
|
|
+ }else if(['pdf'].includes(fileSuffix)) {
|
|
|
+ return 'pdf';
|
|
|
+ }else {
|
|
|
+ return '';
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ // 打开链接
|
|
|
+ openLink(url) {
|
|
|
+ getFileUrl({key: url}).then(res => {
|
|
|
+ window.open(res.data);
|
|
|
})
|
|
|
},
|
|
|
|
|
|
// 提交审批
|
|
|
clickSubmitForm(val) {
|
|
|
+ for(let i=0; i<this.goodsList.length; i++) {
|
|
|
+ if(!this.goodsList[i].approvalNumber) {
|
|
|
+ this.$errorMsg('请填写审批数量');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if(this.goodsList[i].approvalNumber > this.goodsList[i].stockNumber) {
|
|
|
+ this.$errorMsg('审批数量不可大于库存数');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if(this.goodsList[i].approvalNumber > this.goodsList[i].invoiceNum) {
|
|
|
+ this.$errorMsg('审批数量不可大于申请数量');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
this.$confirm('此操作将审批订单, 是否继续?', '提示', {
|
|
|
confirmButtonText: '确定',
|
|
|
cancelButtonText: '取消',
|
|
@@ -248,7 +354,7 @@ export default {
|
|
|
id: this.detailData.id,
|
|
|
examineStatus: val,
|
|
|
approvalRemark: this.examineForm.remark,
|
|
|
- orders: this.detailData.orders,
|
|
|
+ orders: this.goodsList,
|
|
|
};
|
|
|
examineEngin(params).then(res => {
|
|
|
this.$successMsg();
|