From a45dea9b944660a28550da065734a349afd005d3 Mon Sep 17 00:00:00 2001
From: xiaofajia <1665375861@qq.com>
Date: Thu, 10 Oct 2024 16:41:16 +0800
Subject: [PATCH 1/3] =?UTF-8?q?=E4=BF=A1=E6=81=AF=E5=85=AC=E5=91=8A-?=
=?UTF-8?q?=E5=AE=8C=E5=96=84?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../truncatedText/TruncatedText.vue | 59 +++++++++++++++++++
src/views/base/notice/BaseNotice.vue | 54 ++++++++++-------
2 files changed, 91 insertions(+), 22 deletions(-)
create mode 100644 src/components/truncatedText/TruncatedText.vue
diff --git a/src/components/truncatedText/TruncatedText.vue b/src/components/truncatedText/TruncatedText.vue
new file mode 100644
index 0000000..f594ddf
--- /dev/null
+++ b/src/components/truncatedText/TruncatedText.vue
@@ -0,0 +1,59 @@
+
+
+
{{ truncatedText }}
+
{{showAll?'收起':'展开'}}
+
+
+
+
+
+
diff --git a/src/views/base/notice/BaseNotice.vue b/src/views/base/notice/BaseNotice.vue
index f041058..9bc5b9a 100644
--- a/src/views/base/notice/BaseNotice.vue
+++ b/src/views/base/notice/BaseNotice.vue
@@ -6,7 +6,8 @@
-
@@ -19,14 +20,18 @@
新增
+ >新增
-
+
+
+ {{ scope.$index + 1 }}
+
+
@@ -38,18 +43,22 @@
-
+
+
+
+
+
修改
+ >修改
删除
+ >删除
-
-
-
+
+
+
@@ -63,24 +72,25 @@
From 5f3c59fa939e274246919ba6ce37394b8a8aec1b Mon Sep 17 00:00:00 2001
From: xiaofajia <1665375861@qq.com>
Date: Thu, 10 Oct 2024 17:04:17 +0800
Subject: [PATCH 2/3] =?UTF-8?q?=E7=BB=B4=E4=BF=AE=E5=BC=80=E5=8D=95?=
=?UTF-8?q?=E4=BF=AE=E5=A4=8D?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/views/repair/tickets/Components/UserInfo.vue | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/views/repair/tickets/Components/UserInfo.vue b/src/views/repair/tickets/Components/UserInfo.vue
index 5245a2a..b3d22ff 100644
--- a/src/views/repair/tickets/Components/UserInfo.vue
+++ b/src/views/repair/tickets/Components/UserInfo.vue
@@ -506,7 +506,7 @@ export default {
},
// 新增基础信息init
createInit() {
- this.formData.bookingId = this.formData?.bookingId.toString() || null
+ this.formData.bookingId = this.formData?.bookingId?.toString() || null
// 生成工单号
this.formData.ticketNo = this.formData.ticketNo || createUniqueCodeByHead("GD")
// 质保说明
From 1e061b101b0577c4444c6fdd94c4cf6885fb3b80 Mon Sep 17 00:00:00 2001
From: xiaofajia <1665375861@qq.com>
Date: Fri, 11 Oct 2024 17:14:57 +0800
Subject: [PATCH 3/3] =?UTF-8?q?=E4=BC=98=E5=8C=96=E9=83=A8=E5=88=86?=
=?UTF-8?q?=E4=BB=A3=E7=A0=81=E4=B8=8E=E9=87=87=E8=B4=AD=E3=80=81=E9=A2=86?=
=?UTF-8?q?=E6=96=99=E5=85=B3=E8=81=94=E9=85=8D=E4=BB=B6=E5=BA=93?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/views/repair/Components/PartChoose.vue | 34 +++++++-------
.../repair/stockOperate/Components/SoInfo.vue | 45 ++++++++++++++++--
.../stockOperate/Components/SoTable.vue | 44 ++++++++++--------
src/views/repair/stockOperate/InStock.vue | 28 +++++++++--
.../stockTransfer/Components/StInfo.vue | 2 +-
src/views/repair/wares/WaresForm.vue | 46 +++++++++++--------
src/views/repair/wares/index.vue | 1 +
7 files changed, 138 insertions(+), 62 deletions(-)
diff --git a/src/views/repair/Components/PartChoose.vue b/src/views/repair/Components/PartChoose.vue
index cfe6814..8d58bd8 100644
--- a/src/views/repair/Components/PartChoose.vue
+++ b/src/views/repair/Components/PartChoose.vue
@@ -1,5 +1,5 @@
-
+
@@ -8,20 +8,21 @@
-
-
-
-
-
- {{scope.row.name}}
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -110,7 +111,8 @@ export default {
},
methods: {
// TODO 获取商品信息
- async listPart() {
+ async listPart(val) {
+ this.queryParams.name = val
try{
this.loading = true
const res = await getWaresPage(this.queryParams)
diff --git a/src/views/repair/stockOperate/Components/SoInfo.vue b/src/views/repair/stockOperate/Components/SoInfo.vue
index aa5e8d6..b9b44a2 100644
--- a/src/views/repair/stockOperate/Components/SoInfo.vue
+++ b/src/views/repair/stockOperate/Components/SoInfo.vue
@@ -21,7 +21,7 @@
-
+
@@ -32,6 +32,10 @@
+
+ 新增商品
+ 急件采购
+
@@ -58,6 +62,7 @@
+
@@ -69,10 +74,14 @@ import SoTable from "@/views/repair/stockOperate/Components/SoTable.vue";
import SupplierChoose from "@/views/repair/Components/SupplierChoose.vue";
import {createUniqueCodeByHead} from "@/utils/createUniqueCode";
import {createRepairSo} from "@/api/repair/stockOperate/stockOperate";
+import {getWaresByName} from "@/api/repair/wares";
+import WaresForm from "@/views/repair/wares/WaresForm.vue";
+import router from "@/router";
export default {
name: "SoInfo",
components: {
+ WaresForm,
StaffChoose,
PartChoose,
SoTable,
@@ -84,6 +93,11 @@ export default {
defaultValue: true,
required: true
},
+ soType:{
+ type: String,
+ default: "",
+ required: false
+ }
},
data() {
return {
@@ -108,6 +122,9 @@ export default {
this.init()
},
methods: {
+ router() {
+ return router
+ },
// 得到选择的员工
getStaff(data) {
this.formData.userId = data.id
@@ -142,11 +159,12 @@ export default {
this.formData.goodsList = data.map(item => {
return {
goodsId: item.id,
- goodsType: "0",
+ goodsType: this.soType ? "1": "0",
wareId: item.wareId,
goodsCount: item.count,
goodsPrice: item.newPrice,
- remark: item.remark
+ remark: item.remark,
+ soiType: this.soByType ? "01" : "02"
}
})
},
@@ -178,6 +196,10 @@ export default {
this.formData.soNo = createUniqueCodeByHead(this.soByType ? "CG" : "LL")
this.staffRole = this.soByType ? this.staffRole : "领料人"
this.partList = []
+ if (this.soType){
+ this.formData.soType = this.soType
+ this.formData.purchaseType = '02'
+ }
},
// 提交前的构建
async createInit(){
@@ -194,6 +216,23 @@ export default {
supplierName: data?.supplier?.name
}
}
+ },
+ // 新增商品
+ newWares(){
+ this.$refs.waresForm.open(null);
+ },
+ // 新增商品回调
+ async pushData(name){
+ const res = await getWaresByName(name)
+ const data = res.data
+ this.partList.push({
+ ...data,
+ wareId: data.warehouse
+ })
+ },
+ // 急件采购
+ newInStock(){
+ this.$router.push("/repair/stock/repair-soi?active=purchaseCreate&soType=03")
}
}
}
diff --git a/src/views/repair/stockOperate/Components/SoTable.vue b/src/views/repair/stockOperate/Components/SoTable.vue
index 4055012..edd21de 100644
--- a/src/views/repair/stockOperate/Components/SoTable.vue
+++ b/src/views/repair/stockOperate/Components/SoTable.vue
@@ -19,7 +19,8 @@
-
+
{{ scope.row.warehouseName }}
@@ -31,21 +32,24 @@
-
+
{{ scope.row.count }}
-
+
-
+
{{ scope.row.newPrice }}
-
+
{{ scope.row.remark }}
@@ -91,16 +95,16 @@ export default {
watch: {
partList(val) {
if (val && val.length > 0) {
- const data = val[val.length - 1]
- const newData = {
- ...data,
- count: 1,
- totalPrice: data.price * 1,
- remark: '',
- newPrice: data.price,
- }
- this.list.push(newData)
- }else {
+ this.list = val.map(item => {
+ return {
+ ...item,
+ count: 1,
+ totalPrice: item.purPrice * 1,
+ remark: '',
+ newPrice: item.purPrice,
+ }
+ })
+ } else {
this.list = []
}
},
@@ -182,7 +186,11 @@ export default {
}
},
/** 保存数据 */
- save (row) {
+ save(row) {
+ if (!this.soByType && row.stock < row.count){
+ row.count = 1
+ this.$modal.msgError("库存数量不足")
+ }
// 更新表格的数据
row.totalPrice = row.count * row.newPrice
const id = row.id
@@ -192,8 +200,8 @@ export default {
})
this.clickCellMap[id] = []
},
- changeWare(row){
- if (row.ware){
+ changeWare(row) {
+ if (row.ware) {
row['wareId'] = row.ware.id
row['warehouse'] = row.ware.id
row['warehouseName'] = row.ware.name
diff --git a/src/views/repair/stockOperate/InStock.vue b/src/views/repair/stockOperate/InStock.vue
index 6fb300e..caa782b 100644
--- a/src/views/repair/stockOperate/InStock.vue
+++ b/src/views/repair/stockOperate/InStock.vue
@@ -1,12 +1,12 @@
-
+
-
-
-
+
+
+
@@ -14,7 +14,7 @@
-
+
@@ -39,10 +39,12 @@ export default {
return {
activeTab: "purchase",
soByType: true,
+ soType: null
}
},
created() {
this.isType()
+ this.init()
},
methods: {
// 判断是什么单据,决定字段的属性、展示否等
@@ -50,6 +52,22 @@ export default {
const url = this.$route.path
this.soByType = url.includes("soi")
},
+ // 判断是点进来的还是跳转过来的
+ async init(){
+ const active = this.$route.query.active
+ if (active){
+ this.activeTab = active
+ }
+ const soType = this.$route.query.soType
+ if (soType){
+ this.soType = soType
+ }
+ },
+ changeTab(tab, event){
+ // if (this.soType){
+ // this.$router.push("/repair/stock/repair-soi")
+ // }
+ }
}
}
diff --git a/src/views/repair/stockTransfer/Components/StInfo.vue b/src/views/repair/stockTransfer/Components/StInfo.vue
index 2917c54..3887bb0 100644
--- a/src/views/repair/stockTransfer/Components/StInfo.vue
+++ b/src/views/repair/stockTransfer/Components/StInfo.vue
@@ -20,7 +20,7 @@
-
+
diff --git a/src/views/repair/wares/WaresForm.vue b/src/views/repair/wares/WaresForm.vue
index df611f9..942b81c 100644
--- a/src/views/repair/wares/WaresForm.vue
+++ b/src/views/repair/wares/WaresForm.vue
@@ -54,18 +54,13 @@
-
-
+
+
-
-
+
+
@@ -85,19 +80,18 @@
-
-
+
+
-
-
-
+
+
@@ -122,6 +116,17 @@
+
+
+
+
+
+
@@ -212,10 +217,12 @@ export default {
dataForm: undefined,
corpIds: [],
status: '01',
+ purPrice: undefined
},
// 表单校验
formRules: {
name: [{required: true, message: '商品名称不能为空', trigger: 'blur'}],
+ purPrice: [{required: true, message: '进价不能为空', trigger: 'blur'}],
price: [{required: true, message: '销售价格不能为空', trigger: 'blur'}],
unit: [{required: true, message: '计量单位不能为空', trigger: 'blur'}],
type: [{required: true, message: '所属分类不能为空', trigger: 'blur'}],
@@ -337,6 +344,7 @@ export default {
dataForm: undefined,
corpIds: [],
status: '01',
+ purPrice: undefined
};
this.resetForm("formRef");
}
diff --git a/src/views/repair/wares/index.vue b/src/views/repair/wares/index.vue
index 560f733..34fa54c 100644
--- a/src/views/repair/wares/index.vue
+++ b/src/views/repair/wares/index.vue
@@ -35,6 +35,7 @@
+